-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add Synchronous Metric Instruments SDK #179
Add Synchronous Metric Instruments SDK #179
Conversation
Codecov Report
@@ Coverage Diff @@
## master #179 +/- ##
=======================================
Coverage 92.19% 92.19%
=======================================
Files 117 117
Lines 4038 4038
=======================================
Hits 3723 3723
Misses 315 315 |
{} | ||
|
||
/** | ||
* Returns a Bound Instrument associated with the specified labels. * Multiples requests |
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.
Is this a format error?
// Utility function which converts maps to strings for better performance | ||
inline std::string mapToString(const std::map<std::string,std::string> & conv){ | ||
std::stringstream ss; | ||
ss <<"{ "; |
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 are several places in this PR where the code is not well-formatted (e.g. spacing, indentation, etc.)
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.
Sorry about that, for some reason these weren't an issue in my IDE. I'll be sure to go over them carefully and take care of all the issues.
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.
went back over and tried to clean up most of these
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, I'm concerned about the contention and allocation but these are not blocking this PR.
@ankit-bhargava would you rebase and resolve the conflicts? |
cc7fb1f
to
a332250
Compare
@reyang I had some issues rebasing so please let me know if anything looks off. Otherwise, this should be ready to go! |
921e53e
to
42da878
Compare
02a72da
to
4d90ee7
Compare
@reyang Recently rebased, think this can be merged. |
This PR implements classes described in the Metric Instruments API (PR #161). These classes, unlike the no-op implementations included with the API, are capable of actually collecting telemetry data and sit at the beginning of the Metrics data pipeline as they capture data from instrumented applications. Instruments employ Aggregators (pending approval in PR #178 ) to combine the updates they receive into meaningful values. The PR will not compile without these files.
A test suite which validates each instrument’s ability to record values in single-threaded and concurrent scenarios is included. Functions necessary for the metrics pipeline as a whole such as reference counting are tested as well.
This PR is part of a series of PRs to add a full implementation of metrics API and SDK support.
Note: We templated instruments to support a wider array of scalar types. Templating prevents us from using out of line declarations as we normally would. As a result, we left all implementation code in the header file. If there are any suggestions to remedy this we will gladly make the change.