[SERVER-8116] mongostat calculates locked db incorrectly, it doesn't divide by the sampling time Created: 09/Jan/13  Updated: 11/Jul/16  Resolved: 19/Jan/13

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.2.2
Fix Version/s: 2.2.4, 2.4.0-rc0

Type: Bug Priority: Major - P3
Reporter: Balazs Szabo Assignee: Daniel Pasette (Inactive)
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-7530 It looks like mongostat calculate loc... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

It seems that when mongostat is calculating the "locked db" field then it does not take into account the sampling time. I have a small sample database and when using the same test script, mongostat displays greater and greater values if I increase the sampling time:

[baxi@chivas]$ ./mongostat.exe -h 192.168.25.246 15
connected to: 192.168.25.246
... locked db idx miss % qr|qw ar|aw netIn netOut conn time
... .:2.1% 0 0|0 0|0 1k 1k 1 14:34:02
... .:3.9% 0 0|0 0|0 1k 1k 1 14:34:17
[baxi@chivas]$ ./mongostat.exe -h 192.168.25.246 60
connected to: 192.168.25.246
locked db idx miss % qr|qw ar|aw netIn netOut conn time
... .:6.6% 0 0|0 0|0 1k 809b 1 14:42:26
... .:10.1% 0 0|0 0|0 1k 860b 1 14:43:26
[baxi@chivas]$ ./mongostat.exe -h 192.168.25.246 300
connected to: 192.168.25.246
locked db idx miss % qr|qw ar|aw netIn netOut conn time
... .:39.4% 0 0|0 0|0 1k 811b 1 14:48:33
... .:39.2% 0 0|0 0|0 1k 838b 1 14:53:33

I calculated these values manually using the mongo shell and db.serverStatus() and got approximatelly the same result if using the expression diff(locks...timeLockedMicros.W)/1000/1000*100, but it should be
(diff(locks...timeLockedMicros.W)/1000/1000)/diff(uptimeMillis/1000)*100, or something like that



 Comments   
Comment by auto [ 20/Mar/13 ]

Author:

{u'date': u'2013-01-12T20:20:25Z', u'name': u'Dan Pasette', u'email': u'dan@10gen.com'}

Message: SERVER-8116 - mongostat doesn't divide lock% by sampling interval
Branch: v2.2
https://github.com/mongodb/mongo/commit/b0f59346069b9b007c1d7d4863b661d0bb06615b

Comment by auto [ 19/Jan/13 ]

Author:

{u'date': u'2013-01-12T20:20:25Z', u'email': u'dan@10gen.com', u'name': u'Dan Pasette'}

Message: SERVER-8116 - mongostat doesn't divide lock% by sampling interval
Branch: master
https://github.com/mongodb/mongo/commit/329657490c07c5b873acc501c80a7b22efe4eef0

Generated at Thu Feb 08 03:16:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.