]> arthur.barton.de Git - netdata.git/commitdiff
added more charts for bind
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 2 Feb 2016 22:03:36 +0000 (00:03 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 2 Feb 2016 22:03:36 +0000 (00:03 +0200)
node.d/named.node.js
node.d/node_modules/netdata.js

index 8b30352c7d5a4924e88db15893ef7ce958539c26..154fe20aa9ab11b0b59c4f583c6ce62e569b09a2 100755 (executable)
@@ -3,6 +3,7 @@
 // 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
@@ -305,6 +306,9 @@ var named = {
                        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
@@ -399,10 +403,71 @@ var named = {
                                                                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
index f371f55d47fa35e4c6d5396656fee7f90d647e18..52d3b2bcc7e9bdbb105300fb65a43246bd320c22 100755 (executable)
@@ -164,6 +164,9 @@ var netdata = {
                                        return false;\r
                                }\r
 \r
+                               if(typeof value === 'undefined' || value === null)\r
+                                       return false;\r
+\r
                                if(this._current_chart._dimensions_count !== 0)\r
                                        this.queue('SET ' + dimension + ' = ' + value);\r
 \r