Skip to content

Commit

Permalink
Add comment about protecting a collection cycle by a lock
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Cristian Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Feb 19, 2020
1 parent 5a8bce6 commit 22bd1e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/src/main/java/io/opentelemetry/sdk/metrics/Batcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
* A {@code Batcher} represents an internal representation of an {code Instrument} aggregation
* process. It records individual measurements (via the {@code Aggregator}). It batches together
* {@code Aggregator}s for the similar {@code LabelSet}.
*
* <p>The only thread safe method in this class is {@link #getAggregator()}. An entire collection
* cycle must be protected by a lock. A collection cycle is defined by multiple calls to {@link
* #batch(LabelSet, Aggregator, boolean)} followed by one {@link #completeCollectionCycle()};
*/
interface Batcher {

Expand Down

0 comments on commit 22bd1e7

Please sign in to comment.