Skip to content

Instantly share code, notes, and snippets.

@vanga

vanga/node-stats Secret

Last active March 2, 2017 02:24
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 vanga/2cd8e1fd7c3b2bffa89fda8ce3a8a481 to your computer and use it in GitHub Desktop.
Save vanga/2cd8e1fd7c3b2bffa89fda8ce3a8a481 to your computer and use it in GitHub Desktop.
{
"_nodes" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"cluster_name" : "test",
"nodes" : {
"pamGzBPaRV2aZOZcnoqhbQ" : {
"timestamp" : 1488421321389,
"name" : "test",
"transport_address" : "10.0.135.11:9300",
"host" : "10.0.135.11",
"ip" : "10.0.135.11:9300",
"roles" : [
"master",
"data",
"ingest"
],
"attributes" : {
"rack_id" : "spot"
},
"indices" : {
"docs" : {
"count" : 47363574,
"deleted" : 4158790
},
"store" : {
"size_in_bytes" : 36110924232,
"throttle_time_in_millis" : 0
},
"indexing" : {
"index_total" : 0,
"index_time_in_millis" : 0,
"index_current" : 0,
"index_failed" : 1,
"delete_total" : 0,
"delete_time_in_millis" : 0,
"delete_current" : 0,
"noop_update_total" : 0,
"is_throttled" : false,
"throttle_time_in_millis" : 0
},
"get" : {
"total" : 0,
"time_in_millis" : 0,
"exists_total" : 0,
"exists_time_in_millis" : 0,
"missing_total" : 0,
"missing_time_in_millis" : 0,
"current" : 0
},
"search" : {
"open_contexts" : 0,
"query_total" : 517678,
"query_time_in_millis" : 1099719,
"query_current" : 0,
"fetch_total" : 0,
"fetch_time_in_millis" : 0,
"fetch_current" : 0,
"scroll_total" : 0,
"scroll_time_in_millis" : 0,
"scroll_current" : 0,
"suggest_total" : 0,
"suggest_time_in_millis" : 0,
"suggest_current" : 0
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 87,
"total_time_in_millis" : 1948798,
"total_docs" : 28586416,
"total_size_in_bytes" : 18734257496,
"total_stopped_time_in_millis" : 0,
"total_throttled_time_in_millis" : 0,
"total_auto_throttle_in_bytes" : 3641418470
},
"refresh" : {
"total" : 10,
"total_time_in_millis" : 94,
"listeners" : 0
},
"flush" : {
"total" : 1,
"total_time_in_millis" : 33
},
"warmer" : {
"current" : 0,
"total" : 193,
"total_time_in_millis" : 42
},
"query_cache" : {
"memory_size_in_bytes" : 5632480,
"total_count" : 1182492,
"hit_count" : 478871,
"miss_count" : 703621,
"cache_size" : 323,
"cache_count" : 1640,
"evictions" : 1317
},
"fielddata" : {
"memory_size_in_bytes" : 233792,
"evictions" : 0
},
"completion" : {
"size_in_bytes" : 0
},
"segments" : {
"count" : 177,
"memory_in_bytes" : 49774945,
"terms_memory_in_bytes" : 13412230,
"stored_fields_memory_in_bytes" : 14981288,
"term_vectors_memory_in_bytes" : 0,
"norms_memory_in_bytes" : 341504,
"points_memory_in_bytes" : 17716447,
"doc_values_memory_in_bytes" : 3323476,
"index_writer_memory_in_bytes" : 0,
"version_map_memory_in_bytes" : 0,
"fixed_bit_set_memory_in_bytes" : 0,
"max_unsafe_auto_id_timestamp" : -1,
"file_sizes" : { }
},
"translog" : {
"operations" : 0,
"size_in_bytes" : 4085
},
"request_cache" : {
"memory_size_in_bytes" : 2956086,
"evictions" : 0,
"hit_count" : 259321,
"miss_count" : 4728
},
"recovery" : {
"current_as_source" : 0,
"current_as_target" : 0,
"throttle_time_in_millis" : 261891
}
},
"os" : {
"timestamp" : 1488421321398,
"cpu" : {
"percent" : 0,
"load_average" : {
"1m" : 0.02,
"5m" : 0.14,
"15m" : 0.27
}
},
"mem" : {
"total_in_bytes" : 8369864704,
"free_in_bytes" : 109170688,
"used_in_bytes" : 8260694016,
"free_percent" : 1,
"used_percent" : 99
},
"swap" : {
"total_in_bytes" : 0,
"free_in_bytes" : 0,
"used_in_bytes" : 0
},
"cgroup" : {
"cpuacct" : {
"control_group" : "/system.slice/elasticsearch.service",
"usage_nanos" : 4825228737121
},
"cpu" : {
"control_group" : "/system.slice/elasticsearch.service",
"cfs_period_micros" : 100000,
"cfs_quota_micros" : -1,
"stat" : {
"number_of_elapsed_periods" : 0,
"number_of_times_throttled" : 0,
"time_throttled_nanos" : 0
}
}
}
},
"process" : {
"timestamp" : 1488421321398,
"open_file_descriptors" : 553,
"max_file_descriptors" : 333333,
"cpu" : {
"percent" : 0,
"total_in_millis" : 4825180
},
"mem" : {
"total_virtual_in_bytes" : 43154501632
}
},
"jvm" : {
"timestamp" : 1488421321398,
"uptime_in_millis" : 60317374,
"mem" : {
"heap_used_in_bytes" : 2736026112,
"heap_used_percent" : 63,
"heap_committed_in_bytes" : 4277534720,
"heap_max_in_bytes" : 4277534720,
"non_heap_used_in_bytes" : 164795440,
"non_heap_committed_in_bytes" : 174084096,
"pools" : {
"young" : {
"used_in_bytes" : 67319976,
"max_in_bytes" : 139591680,
"peak_used_in_bytes" : 139591680,
"peak_max_in_bytes" : 139591680
},
"survivor" : {
"used_in_bytes" : 311872,
"max_in_bytes" : 17432576,
"peak_used_in_bytes" : 17432576,
"peak_max_in_bytes" : 17432576
},
"old" : {
"used_in_bytes" : 2668394264,
"max_in_bytes" : 4120510464,
"peak_used_in_bytes" : 3176348712,
"peak_max_in_bytes" : 4120510464
}
}
},
"threads" : {
"count" : 53,
"peak_count" : 65
},
"gc" : {
"collectors" : {
"young" : {
"collection_count" : 3888,
"collection_time_in_millis" : 110622
},
"old" : {
"collection_count" : 6,
"collection_time_in_millis" : 484
}
}
},
"buffer_pools" : {
"direct" : {
"count" : 38,
"used_in_bytes" : 73523695,
"total_capacity_in_bytes" : 73523694
},
"mapped" : {
"count" : 1213,
"used_in_bytes" : 36075891119,
"total_capacity_in_bytes" : 36075891119
}
},
"classes" : {
"current_loaded_count" : 15925,
"total_loaded_count" : 16108,
"total_unloaded_count" : 183
}
},
"thread_pool" : {
"bulk" : {
"threads" : 1,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 1,
"completed" : 1
},
"fetch_shard_started" : {
"threads" : 1,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 4,
"completed" : 651
},
"fetch_shard_store" : {
"threads" : 1,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 4,
"completed" : 584
},
"flush" : {
"threads" : 1,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 1,
"completed" : 89
},
"force_merge" : {
"threads" : 1,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 1,
"completed" : 5
},
"generic" : {
"threads" : 9,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 9,
"completed" : 124102
},
"get" : {
"threads" : 0,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 0,
"completed" : 0
},
"index" : {
"threads" : 0,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 0,
"completed" : 0
},
"listener" : {
"threads" : 0,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 0,
"completed" : 0
},
"management" : {
"threads" : 4,
"queue" : 0,
"active" : 1,
"rejected" : 0,
"largest" : 4,
"completed" : 33760
},
"refresh" : {
"threads" : 1,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 1,
"completed" : 150715
},
"search" : {
"threads" : 4,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 4,
"completed" : 589749
},
"snapshot" : {
"threads" : 0,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 0,
"completed" : 0
},
"warmer" : {
"threads" : 1,
"queue" : 0,
"active" : 0,
"rejected" : 0,
"largest" : 1,
"completed" : 276
}
},
"fs" : {
"timestamp" : 1488421321399,
"total" : {
"total_in_bytes" : 52710469632,
"free_in_bytes" : 16572379136,
"available_in_bytes" : 14343741440
},
"data" : [
{
"path" : "/data/elasticsearch/nodes/0",
"mount" : "/data (/dev/xvdb)",
"type" : "ext4",
"total_in_bytes" : 52710469632,
"free_in_bytes" : 16572379136,
"available_in_bytes" : 14343741440,
"spins" : "false"
}
],
"io_stats" : {
"devices" : [
{
"device_name" : "xvdb",
"operations" : 1059118,
"read_operations" : 358065,
"write_operations" : 701053,
"read_kilobytes" : 32547380,
"write_kilobytes" : 84003692
}
],
"total" : {
"operations" : 1059118,
"read_operations" : 358065,
"write_operations" : 701053,
"read_kilobytes" : 32547380,
"write_kilobytes" : 84003692
}
}
},
"transport" : {
"server_open" : 65,
"rx_count" : 2950074,
"rx_size_in_bytes" : 62013980684,
"tx_count" : 2950074,
"tx_size_in_bytes" : 21342600952
},
"http" : {
"current_open" : 38,
"total_opened" : 1438
},
"breakers" : {
"request" : {
"limit_size_in_bytes" : 2566520832,
"limit_size" : "2.3gb",
"estimated_size_in_bytes" : 0,
"estimated_size" : "0b",
"overhead" : 1.0,
"tripped" : 0
},
"fielddata" : {
"limit_size_in_bytes" : 2566520832,
"limit_size" : "2.3gb",
"estimated_size_in_bytes" : 233792,
"estimated_size" : "228.3kb",
"overhead" : 1.03,
"tripped" : 0
},
"in_flight_requests" : {
"limit_size_in_bytes" : 4277534720,
"limit_size" : "3.9gb",
"estimated_size_in_bytes" : 0,
"estimated_size" : "0b",
"overhead" : 1.0,
"tripped" : 0
},
"parent" : {
"limit_size_in_bytes" : 2994274304,
"limit_size" : "2.7gb",
"estimated_size_in_bytes" : 233792,
"estimated_size" : "228.3kb",
"overhead" : 1.0,
"tripped" : 0
}
},
"script" : {
"compilations" : 12,
"cache_evictions" : 0
},
"discovery" : {
"cluster_state_queue" : {
"total" : 0,
"pending" : 0,
"committed" : 0
}
},
"ingest" : {
"total" : {
"count" : 0,
"time_in_millis" : 0,
"current" : 0,
"failed" : 0
},
"pipelines" : { }
}
}
}
}
{
"size": 0,
"query": {
"bool": {
"filter": [
{
"range": {
"time_stamp": {
"time_zone": "+05:30",
"gte": "2017-02-22T00:00:00.000",
"lte": "2017-03-01T00:00:00.000"
}
}
}
]
}
},
"aggregations": {
"__test_multi_query_filter_MMOTJoOt0t8__": {
"meta": {
"field": "locations",
"keyword": "in"
},
"terms": {
"field": "locations",
"size": 10000,
"order": {
"_term": "asc"
}
},
"aggs": {
"__test_filtered__": {
"filter": {
"bool": {
"should": [
{
"exists": {
"field": "xyz"
}
}
]
}
},
"aggs": {
"latestByTimeStamp__f7BedzrFUQ__test_meta__WMk4jA0bd24": {
"meta": {
"keyword": "__latestByTimeStamp__",
"isFunction": true,
"aggregationType": "scripted_metric",
"firstBucketAggregation": "total",
"bucketAggregation": "total",
"functionName": "latestByTimeStamp",
"displayLabel": "latestByTimeStamp_LATEST(xyz)",
"returnDataClass": "continuousNumeric"
},
"scripted_metric": {
"params": {
"_agg": {},
"global": {
"timestamp": "time_stamp"
}
},
"init_script": "params._agg['r_v_map'] = [];",
"map_script": "def timestamp = (double) doc[params.global.timestamp].value; def latestByTimeStamp_result = null; def latestByTimeStamp_params = [:];def args = null; def xyz_result = null; def xyz_params = [:];def r_v_args = []; xyz_result = null; xyz_params = [:];args = null;if (!doc['xyz'].empty) { xyz_result = (double) doc['xyz'].value } else { xyz_result = null} r_v_args.add(xyz_result); args = r_v_args; latestByTimeStamp_result = [:]; latestByTimeStamp_params = [:]; latestByTimeStamp_params.value = null; latestByTimeStamp_params.time = null;if (args.size() > 1) {latestByTimeStamp_params.value = args[0]; latestByTimeStamp_params.time = args[1];}else if (args.size() == 1){latestByTimeStamp_params.value = args[0]; latestByTimeStamp_params.time = timestamp;}if (latestByTimeStamp_params.value != null && latestByTimeStamp_params.time != null) { latestByTimeStamp_result['t'] = (double) latestByTimeStamp_params.time; latestByTimeStamp_result['v'] = latestByTimeStamp_params.value;} else {latestByTimeStamp_result = null}params._agg['r_v_map'].add(latestByTimeStamp_result);r_v_args = [];",
"combine_script": "def args = params._agg['r_v_map'];def latestByTimeStamp_result = [:]; def latestByTimeStamp_params = [:];latestByTimeStamp_params.maxTimestamp = 0d;latestByTimeStamp_params.values = [];for (arg in args){ if (arg != null && arg['t'] != null && arg['v'] != null) { if (arg['t'] > latestByTimeStamp_params.maxTimestamp) { latestByTimeStamp_params.maxTimestamp = arg['t']; latestByTimeStamp_params.values = [arg['v']]; } else if (arg['t'] == latestByTimeStamp_params.maxTimestamp) { latestByTimeStamp_params.values.add(arg['v']); } }}if (latestByTimeStamp_params.maxTimestamp != 0) { latestByTimeStamp_result = [:]; latestByTimeStamp_result['t'] = latestByTimeStamp_params.maxTimestamp; latestByTimeStamp_result['v'] = latestByTimeStamp_params.values;}params._agg['r_v_combine'] = latestByTimeStamp_result;params._agg['r_v_map'] = []; params._agg;",
"reduce_script": {
"inline": "if (params._aggs != null) {params.r_v_args = [];for (arg in params._aggs){if (arg != null) { if (arg['r_v_combine'] != null){params.r_v_args.add(arg['r_v_combine']);}}}}def args = params.r_v_args;def latestByTimeStamp_result = [:]; def latestByTimeStamp_params = [:];latestByTimeStamp_params.maxTimestamp = 0d;latestByTimeStamp_params.values = [];for (arg in args){ if (arg != null && arg['t'] != null && arg['v'] != null) { if (arg['t'] > latestByTimeStamp_params.maxTimestamp) { latestByTimeStamp_params.maxTimestamp = arg['t']; latestByTimeStamp_params.values = arg['v']; } else if (arg['t'] == latestByTimeStamp_params.maxTimestamp) { latestByTimeStamp_params.values.addAll(arg['v']); } }}if (latestByTimeStamp_params.values != null && latestByTimeStamp_params.values.size() != 0) { if (latestByTimeStamp_params.values[0] instanceof String) { Collections.sort(latestByTimeStamp_params.values); latestByTimeStamp_result['return_type'] = 'string'; latestByTimeStamp_result['string_result'] = latestByTimeStamp_params.values[0]; } else { latestByTimeStamp_result['return_type'] = 'double'; latestByTimeStamp_result['double_result'] = (double) (Collections.max(latestByTimeStamp_params.values)); }} else {latestByTimeStamp_result = null;} if (latestByTimeStamp_result != null) { if (latestByTimeStamp_result['return_type'] == 'string') { return latestByTimeStamp_result['string_result']; } else if (latestByTimeStamp_result['return_type'] == 'double') { return latestByTimeStamp_result['double_result']; } else if (latestByTimeStamp_result instanceof ArrayList) { return latestByTimeStamp_result; } } else { return null;} ",
"params": {
"r_v": [],
"r_v_args": []
}
}
}
}
}
}
}
}
}
}
{
"size": 0,
"query": {
"bool": {
"filter": [
{
"range": {
"time_stamp": {
"time_zone": "+05:30",
"gte": "2017-02-22T00:00:00.000",
"lte": "2017-03-01T00:00:00.000"
}
}
}
]
}
},
"aggregations": {
"__test_filtered__": {
"filter": {
"terms": {
"location": [ "~110 terms"
]
}
},
"aggs": {
"__test_missing_value_bucket__": {
"missing": {
"field": "location"
},
"meta": {
"aggName": "locations"
},
"aggs": {
"__geolocation__": {
"meta": {
"field": "location__geolocation_as_string__",
"keyword": "list",
"isGeopoint": true
},
"terms": {
"field": "location__geolocation_as_string__",
"size": 10000,
"order": {
"_term": "asc"
}
}
},
"latestValue_xyz__test_meta__3dt1u1jvuak": {
"meta": {
"field": "xyz",
"keyword": "latest",
"resultType": "singleValue"
},
"terms": {
"field": "xyz",
"size": 1,
"order": {
"byMax_Timestamp": "desc"
}
},
"aggs": {
"byMax_Timestamp": {
"meta": {
"field": "time_stamp",
"keyword": "byMax"
},
"max": {
"field": "time_stamp"
}
}
}
}
}
},
"__test_page_filter__": {
"filter": {
"exists": {
"field": "location"
}
},
"aggs": {
"locations": {
"terms": {
"field": "location",
"size": 10000,
"order": {
"_term": "asc"
}
},
"meta": {
"field": "location",
"keyword": "over"
},
"aggs": {
"__geolocation__": {
"meta": {
"field": "location__geolocation_as_string__",
"keyword": "list",
"isGeopoint": true
},
"terms": {
"field": "location__geolocation_as_string__",
"size": 10000,
"order": {
"_term": "asc"
}
}
},
"latestValue_xyz__test_meta__3dt1u1jvuak": {
"meta": {
"field": "xyz",
"keyword": "latest",
"resultType": "singleValue"
},
"terms": {
"field": "xyz",
"size": 1,
"order": {
"byMax_Timestamp": "desc"
}
},
"aggs": {
"byMax_Timestamp": {
"meta": {
"field": "time_stamp",
"keyword": "byMax"
},
"max": {
"field": "time_stamp"
}
}
}
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment