@cryptotaxi247 / netdata-1 / commits / 448131318

"go_expvar" module update

lgz committed Oct 14, 2017 at 22:30 UTC 4481313188dba2ca45e48b90a6b603baffc201c1
1 file changed +20 -11
python.d/go_expvar.chart.py
+20 -11
@@ -3,9 +3,10 @@
3 # Author: Jan Kral (kralewitz)
4
5 from __future__ import division
6 -from base import UrlService
6 import json
7
8 +from bases.FrameworkServices.UrlService import UrlService
9 +
10 # default module values (can be overridden per job in `config`)
11 # update_every = 2
12 priority = 60000
@@ -14,44 +15,52 @@ retries = 60
15
16 MEMSTATS_CHARTS = {
17 'memstats_heap': {
17 - 'options': ['heap', 'memory: size of heap memory structures', 'kB', 'memstats', 'expvar.memstats.heap', 'line'],
18 + 'options': ['heap', 'memory: size of heap memory structures', 'kB', 'memstats',
19 + 'expvar.memstats.heap', 'line'],
20 'lines': [
21 ['memstats_heap_alloc', 'alloc', 'absolute', 1, 1024],
22 ['memstats_heap_inuse', 'inuse', 'absolute', 1, 1024]
23 ]},
24 'memstats_stack': {
23 - 'options': ['stack', 'memory: size of stack memory structures', 'kB', 'memstats', 'expvar.memstats.stack', 'line'],
25 + 'options': ['stack', 'memory: size of stack memory structures', 'kB', 'memstats',
26 + 'expvar.memstats.stack', 'line'],
27 'lines': [
28 ['memstats_stack_inuse', 'inuse', 'absolute', 1, 1024]
29 ]},
30 'memstats_mspan': {
28 - 'options': ['mspan', 'memory: size of mspan memory structures', 'kB', 'memstats', 'expvar.memstats.mspan', 'line'],
31 + 'options': ['mspan', 'memory: size of mspan memory structures', 'kB', 'memstats',
32 + 'expvar.memstats.mspan', 'line'],
33 'lines': [
34 ['memstats_mspan_inuse', 'inuse', 'absolute', 1, 1024]
35 ]},
36 'memstats_mcache': {
33 - 'options': ['mcache', 'memory: size of mcache memory structures', 'kB', 'memstats', 'expvar.memstats.mcache', 'line'],
37 + 'options': ['mcache', 'memory: size of mcache memory structures', 'kB', 'memstats',
38 + 'expvar.memstats.mcache', 'line'],
39 'lines': [
40 ['memstats_mcache_inuse', 'inuse', 'absolute', 1, 1024]
41 ]},
42 'memstats_live_objects': {
38 - 'options': ['live_objects', 'memory: number of live objects', 'objects', 'memstats', 'expvar.memstats.live_objects', 'line'],
43 + 'options': ['live_objects', 'memory: number of live objects', 'objects', 'memstats',
44 + 'expvar.memstats.live_objects', 'line'],
45 'lines': [
46 ['memstats_live_objects', 'live']
47 ]},
48 'memstats_sys': {
43 - 'options': ['sys', 'memory: size of reserved virtual address space', 'kB', 'memstats', 'expvar.memstats.sys', 'line'],
49 + 'options': ['sys', 'memory: size of reserved virtual address space', 'kB', 'memstats',
50 + 'expvar.memstats.sys', 'line'],
51 'lines': [
52 ['memstats_sys', 'sys', 'absolute', 1, 1024]
53 ]},
54 'memstats_gc_pauses': {
48 - 'options': ['gc_pauses', 'memory: average duration of GC pauses', 'ns', 'memstats', 'expvar.memstats.gc_pauses', 'line'],
55 + 'options': ['gc_pauses', 'memory: average duration of GC pauses', 'ns', 'memstats',
56 + 'expvar.memstats.gc_pauses', 'line'],
57 'lines': [
58 ['memstats_gc_pauses', 'avg']
59 ]},
60 }
61
54 -MEMSTATS_ORDER = ['memstats_heap', 'memstats_stack', 'memstats_mspan', 'memstats_mcache', 'memstats_sys', 'memstats_live_objects', 'memstats_gc_pauses']
62 +MEMSTATS_ORDER = ['memstats_heap', 'memstats_stack', 'memstats_mspan', 'memstats_mcache',
63 + 'memstats_sys', 'memstats_live_objects', 'memstats_gc_pauses']
64
65
66 def flatten(d, top='', sep='.'):
@@ -71,8 +80,8 @@ class Service(UrlService):
80
81 # if memstats collection is enabled, add the charts and their order
82 if self.configuration.get('collect_memstats'):
74 - self.definitions = MEMSTATS_CHARTS
75 - self.order = MEMSTATS_ORDER
83 + self.definitions = dict(MEMSTATS_CHARTS)
84 + self.order = list(MEMSTATS_ORDER)
85 else:
86 self.definitions = dict()
87 self.order = list()