New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COMPASS-319 - Added RTSS README #746
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
quite detailed 💯
@@ -1,12 +1,82 @@ | |||
# Compass Real Time Server Stats Package | |||
|
|||
Provides functionality shown in the RTSS zero state view. | |||
The RTSS page is compromised of 3 main elements: | |||
- The "hot collections" table based on the `top` command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps link to:
https://docs.mongodb.com/master/reference/command/top/
Thinking out loud - Is the link enough or should there be a note about recommending access to the privileged admin database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I don't think we need to recommend access because this isn't a readme for users, it's for people who are likely going to contribute to the code.
Provides functionality shown in the RTSS zero state view. | ||
The RTSS page is compromised of 3 main elements: | ||
- The "hot collections" table based on the `top` command | ||
- The "slow operations" table based on the `currentOp` command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The RTSS page is compromised of 3 main elements: | ||
- The "hot collections" table based on the `top` command | ||
- The "slow operations" table based on the `currentOp` command | ||
- Four charts based on the `serverStatus` command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
The `restart` action clears the stored data in each of the chart stores and the `pause` action stops new data from being displayed but continues to collect data. | ||
|
||
The charts' X axes are the time from `serverStatus.localTime` and the Y axes vary depending on the graph. Each graph store selects data to send to it's instance of `chart-component` where it is put into a d3 chart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The `globallock-store` gets data from [the "globallock" field](https://docs.mongodb.com/manual/reference/command/serverStatus/#server-status-global-lock). The Y values are the current number of operations from `serverStatus.globalLock.activeClients.readers`(active reads) `serverStatus.globalLock.activeClients.writers` (active writes), `serverStatus.globalLock.currentQueue.readers` (queued reads) and `serverStatus.globalLock.currentQueue.writers` (queued writes). | ||
|
||
## Hot Collections | ||
The `top-store` listens to `pollTop`, `pause`, and `restart` actions. When `pollTop` is triggered, it calls `top` on the DataService and passes the list of hottest (i.e. most used, or **greatest system load**) to the `top-component`. The order of the list is calculated to be consistent with how the Cloud team and `mongotop` rank their hot collections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was this ranking derived? Is there anything Compass can link to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @john-morales might know if there's anything we can link to.
The `restart` action clears the stored data in each of the chart stores and the `pause` action stops new data from being displayed but continues to collect data. | ||
|
||
#### Variables: | ||
Each data point _x_ includes the fields `total`, `readLock`, and `writeLock`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ The detail here, though it feels like the context has been lost if I read this without reading the document from top to bottom.
Would linking again to the "globallock" field be appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the results from top, not the results from globallock.
|
||
## DB Errors | ||
|
||
If any of `server-stats-graphs-store`, `top-store`, or `current-op-store` receive an error from the DataService, they will trigger the `dbError` action. The `dberror-store` listens for errors and passes any new errors to the `dberror-component` which will display a red banner with an interpretation of the error received. The raw errors are transformed from MongoErrors to more human-readable and helpful error messages with `mongodb-js-errors.translate`. If an error goes away, i.e. dbError is triggered and the error is now null, then the banner will be removed. If the d3 charts receive data with a non-null error they will not draw the charts and instead display "DATA UNAVAILABLE". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@aherlihy Thanks for doing this 👍 Overall LGTM and can be merged as is (after rebase or by Compass maintainers), added my suggestions for improvement as commented. Sorry about the many comments spam, GitHub doesn't seem to want to let me start a review. |
Thanks for the review @pzrq! I've added the links you suggested, only thing missing is an original source for the top rankings. I don't think there is one, but we'll see. Happy to merge as is now. Thanks! |
I've added a README for the RTSS sub package. I did not include specifics about the d3 code because it's pretty well documented by comments and it's about to change quite a bit when we merge back in with what the cloud team has implemented.