Skip to content

Instantly share code, notes, and snippets.

@kgorman
Created February 12, 2013 23:30
Show Gist options
  • Save kgorman/4774497 to your computer and use it in GitHub Desktop.
Save kgorman/4774497 to your computer and use it in GitHub Desktop.
Profiler Agg Framework Example1
> db.system.profile.aggregate(
{ $group :
{ _id :"$op",
count:{$sum:1},
"max response time":{$max:"$millis"},
"avg response time":{$avg:"$millis"}
}
});
{
"result" : [
{ "_id" : "command", "count" : 1, "max response time" : 0, "avg response time" : 0 },
{ "_id" : "query", "count" : 12, "max response time" : 571, "avg response time" : 5 },
{ "_id" : "update", "count" : 842, "max response time" : 111, "avg response time" : 40 },
{ "_id" : "insert", "count" : 1633, "max response time" : 2, "avg response time" : 1 }
],
"ok" : 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment