Skip to content
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

Merged
merged 2 commits into from Jan 17, 2017
Merged

Conversation

aherlihy
Copy link
Contributor

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.

Copy link

@satyasinha satyasinha left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.
Copy link
Contributor

@pzrq pzrq Jan 17, 2017

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?

Copy link
Contributor Author

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`.
Copy link
Contributor

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?

Copy link
Contributor Author

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".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@pzrq
Copy link
Contributor

pzrq commented Jan 17, 2017

@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.

@aherlihy
Copy link
Contributor Author

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!

@aherlihy aherlihy merged commit dfc5751 into mongodb-js:master Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants