mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Fix indexcounters and globallock in 2.2 and 2.4 version
This commit is contained in:
parent
3c08471566
commit
271a38f0ba
2 changed files with 11 additions and 2 deletions
|
@ -16,7 +16,11 @@ def getServerStatus():
|
||||||
return json.loads( raw )["serverStatus"]
|
return json.loads( raw )["serverStatus"]
|
||||||
|
|
||||||
def get():
|
def get():
|
||||||
return getServerStatus()["indexCounters"]["btree"]
|
status = getServerStatus()
|
||||||
|
if status["version"] >= "2.4.0":
|
||||||
|
return getServerStatus()["indexCounters"]
|
||||||
|
else:
|
||||||
|
return getServerStatus()["indexCounters"]["btree"]
|
||||||
|
|
||||||
def doData():
|
def doData():
|
||||||
for k,v in get().iteritems():
|
for k,v in get().iteritems():
|
||||||
|
|
|
@ -18,7 +18,12 @@ def getServerStatus():
|
||||||
name = "locked"
|
name = "locked"
|
||||||
|
|
||||||
def doData():
|
def doData():
|
||||||
print name + ".value " + str( 100 * getServerStatus()["globalLock"]["ratio"] )
|
status = getServerStatus()
|
||||||
|
if status["version"] >= "2.2.0":
|
||||||
|
ratio = status["globalLock"]["lockTime"] / status["globalLock"]["totalTime"]
|
||||||
|
else:
|
||||||
|
ratio = status["globalLock"]["ratio"]
|
||||||
|
print name + ".value " + str( 100 * ratio )
|
||||||
|
|
||||||
def doConfig():
|
def doConfig():
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue