Skip to content

Instantly share code, notes, and snippets.

@inokappa
Last active December 28, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inokappa/7535766 to your computer and use it in GitHub Desktop.
Save inokappa/7535766 to your computer and use it in GitHub Desktop.
// クエリ
curl -XPOST "http://localhost:9200/siege/webresp_time/_search?pretty" -d'
{
"query" : {
"match_all": {}
},
"facets" : {
"stat1" : {
"statistical" : {
"field" : "Resp_Time"
}
}
}
}'
// 結果
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 3,
"max_score" : 1.0,
"hits" : [ {
"_index" : "siege",
"_type" : "webresp_time",
"_id" : "PGWIIRnbQXi93fXKOqIM6g",
"_score" : 1.0, "_source" : {"date":"2013-11-19 00:54:03","Trans":"9","Elap_Time":"5.97","Data_Trans":"0","Resp_Time":"1.99","Trans_Rate":"1.51","Throughput":"0.00","Concurrent":"2.99","OKAY":"9","Failed":"0","@log_name":"siege.access"}
}, {
"_index" : "siege",
"_type" : "webresp_time",
"_id" : "IK1NLg0pRteI4rBVzW16bQ",
"_score" : 1.0, "_source" : {"date":"2013-11-19 06:16:32","Trans":"9","Elap_Time":"5.04","Data_Trans":"0","Resp_Time":"1.60","Trans_Rate":"1.79","Throughput":"0.00","Concurrent":"2.86","OKAY":"9","Failed":"0","@log_name":"siege.access"}
}, {
"_index" : "siege",
"_type" : "webresp_time",
"_id" : "gRrTr71eQK-40aZLuZ7GMg",
"_score" : 1.0, "_source" : {"date":"2013-11-19 01:00:00","Trans":"9","Elap_Time":"6.59","Data_Trans":"0","Resp_Time":"2.11","Trans_Rate":"1.37","Throughput":"0.00","Concurrent":"2.88","OKAY":"9","Failed":"0","@log_name":"siege.access"}
} ]
},
"facets" : {
"stat1" : {
"_type" : "statistical",
"count" : 3,
"total" : 5.699999999999999,
"min" : 1.6,
"max" : 2.11,
"mean" : 1.8999999999999997,
"sum_of_squares" : 10.9722,
"variance" : 0.04740000000000085,
"std_deviation" : 0.21771541057077437
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment