At MongoDB, we frequently struggle with tracking developer productivity, and trying to understand how and when we're doing our best work. Answering these questions would give us key insight on how to enable our engineers to get work done faster and better.
One way we would love to achieve this is through a git post-commit hook that records data about our commits in a MongoDB. Then we could create and run aggregations, giving us insight to interesting questions like:
1) On average, when are we most productive?
2) What time of day do we see the most commits?
3) What is the size of a typical commit?
Please complete the following:
1) Submit the code for your git post-commit hook
2) Explain how to operate the hook, as well as the design choices made, and tradeoffs accepted
3) What are a few aggregation queries you might run?
When submitting your solution, consider the following:
1) Our developers may not have the same type of environment or even OS.
2) The commit hook can’t take more than 500ms since we don’t want to interrupt our workflow.
3) The hook should not create duplicate information. (ex. rebases, amends, etc.)