So, if that’s truly the case, wouldn’t that number always be incremented (until it overflows I guess)? Or is there a time-frame that opstatus uses to determine how many operations occurred? Do they roll off after some time? Why would that number go down?
The reason I ask is because I was attempting to monitor one of our dev servers, and I saw the numbers going up then when I ran it again 2-3 seconds later they go down, then up again. It seems inconsistent?
It looks like the script I was using to run this command has an issue. I was comparing the previous values each time to determine the difference each time it ran the db.serverStatus().opcounters command. So that makes sense to me now why I’d see the values going down…
Totally!
I think this script is trying to reproduce what mongostat is doing and it would also be much easier to plot these values to get something like what we have built-in MongoDB Atlas.