elasticsearch_plugin: python 2.6 compatibility fix
Ilya committed
Feb 17, 2017 at 13:03 UTC
c3a11be4907b28f098ad53630365d38cd655883a
1 file changed
+24
-24
python.d/elasticsearch.chart.py
+24
-24
@@ -26,7 +26,7 @@ ORDER = ['search_perf_total', 'search_perf_time', 'search_latency', 'index_perf_
26
27
CHARTS = {
28
'search_perf_total': {
29
- 'options': [None, 'Number of queries, fetches', 'queries', 'Search performance', 'es.search_query', 'stacked'],
29
+ 'options': [None, 'Number of queries, fetches', 'queries', 'search performance', 'es.search_query', 'stacked'],
30
'lines': [
31
['query_total', 'search_total', 'incremental'],
32
['fetch_total', 'fetch_total', 'incremental'],
@@ -34,20 +34,20 @@ CHARTS = {
34
['fetch_current', 'fetch_current', 'absolute']
35
]},
36
'search_perf_time': {
37
- 'options': [None, 'Time spent on queries, fetches', 'seconds', 'Search performance', 'es.search_time', 'stacked'],
37
+ 'options': [None, 'Time spent on queries, fetches', 'seconds', 'search performance', 'es.search_time', 'stacked'],
38
'lines': [
39
['query_time_in_millis', 'query', 'incremental', 1, 1000],
40
['fetch_time_in_millis', 'fetch', 'incremental', 1, 1000]
41
]},
42
'search_latency': {
43
- 'options': [None, 'Query and fetch latency', 'ms', 'Search performance', 'es.search_latency', 'stacked'],
43
+ 'options': [None, 'Query and fetch latency', 'ms', 'search performance', 'es.search_latency', 'stacked'],
44
'lines': [
45
['query_latency', 'query', 'absolute', 1, 1000],
46
['fetch_latency', 'fetch', 'absolute', 1, 1000]
47
]},
48
'index_perf_total': {
49
'options': [None, 'Number of documents indexed, index refreshes, flushes', 'documents/indexes',
50
- 'Indexing performance', 'es.index_doc', 'stacked'],
50
+ 'indexing performance', 'es.index_doc', 'stacked'],
51
'lines': [
52
['indexing_index_total', 'indexed', 'incremental'],
53
['refresh_total', 'refreshes', 'incremental'],
@@ -55,7 +55,7 @@ CHARTS = {
55
['indexing_index_current', 'indexed_current', 'absolute'],
56
]},
57
'index_perf_time': {
58
- 'options': [None, 'Time spent on indexing, refreshing, flushing', 'seconds', 'Indexing performance',
58
+ 'options': [None, 'Time spent on indexing, refreshing, flushing', 'seconds', 'indexing performance',
59
'es.search_time', 'stacked'],
60
'lines': [
61
['indexing_index_time_in_millis', 'indexing', 'incremental', 1, 1000],
@@ -63,33 +63,33 @@ CHARTS = {
63
['flush_total_time_in_millis', 'flushing', 'incremental', 1, 1000]
64
]},
65
'index_latency': {
66
- 'options': [None, 'Indexing and flushing latency', 'ms', 'Indexing performance',
66
+ 'options': [None, 'Indexing and flushing latency', 'ms', 'indexing performance',
67
'es.index_latency', 'stacked'],
68
'lines': [
69
['indexing_latency', 'indexing', 'absolute', 1, 1000],
70
['flushing_latency', 'flushing', 'absolute', 1, 1000]
71
]},
72
'jvm_mem_heap': {
73
- 'options': [None, 'JVM heap currently in use/committed', 'percent/MB', 'Memory usage and gc',
73
+ 'options': [None, 'JVM heap currently in use/committed', 'percent/MB', 'memory usage and gc',
74
'es.jvm_heap', 'area'],
75
'lines': [
76
['jvm_heap_percent', 'inuse', 'absolute'],
77
['jvm_heap_commit', 'commit', 'absolute', -1, 1048576]
78
]},
79
'jvm_gc_count': {
80
- 'options': [None, 'Count of garbage collections', 'counts', 'Memory usage and gc', 'es.gc_count', 'stacked'],
80
+ 'options': [None, 'Count of garbage collections', 'counts', 'memory usage and gc', 'es.gc_count', 'stacked'],
81
'lines': [
82
['young_collection_count', 'young', 'incremental'],
83
['old_collection_count', 'old', 'incremental']
84
]},
85
'jvm_gc_time': {
86
- 'options': [None, 'Time spent on garbage collections', 'ms', 'Memory usage and gc', 'es.gc_time', 'stacked'],
86
+ 'options': [None, 'Time spent on garbage collections', 'ms', 'memory usage and gc', 'es.gc_time', 'stacked'],
87
'lines': [
88
['young_collection_time_in_millis', 'young', 'incremental'],
89
['old_collection_time_in_millis', 'old', 'incremental']
90
]},
91
'thread_pool_qr': {
92
- 'options': [None, 'Number of queued/rejected threads in thread pool', 'threads', 'Queues and rejections',
92
+ 'options': [None, 'Number of queued/rejected threads in thread pool', 'threads', 'queues and rejections',
93
'es.qr', 'stacked'],
94
'lines': [
95
['bulk_queue', 'bulk_queue', 'absolute'],
@@ -102,19 +102,19 @@ CHARTS = {
102
['merge_rejected', 'merge_rej', 'absolute']
103
]},
104
'fdata_cache': {
105
- 'options': [None, 'Fielddata cache size', 'MB', 'Fielddata cache', 'es.fdata_cache', 'line'],
105
+ 'options': [None, 'Fielddata cache size', 'MB', 'fielddata cache', 'es.fdata_cache', 'line'],
106
'lines': [
107
['index_fdata_mem', 'mem_size', 'absolute', 1, 1048576]
108
]},
109
'fdata_ev_tr': {
110
'options': [None, 'Fielddata evictions and circuit breaker tripped count', 'number of events',
111
- 'Fielddata cache', 'es.fdata_ev_tr', 'line'],
111
+ 'fielddata cache', 'es.fdata_ev_tr', 'line'],
112
'lines': [
113
['index_fdata_evic', 'evictions', 'incremental'],
114
['breakers_fdata_trip', 'tripped', 'incremental']
115
]},
116
'cluster_health_nodes': {
117
- 'options': [None, 'Nodes and tasks statistics', 'units', 'Cluster health API',
117
+ 'options': [None, 'Nodes and tasks statistics', 'units', 'cluster health API',
118
'es.cluster_health', 'stacked'],
119
'lines': [
120
['health_number_of_nodes', 'nodes', 'absolute'],
@@ -123,7 +123,7 @@ CHARTS = {
123
['health_number_of_in_flight_fetch', 'inflight_fetch', 'absolute']
124
]},
125
'cluster_health_status': {
126
- 'options': [None, 'Cluster status', 'status', 'Cluster health API',
126
+ 'options': [None, 'Cluster status', 'status', 'cluster health API',
127
'es.cluster_health_status', 'area'],
128
'lines': [
129
['status_green', 'green', 'absolute'],
@@ -134,7 +134,7 @@ CHARTS = {
134
['status_yellow', 'yellow', 'absolute']
135
]},
136
'cluster_health_shards': {
137
- 'options': [None, 'Shards statistics', 'shards', 'Cluster health API',
137
+ 'options': [None, 'Shards statistics', 'shards', 'cluster health API',
138
'es.cluster_health_sharts', 'stacked'],
139
'lines': [
140
['health_active_shards', 'active_shards', 'absolute'],
@@ -145,7 +145,7 @@ CHARTS = {
145
['health_active_shards_percent_as_number', 'active_percent', 'absolute']
146
]},
147
'cluster_stats_nodes': {
148
- 'options': [None, 'Nodes statistics', 'nodes', 'Cluster stats API',
148
+ 'options': [None, 'Nodes statistics', 'nodes', 'cluster stats API',
149
'es.cluster_stats_nodes', 'stacked'],
150
'lines': [
151
['count_data_only', 'data_only', 'absolute'],
@@ -155,46 +155,46 @@ CHARTS = {
155
['count_client', 'client', 'absolute']
156
]},
157
'cluster_stats_query_cache': {
158
- 'options': [None, 'Query cache statistics', 'queries', 'Cluster stats API',
158
+ 'options': [None, 'Query cache statistics', 'queries', 'cluster stats API',
159
'es.cluster_stats_query_cache', 'stacked'],
160
'lines': [
161
['query_cache_hit_count', 'hit', 'incremental'],
162
['query_cache_miss_count', 'miss', 'incremental']
163
]},
164
'cluster_stats_docs': {
165
- 'options': [None, 'Docs statistics', 'count', 'Cluster stats API',
165
+ 'options': [None, 'Docs statistics', 'count', 'cluster stats API',
166
'es.cluster_stats_docs', 'line'],
167
'lines': [
168
['docs_count', 'docs', 'absolute']
169
]},
170
'cluster_stats_store': {
171
- 'options': [None, 'Store statistics', 'MB', 'Cluster stats API',
171
+ 'options': [None, 'Store statistics', 'MB', 'cluster stats API',
172
'es.cluster_stats_store', 'line'],
173
'lines': [
174
['store_size_in_bytes', 'size', 'absolute', 1, 1048567]
175
]},
176
'cluster_stats_indices_shards': {
177
- 'options': [None, 'Indices and shards statistics', 'count', 'Cluster stats API',
177
+ 'options': [None, 'Indices and shards statistics', 'count', 'cluster stats API',
178
'es.cluster_stats_ind_sha', 'stacked'],
179
'lines': [
180
['indices_count', 'indices', 'absolute'],
181
['shards_total', 'shards', 'absolute']
182
]},
183
'host_metrics_transport': {
184
- 'options': [None, 'Cluster communication transport metrics', 'kbit/s', 'Host metrics',
184
+ 'options': [None, 'Cluster communication transport metrics', 'kbit/s', 'host metrics',
185
'es.host_metrics_transport', 'area'],
186
'lines': [
187
['transport_rx_size_in_bytes', 'in', 'incremental', 8, 1000],
188
['transport_tx_size_in_bytes', 'out', 'incremental', -8, 1000]
189
]},
190
'host_metrics_file_descriptors': {
191
- 'options': [None, 'Available file descriptors in percent', 'percent', 'Host metrics',
191
+ 'options': [None, 'Available file descriptors in percent', 'percent', 'host metrics',
192
'es.host_metrics_descriptors', 'area'],
193
'lines': [
194
['file_descriptors_used', 'used', 'absolute', 1, 10]
195
]},
196
'host_metrics_http': {
197
- 'options': [None, 'Opened HTTP connections', 'connections', 'Host metrics',
197
+ 'options': [None, 'Opened HTTP connections', 'connections', 'host metrics',
198
'es.host_metrics_http', 'line'],
199
'lines': [
200
['http_current_open', 'opened', 'absolute', 1, 1]
@@ -399,4 +399,4 @@ class Service(UrlService):
399
400
401
def update_key(string, dictionary):
402
- return {'_'.join([string, k]): v for k, v in dictionary.items()}
402
+ return dict([('_'.join([string, elem[0]]), elem[1]) for elem in dictionary.items()])