Skip to content

Instantly share code, notes, and snippets.

View astromahi's full-sized avatar

Mahendran Kathirvel astromahi

View GitHub Profile
@astromahi
astromahi / README.md
Created May 24, 2017 07:54 — forked from rantav/README.md
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

docker run -d --name consul --net=host gliderlabs/consul-server -bootstrap -advertise=192.168.99.100
@astromahi
astromahi / xmas.go
Created December 28, 2015 12:24 — forked from bradfitz/xmas.go
Brad's xmas lights
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,