Skip to content

Instantly share code, notes, and snippets.

@shersh
shersh / README.md
Created September 13, 2023 08:36 — 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 -p 7000:7000 -p 7001:7001 -p 7002:7002 -e "IP=0.0.0.0" grokzen/redis-cluster:latest
@shersh
shersh / gist:bc0ecda3a9b19e9a4cf937c9cbaa3798
Created December 30, 2017 18:20
Get all IP adress of nodes in Jenkins
import hudson.model.Computer.ListPossibleNames
def node = jenkins.model.Jenkins.instance.getNode( "slave-2" )
println node.computer.getChannel().call(new ListPossibleNames())
@shersh
shersh / CharacterMotorC.cs
Created January 12, 2017 11:55 — forked from zephjc/CharacterMotorC.cs
Fixed C# replacements of CharacterMotor.js and FPSInputController.js via http://forum.unity3d.com/threads/93527-FPSInputController-and-CharacterMotor-in-Csharp Changes from above link: FPSInputController: Removed "Event.laddertrigger" code which is not part of the original JS file CharacterMotor: Lets the various inner properties classes show up…
using UnityEngine;
using System.Collections;
//#pragma strict
//#pragma implicit
//#pragma downcast
// Require a character controller to be attached to the same game object
// I had to initally comment out the following RequireComponent
// line to make it compile and allow attaching to my Main Camera;
public class DbActor : ReceiveActor
{
public class Query
{
public Func<Db, IQueryable> Filter;
}
public DbActor()
{
Receive<Query>(query =>
using System;
using System.Diagnostics;
using Akka.Actor;
using Akka.Configuration;
namespace TestAkka
{
public class HelloActor : ReceiveActor
{
public HelloActor()