// collect statistics from bind (named) v9.10+\r
//\r
// bind statistics documentation at:\r
+// http://jpmens.net/2013/03/18/json-in-bind-9-s-statistics-server/\r
// https://ftp.isc.org/isc/bind/9.10.3/doc/arm/Bv9ARM.ch06.html#statistics\r
\r
// example configuration in /etc/netdata/named.conf\r
if(typeof r.qtypes !== 'undefined')\r
service.module.chartFromMembers(service, r.qtypes, 'in_qtypes', 'Bind, Global Incoming Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 2000, netdata.chartAlgorithms.incremental, 1, 1);\r
\r
+ if(typeof r.sockstats !== 'undefined')\r
+ service.module.chartFromMembers(service, r.sockstats, 'in_sockstats', 'Bind, Global Socket Statistics', 'operations/s', 'named', 'named', netdata.chartTypes.line, 2500, netdata.chartAlgorithms.incremental, 1, 1);\r
+\r
if(typeof r.views !== 'undefined') {\r
for( var x in r.views ) {\r
var resolver = r.views[x].resolver;\r
service.end();\r
}\r
}\r
- \r
- if(typeof resolver.qtypes !== 'undefined')\r
- service.module.chartFromMembers(service, resolver.qtypes, 'view_resolver_qtypes_' + x, 'Bind, ' + x + ' View, Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 6000, netdata.chartAlgorithms.incremental, 1, 1);\r
}\r
+\r
+ if(typeof resolver.qtypes !== 'undefined')\r
+ service.module.chartFromMembers(service, resolver.qtypes, 'view_resolver_qtypes_' + x, 'Bind, ' + x + ' View, Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 6000, netdata.chartAlgorithms.incremental, 1, 1);\r
+\r
+ //if(typeof resolver.cache !== 'undefined')\r
+ // service.module.chartFromMembers(service, resolver.cache, 'view_resolver_cache_' + x, 'Bind, ' + x + ' View, Cache Entries', 'entries', 'named', 'named', netdata.chartTypes.stacked, 7000, netdata.chartAlgorithms.absolute, 1, 1);\r
+\r
+ if(typeof resolver.cachestats['CacheHits'] !== 'undefined' && resolver.cachestats['CacheHits'] > 0) {\r
+ var id = 'named_' + service.name + '.view_resolver_cachehits_' + x;\r
+ var chart = named.charts[id];\r
+\r
+ if(typeof chart === 'undefined') {\r
+ chart = {\r
+ id: id, // the unique id of the chart\r
+ name: '', // the unique name of the chart\r
+ title: service.name + ' Bind, ' + x + ' View, Resolver Cache Hits', // the title of the chart\r
+ units: 'operations/s', // the units of the chart dimensions\r
+ family: 'named', // the family of the chart\r
+ category: 'named', // the category of the chart\r
+ type: netdata.chartTypes.area, // the type of the chart\r
+ priority: 8000, // the priority relative to others in the same family and category\r
+ update_every: Math.round(service.update_every / 1000), // the expected update frequency of the chart\r
+ dimensions: {\r
+ 'CacheHits': {\r
+ id: 'CacheHits', // the unique id of the dimension\r
+ name: 'hits', // the name of the dimension\r
+ algorithm: netdata.chartAlgorithms.incremental,// the id of the netdata algorithm\r
+ multiplier: 1, // the multiplier\r
+ divisor: 1, // the divisor\r
+ hidden: false // is hidden (boolean)\r
+ },\r
+ 'CacheMisses': {\r
+ id: 'CacheMisses', // the unique id of the dimension\r
+ name: 'misses', // the name of the dimension\r
+ algorithm: netdata.chartAlgorithms.incremental,// the id of the netdata algorithm\r
+ multiplier: -1, // the multiplier\r
+ divisor: 1, // the divisor\r
+ hidden: false // is hidden (boolean)\r
+ }\r
+ }\r
+ };\r
+\r
+ chart = service.chart(id, chart);\r
+ named.charts[id] = chart;\r
+ }\r
+\r
+ service.begin(chart);\r
+ service.set('CacheHits', resolver.cachestats['CacheHits']);\r
+ service.set('CacheMisses', resolver.cachestats['CacheMisses']);\r
+ service.end();\r
+ }\r
+\r
+ // this is wrong, it contains many types of info:\r
+ // 1. CacheHits, CacheMisses - incremental (added above)\r
+ // 2. QueryHits, QueryMisses - incremental\r
+ // 3. DeleteLRU, DeleteTTL - incremental\r
+ // 4. CacheNodes, CacheBuckets - absolute\r
+ // 5. TreeMemTotal, TreeMemInUse - absolute\r
+ // 6. HeapMemMax, HeapMemTotal, HeapMemInUse - absolute\r
+ //if(typeof resolver.cachestats !== 'undefined')\r
+ // service.module.chartFromMembers(service, resolver.cachestats, 'view_resolver_cachestats_' + x, 'Bind, ' + x + ' View, Cache Statistics', 'requests/s', 'named', 'named', netdata.chartTypes.line, 8000, netdata.chartAlgorithms.incremental, 1, 1);\r
+\r
+ //if(typeof resolver.adb !== 'undefined')\r
+ // service.module.chartFromMembers(service, resolver.adb, 'view_resolver_adb_' + x, 'Bind, ' + x + ' View, ADB Statistics', 'entries', 'named', 'named', netdata.chartTypes.line, 8500, netdata.chartAlgorithms.absolute, 1, 1);\r
}\r
}\r
}\r