-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 MetricRecorder implementation #11128
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
413393a
added MetricRecordedImpl and unite tests for MetricInstrumentRegistry
DNVindhya 295e58d
changed MetricRcorderImpl to public
DNVindhya 0f95f8e
updated MetricInstrumenetRegistry to use array instead of ArrayList; …
DNVindhya 7167dcb
Renamed record<>Counter APIs to add<>Counter. Added check for mismatc…
DNVindhya 677f82c
addressed review comments
DNVindhya 2dbf553
updated to use array length
DNVindhya 5f98cdf
added lock for instruments array
DNVindhya File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
|
||
package io.grpc; | ||
|
||
import io.grpc.DoubleCounterMetricInstrument; | ||
import io.grpc.DoubleHistogramMetricInstrument; | ||
import io.grpc.Internal; | ||
import io.grpc.LongCounterMetricInstrument; | ||
import io.grpc.LongHistogramMetricInstrument; | ||
import java.util.List; | ||
|
||
/** | ||
|
@@ -30,25 +25,25 @@ | |
@Internal | ||
public interface MetricRecorder { | ||
/** | ||
* Records a value for a double-precision counter metric instrument. | ||
* Adds a value for a double-precision counter metric instrument. | ||
* | ||
* @param metricInstrument The counter metric instrument to record the value against. | ||
* @param value The value to record. | ||
* @param metricInstrument The counter metric instrument to add the value against. | ||
* @param value The value to add. | ||
* @param requiredLabelValues A list of required label values for the metric. | ||
* @param optionalLabelValues A list of additional, optional label values for the metric. | ||
*/ | ||
default void recordDoubleCounter(DoubleCounterMetricInstrument metricInstrument, double value, | ||
default void addDoubleCounter(DoubleCounterMetricInstrument metricInstrument, double value, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @temawi updated counter APIs. Can you PTAL? |
||
List<String> requiredLabelValues, List<String> optionalLabelValues) {} | ||
|
||
/** | ||
* Records a value for a long valued counter metric instrument. | ||
* Adds a value for a long valued counter metric instrument. | ||
* | ||
* @param metricInstrument The counter metric instrument to record the value against. | ||
* @param value The value to record. | ||
* @param metricInstrument The counter metric instrument to add the value against. | ||
* @param value The value to add. | ||
* @param requiredLabelValues A list of required label values for the metric. | ||
* @param optionalLabelValues A list of additional, optional label values for the metric. | ||
*/ | ||
default void recordLongCounter(LongCounterMetricInstrument metricInstrument, long value, | ||
default void addLongCounter(LongCounterMetricInstrument metricInstrument, long value, | ||
List<String> requiredLabelValues, List<String> optionalLabelValues) {} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
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.
@GuardedBy("lock")
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