@cryptotaxi247 / netdata-1 / commits / 8e05c4c3d

fix charts types

paulfantom committed Jul 13, 2016 at 17:37 UTC 8e05c4c3ddad1c7ca7ad4cde05ccbe5caaab5ff6
2 files changed +64 -59
python.d/mysql.chart.py
+63 -58
@@ -67,74 +67,74 @@ CHARTS = {
67 'queries': {
68 'options': [None, 'mysql Queries', 'queries/s', 'queries', 'mysql.queries', 'line'],
69 'lines': [
70 - ["Queries", "queries"],
71 - ["Questions", "questions"],
72 - ["Slow_queries", "slow_queries"]
70 + ["Queries", "queries", "incremental"],
71 + ["Questions", "questions", "incremental"],
72 + ["Slow_queries", "slow_queries", "incremental"]
73 ]},
74 'handlers': {
75 'options': [None, 'mysql Handlers', 'handlers/s', 'handlers', 'mysql.handlers', 'line'],
76 'lines': [
77 - ["Handler_commit", "commit"],
78 - ["Handler_delete", "delete"],
79 - ["Handler_prepare", "prepare"],
80 - ["Handler_read_first", "read_first"],
81 - ["Handler_read_key", "read_key"],
82 - ["Handler_read_next", "read_next"],
83 - ["Handler_read_prev", "read_prev"],
84 - ["Handler_read_rnd", "read_rnd"],
85 - ["Handler_read_rnd_next", "read_rnd_next"],
86 - ["Handler_rollback", "rollback"],
87 - ["Handler_savepoint", "savepoint"],
88 - ["Handler_savepoint_rollback", "savepoint_rollback"],
89 - ["Handler_update", "update"],
90 - ["Handler_write", "write"]
77 + ["Handler_commit", "commit", "incremental"],
78 + ["Handler_delete", "delete", "incremental"],
79 + ["Handler_prepare", "prepare", "incremental"],
80 + ["Handler_read_first", "read_first", "incremental"],
81 + ["Handler_read_key", "read_key", "incremental"],
82 + ["Handler_read_next", "read_next", "incremental"],
83 + ["Handler_read_prev", "read_prev", "incremental"],
84 + ["Handler_read_rnd", "read_rnd", "incremental"],
85 + ["Handler_read_rnd_next", "read_rnd_next", "incremental"],
86 + ["Handler_rollback", "rollback", "incremental"],
87 + ["Handler_savepoint", "savepoint", "incremental"],
88 + ["Handler_savepoint_rollback", "savepoint_rollback", "incremental"],
89 + ["Handler_update", "update", "incremental"],
90 + ["Handler_write", "write", "incremental"]
91 ]},
92 'table_locks': {
93 'options': [None, 'mysql Tables Locks', 'locks/s', 'locks', 'mysql.table_locks', 'line'],
94 'lines': [
95 - ["Table_locks_immediate", "immediate"],
95 + ["Table_locks_immediate", "immediate", "incremental"],
96 ["Table_locks_waited", "waited", "incremental", -1, 1]
97 ]},
98 'join_issues': {
99 'options': [None, 'mysql Select Join Issues', 'joins/s', 'issues', 'mysql.join_issues', 'line'],
100 'lines': [
101 - ["Select_full_join", "full_join"],
102 - ["Select_full_range_join", "full_range_join"],
103 - ["Select_range", "range"],
104 - ["Select_range_check", "range_check"],
105 - ["Select_scan", "scan"]
101 + ["Select_full_join", "full_join", "incremental"],
102 + ["Select_full_range_join", "full_range_join", "incremental"],
103 + ["Select_range", "range", "incremental"],
104 + ["Select_range_check", "range_check", "incremental"],
105 + ["Select_scan", "scan", "incremental"]
106 ]},
107 'sort_issues': {
108 'options': [None, 'mysql Sort Issues', 'issues/s', 'issues', 'mysql.sort.issues', 'line'],
109 'lines': [
110 - ["Sort_merge_passes", "merge_passes"],
111 - ["Sort_range", "range"],
112 - ["Sort_scan", "scan"]
110 + ["Sort_merge_passes", "merge_passes", "incremental"],
111 + ["Sort_range", "range", "incremental"],
112 + ["Sort_scan", "scan", "incremental"]
113 ]},
114 'tmp': {
115 'options': [None, 'mysql Tmp Operations', 'counter', 'temporaries', 'mysql.tmp', 'line'],
116 'lines': [
117 - ["Created_tmp_disk_tables", "disk_tables"],
118 - ["Created_tmp_files", "files"],
119 - ["Created_tmp_tables", "tables"]
117 + ["Created_tmp_disk_tables", "disk_tables", "incremental"],
118 + ["Created_tmp_files", "files", "incremental"],
119 + ["Created_tmp_tables", "tables", "incremental"]
120 ]},
121 'connections': {
122 'options': [None, 'mysql Connections', 'connections/s', 'connections', 'mysql.connections', 'line'],
123 'lines': [
124 - ["Connections", "all"],
125 - ["Aborted_connects", "aborted"]
124 + ["Connections", "all", "incremental"],
125 + ["Aborted_connects", "aborted", "incremental"]
126 ]},
127 'binlog_cache': {
128 'options': [None, 'mysql Binlog Cache', 'transactions/s', 'binlog', 'mysql.binlog_cache', 'line'],
129 'lines': [
130 - ["Binlog_cache_disk_use", "disk"],
131 - ["Binlog_cache_use", "all"]
130 + ["Binlog_cache_disk_use", "disk", "incremental"],
131 + ["Binlog_cache_use", "all", "incremental"]
132 ]},
133 'threads': {
134 'options': [None, 'mysql Threads', 'threads', 'threads', 'mysql.threads', 'line'],
135 'lines': [
136 ["Threads_connected", "connected", "absolute"],
137 - ["Threads_created", "created"],
137 + ["Threads_created", "created", "incremental"],
138 ["Threads_cached", "cached", "absolute", -1, 1],
139 ["Threads_running", "running", "absolute"],
140 ]},
@@ -152,28 +152,28 @@ CHARTS = {
152 'innodb_io_ops': {
153 'options': [None, 'mysql InnoDB I/O Operations', 'operations/s', 'innodb', 'mysql.innodb_io_ops', 'line'],
154 'lines': [
155 - ["Innodb_data_reads", "reads"],
155 + ["Innodb_data_reads", "reads", "incremental"],
156 ["Innodb_data_writes", "writes", "incremental", -1, 1],
157 - ["Innodb_data_fsyncs", "fsyncs"]
157 + ["Innodb_data_fsyncs", "fsyncs", "incremental"]
158 ]},
159 'innodb_io_pending_ops': {
160 'options': [None, 'mysql InnoDB Pending I/O Operations', 'operations', 'innodb', 'mysql.innodb_io_pending_ops', 'line'],
161 'lines': [
162 ["Innodb_data_pending_reads", "reads", "absolute"],
163 ["Innodb_data_pending_writes", "writes", "absolute", -1, 1],
164 - ["Innodb_data_pending_fsyncs", "fsyncs"]
164 + ["Innodb_data_pending_fsyncs", "fsyncs", "absolute"]
165 ]},
166 'innodb_log': {
167 'options': [None, 'mysql InnoDB Log Operations', 'operations/s', 'innodb', 'mysql.innodb_log', 'line'],
168 'lines': [
169 - ["Innodb_log_waits", "waits"],
169 + ["Innodb_log_waits", "waits", "incremental"],
170 ["Innodb_log_write_requests", "write_requests", "incremental", -1, 1],
171 ["Innodb_log_writes", "incremental", -1, 1],
172 ]},
173 'innodb_os_log': {
174 'options': [None, 'mysql InnoDB OS Log Operations', 'operations', 'innodb', 'mysql.innodb_os_log', 'line'],
175 'lines': [
176 - ["Innodb_os_log_fsyncs", "fsyncs"],
176 + ["Innodb_os_log_fsyncs", "fsyncs", "incremental"],
177 ["Innodb_os_log_pending_fsyncs", "pending_fsyncs", "absolute"],
178 ["Innodb_os_log_pending_writes", "pending_writes", "absolute", -1, 1],
179 ]},
@@ -190,7 +190,7 @@ CHARTS = {
190 'innodb_rows': {
191 'options': [None, 'mysql InnoDB Row Operations', 'operations/s', 'innodb', 'mysql.innodb_rows', 'area'],
192 'lines': [
193 - ["Innodb_rows_inserted", "read"],
193 + ["Innodb_rows_inserted", "read", "incremental"],
194 ["Innodb_rows_read", "deleted", "incremental", -1, 1],
195 ["Innodb_rows_updated", "inserted", "incremental", 1, 1],
196 ["Innodb_rows_deleted", "updated", "incremental", -1, 1],
@@ -214,28 +214,28 @@ CHARTS = {
214 'innodb_buffer_pool_read_ahead': {
215 'options': [None, 'mysql InnoDB Buffer Pool Read Ahead', 'operations/s', 'innodb', 'mysql.innodb_buffer_pool_read_ahead', 'area'],
216 'lines': [
217 - ["Innodb_buffer_pool_read_ahead", "all"],
217 + ["Innodb_buffer_pool_read_ahead", "all", "incremental"],
218 ["Innodb_buffer_pool_read_ahead_evicted", "evicted", "incremental", -1, 1],
219 - ["Innodb_buffer_pool_read_ahead_rnd", "random"]
219 + ["Innodb_buffer_pool_read_ahead_rnd", "random", "incremental"]
220 ]},
221 'innodb_buffer_pool_reqs': {
222 'options': [None, 'mysql InnoDB Buffer Pool Requests', 'requests/s', 'innodb', 'mysql.innodb_buffer_pool_reqs', 'area'],
223 'lines': [
224 - ["Innodb_buffer_pool_read_requests", "reads"],
224 + ["Innodb_buffer_pool_read_requests", "reads", "incremental"],
225 ["Innodb_buffer_pool_write_requests", "writes", "incremental", -1, 1]
226 ]},
227 'innodb_buffer_pool_ops': {
228 'options': [None, 'mysql InnoDB Buffer Pool Operations', 'operations/s', 'innodb', 'mysql.innodb_buffer_pool_ops', 'area'],
229 'lines': [
230 - ["Innodb_buffer_pool_reads", "disk reads"],
230 + ["Innodb_buffer_pool_reads", "disk reads", "incremental"],
231 ["Innodb_buffer_pool_wait_free", "wait free", "incremental", -1, 1]
232 ]},
233 'qcache_ops': {
234 'options': [None, 'mysql QCache Operations', 'queries/s', 'qcache', 'mysql.qcache_ops', 'line'],
235 'lines': [
236 - ["Qcache_hits", "hits"],
236 + ["Qcache_hits", "hits", "incremental"],
237 ["Qcache_lowmem_prunes", "lowmem prunes", "incremental", -1, 1],
238 - ["Qcache_inserts", "inserts"],
238 + ["Qcache_inserts", "inserts", "incremental"],
239 ["Qcache_not_cached", "not cached", "incremental", -1, 1]
240 ]},
241 'qcache': {
@@ -264,13 +264,13 @@ CHARTS = {
264 'key_requests': {
265 'options': [None, 'mysql MyISAM Key Cache Requests', 'requests/s', 'myisam', 'mysql.key_requests', 'area'],
266 'lines': [
267 - ["Key_read_requests", "reads"],
267 + ["Key_read_requests", "reads", "incremental"],
268 ["Key_write_requests", "writes", "incremental", -1, 1]
269 ]},
270 'key_disk_ops': {
271 'options': [None, 'mysql MyISAM Key Cache Disk Operations', 'operations/s', 'myisam', 'mysql.key_disk_ops', 'area'],
272 'lines': [
273 - ["Key_reads", "reads"],
273 + ["Key_reads", "reads", "incremental"],
274 ["Key_writes", "writes", "incremental", -1, 1]
275 ]},
276 'files': {
@@ -281,23 +281,23 @@ CHARTS = {
281 'files_rate': {
282 'options': [None, 'mysql Opened Files Rate', 'files/s', 'files', 'mysql.files_rate', 'line'],
283 'lines': [
284 - ["Opened_files", "files"]
284 + ["Opened_files", "files", "incremental"]
285 ]},
286 'binlog_stmt_cache': {
287 'options': [None, 'mysql Binlog Statement Cache', 'statements/s', 'binlog', 'mysql.binlog_stmt_cache', 'line'],
288 'lines': [
289 - ["Binlog_stmt_cache_disk_use", "disk"],
290 - ["Binlog_stmt_cache_use", "all"]
289 + ["Binlog_stmt_cache_disk_use", "disk", "incremental"],
290 + ["Binlog_stmt_cache_use", "all", "incremental"]
291 ]},
292 'connection_errors': {
293 'options': [None, 'mysql Connection Errors', 'connections/s', 'connections', 'mysql.connection_errors', 'line'],
294 'lines': [
295 - ["Connection_errors_accept", "accept"],
296 - ["Connection_errors_internal", "internal"],
297 - ["Connection_errors_max_connections", "max"],
298 - ["Connection_errors_peer_address", "peer_addr"],
299 - ["Connection_errors_select", "select"],
300 - ["Connection_errors_tcpwrap", "tcpwrap"]
295 + ["Connection_errors_accept", "accept", "incremental"],
296 + ["Connection_errors_internal", "internal", "incremental"],
297 + ["Connection_errors_max_connections", "max", "incremental"],
298 + ["Connection_errors_peer_address", "peer_addr", "incremental"],
299 + ["Connection_errors_select", "select", "incremental"],
300 + ["Connection_errors_tcpwrap", "tcpwrap", "incremental"]
301 ]}
302
303 }
@@ -374,8 +374,13 @@ class Service(SimpleService):
374 self.connection.close()
375 self.connection = None
376 return None
377 + data = dict(raw_data)
378 + try:
379 + data["Thread_cache_misses"] = int(data["Threads_created"] * 10000 / float(data["Connections"]))
380 + except:
381 + data["Thread_cache_misses"] = 0
382
378 - return dict(raw_data)
383 + return data
384
385 def check(self):
386 """
python.d/squid.chart.py
+1 -1
@@ -36,7 +36,7 @@ CHARTS = {
36 'servers_requests': {
37 'options': [None, "Squid Server Requests", "requests/s", "servers", "squid.servers.requests", 'line'],
38 'lines': [
39 - ["server_all_requests", "requests"],
39 + ["server_all_requests", "requests", "incremental"],
40 ["server_all_errors", "errors", "incremental", -1, 1]
41 ]}
42 }