Skip to content

Commit

Permalink
coerce lockTime to float type
Browse files Browse the repository at this point in the history
otherwise we'll always get 0 from integer division.
  • Loading branch information
ShiningRay committed Apr 30, 2014
1 parent d2847dc commit 96116a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/mongodb/mongo_lock
Expand Up @@ -20,7 +20,7 @@ name = "locked"
def doData():
status = getServerStatus()
if status["version"] >= "2.2.0":
ratio = status["globalLock"]["lockTime"] / status["globalLock"]["totalTime"]
ratio = float(status["globalLock"]["lockTime"]) / status["globalLock"]["totalTime"]
else:
ratio = status["globalLock"]["ratio"]
print name + ".value " + str( 100 * ratio )
Expand Down

0 comments on commit 96116a4

Please sign in to comment.