Add server and result level stats storage #34
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The server stats are automatically stored using the before and after hooks. We
store the uuid and the start time in the request in the before hook, and
compute the duration and store the entry in the after hook.
For the result stats, I just inserted entries at various parts of the code. The
entries are inserted using constants defined in the stats file, so that we know
what all of them are.
I added a new unit test case for the calculation of the sum, and tested that
the stats are inserted correctly manually due to lack of time. A unit test is
pending and will be checked in soon.
All this code is exercised using existing unit tests, all of which pass. The
storage code is copied from the client stats code, which is known to work. For
completeness, we just need to add a new unit test testing that the generated
stats are indeed stored correctly in the database.
I have filed an issue to track this.