Module: check_mk
Branch: master
Commit: 3a3309c5c6a636717e43046d592865bd85b00aec
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a3309c5c6a636…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Jan 25 11:42:08 2017 +0100
jolokia_metrics: Remove useless lambda constructions
Change-Id: I587c9afca43dfe560247ecd969e7c58412e180f0
---
checks/jolokia_metrics | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/checks/jolokia_metrics b/checks/jolokia_metrics
index 494518b..55530ed 100644
--- a/checks/jolokia_metrics
+++ b/checks/jolokia_metrics
@@ -241,13 +241,12 @@ def inventory_jolokia_metrics_apps(info, what):
return inv
-def inventory_jolokia_metrics_serv(info, what):
+def inventory_jolokia_metrics_serv(info):
inv = []
parsed = jolokia_metrics_parse(info)
levels = None
- if what == 'serv_req':
- levels = 'jolokia_metrics_serv_req_default_levels'
- needed_key = "Requests"
+ levels = 'jolokia_metrics_serv_req_default_levels'
+ needed_key = "Requests"
for inst, vals in parsed.iteritems():
if vals == None:
continue # no data from agent
@@ -257,12 +256,10 @@ def inventory_jolokia_metrics_serv(info, what):
inv.append(('%s %s %s' % (inst, app, serv), levels))
return inv
-def inventory_jolokia_metrics_gc(info, what):
+def inventory_jolokia_metrics_gc(info):
inv = []
parsed = jolokia_metrics_parse(info)
levels = None
- if what == 'gc':
- needed_key = ["CollectionCount", "CollectionTime"]
for inst, vals in parsed.iteritems():
if vals == None:
continue # no data from agent
@@ -270,12 +267,10 @@ def inventory_jolokia_metrics_gc(info, what):
inv.append(("%s GC %s" % (inst ,gc) , levels))
return inv
-def inventory_jolokia_metrics_tp(info, what):
+def inventory_jolokia_metrics_tp(info):
inv = []
parsed = jolokia_metrics_parse(info)
levels = 'jolokia_metrics_tp_default_levels'
- if what == 'tp':
- needed_key = ["currentThreadsBusy", "currentThreadCount",
"maxThreads"]
for inst, vals in parsed.iteritems():
if vals == None:
continue # no data from agent
@@ -735,7 +730,7 @@ check_info["jolokia_metrics.uptime"] = {
check_info["jolokia_metrics.gc"] = {
"service_description" : "JVM %s",
"check_function" : check_jolokia_metrics_gc,
- "inventory_function" : lambda i: inventory_jolokia_metrics_gc(i,
"gc"),
+ "inventory_function" : inventory_jolokia_metrics_gc,
"group" : "jvm_gc",
"has_perfdata" : True,
}
@@ -743,7 +738,7 @@ check_info["jolokia_metrics.gc"] = {
check_info["jolokia_metrics.tp"] = {
"service_description" : "JVM %s",
"check_function" : check_jolokia_metrics_tp,
- "inventory_function" : lambda i: inventory_jolokia_metrics_tp(i,
"tp"),
+ "inventory_function" : inventory_jolokia_metrics_tp,
"group" : "jvm_tp",
"has_perfdata" : True,
}
@@ -777,7 +772,7 @@ check_info["jolokia_metrics.requests"] = {
check_info["jolokia_metrics.serv_req"] = {
"service_description" : "JVM %s Requests",
"check_function" : check_jolokia_metrics_serv_req,
- "inventory_function" : lambda i: inventory_jolokia_metrics_serv(i,
"serv_req"),
+ "inventory_function" : inventory_jolokia_metrics_serv,
"group" : "jvm_requests",
"has_perfdata" : True,
}