File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ data_format | xml_v2 | Bind stats version:<br>
37
37
- xml_v3 (New xml version)<br >
38
38
- json_v1 (JSON replacement for XML)<br >
39
39
| str
40
+ derivative | True | Report derived stats or raw (always incrementing | bool
40
41
41
42
#### Example Output
42
43
Original file line number Diff line number Diff line change 13
13
import diamond .collector
14
14
import sys
15
15
import urllib2
16
+ from diamond .collector import str_to_bool
16
17
17
18
if sys .version_info >= (2 , 5 ):
18
19
import xml .etree .cElementTree as ElementTree
@@ -39,6 +40,7 @@ def get_default_config_help(self):
39
40
" - xml_v2 (Original bind stats version from 9.5)\n " +
40
41
" - xml_v3 (New xml version)\n " +
41
42
" - json_v1 (JSON replacement for XML)\n " ,
43
+ 'derivative' : "" ,
42
44
})
43
45
return config_help
44
46
@@ -68,13 +70,15 @@ def get_default_config(self):
68
70
'publish_view_bind' : False ,
69
71
'publish_view_meta' : False ,
70
72
'data_format' : 'xml_v2' ,
73
+ 'derivative' : True ,
71
74
})
72
75
return config
73
76
74
77
def clean_counter (self , name , value ):
75
- value = self .derivative (name , value )
76
- if value < 0 :
77
- value = 0
78
+ if str_to_bool (self .config ['derivative' ]):
79
+ value = self .derivative (name , value )
80
+ if value < 0 :
81
+ value = 0
78
82
self .publish (name , value )
79
83
80
84
def collect (self ):
You can’t perform that action at this time.
0 commit comments