File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ collection_group {
1414 value_threshold = 0.0
1515 }
1616
17+ metric {
18+ name = "procs_created"
19+ title = "Processes/Threads created"
20+ value_threshold = 0.0
21+ }
22+
1723 metric {
1824 name_match = "softirq_(.+)"
1925 value_threshold = 1.0
@@ -25,4 +31,5 @@ collection_group {
2531 }
2632
2733
34+
2835}
Original file line number Diff line number Diff line change 2626LAST_METRICS = dict (METRICS )
2727METRICS_CACHE_MAX = 5
2828
29+
30+
2931stat_file = "/proc/stat"
3032
3133###############################################################################
@@ -87,6 +89,9 @@ def get_delta(name):
8789
8890 name = name .replace (NAME_PREFIX ,"" ) # remove prefix from name
8991
92+ if name == "procs_created" :
93+ name = "processes"
94+
9095 try :
9196 delta = (float (curr_metrics ['data' ][name ][0 ]) - float (last_metrics ['data' ][name ][0 ])) / (curr_metrics ['time' ] - last_metrics ['time' ])
9297 if delta < 0 :
@@ -154,6 +159,12 @@ def metric_init(params):
154159 "description" : "Context Switches" ,
155160 }))
156161
162+ descriptors .append (create_desc (Desc_Skel , {
163+ "name" : "procs_created" ,
164+ "units" : "proc/sec" ,
165+ "description" : "Number of processes and threads created" ,
166+ }))
167+
157168 descriptors .append (create_desc (Desc_Skel , {
158169 "name" : "cpu_intr" ,
159170 "units" : "intr/sec" ,
You can’t perform that action at this time.
0 commit comments