Skip to content

Instantly share code, notes, and snippets.

@kaliaparijat
Created March 24, 2014 06:31
Show Gist options
  • Save kaliaparijat/9735178 to your computer and use it in GitHub Desktop.
Save kaliaparijat/9735178 to your computer and use it in GitHub Desktop.
db.results.aggregate([
{
$match: {
$and:[
{
"profile.Zend_Http_Client_Adapter_Curl::write==>curl_exec": {
"$exists": true }
},
{
"profile.main().wt": {
$lte: 10000000 }
}
]
}
},
{
$group: {
"_id": null,
"count":{$sum:1},
"$curlExecAvg":{
$avg: "$profile.Zend_Http_Client_Adapter_Curl::write==>curl_exec.wt"}
}
},
{
$project:{
"_id": 0,
"curlExec":{$divide:["$curlExecAvg", 1000000]}
}
}
])
db.results.aggregate([
{
$match: {
$and:[
{
"profile.Zend_Http_Client_Adapter_Socket::read==>fgets": {
"$exists": true }
},
{
"profile.main().wt": {
$lte: 10000000}
}
]
}
},
{
$group: {
"_id": null,
"count":{$sum:1},
"fgetsAvg": {
$avg: "$profile.Zend_Http_Client_Adapter_Socket::read==>fgets.wt"
},
"mainAvg" :{
$avg: "$profile.main().wt"
},
}
}
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment