-
-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/span-level-measurement
- Loading branch information
Showing
42 changed files
with
3,251 additions
and
15 deletions.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,122 @@ | ||
package io.sentry; | ||
|
||
import java.io.Closeable; | ||
import java.util.Map; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public interface IMetricsAggregator extends Closeable { | ||
|
||
/** | ||
* Emits a Counter metric | ||
* | ||
* @param key A unique key identifying the metric | ||
* @param value The value to be added | ||
* @param unit An optional unit, see {@link MeasurementUnit} | ||
* @param tags Optional Tags to associate with the metric | ||
* @param timestampMs The time when the metric was emitted. Defaults to the time at which the | ||
* metric is emitted, if no value is provided. | ||
* @param stackLevel Optional number of stacks levels to ignore when determining the code location | ||
*/ | ||
void increment( | ||
final @NotNull String key, | ||
final double value, | ||
final @Nullable MeasurementUnit unit, | ||
final @Nullable Map<String, String> tags, | ||
final long timestampMs, | ||
final int stackLevel); | ||
|
||
/** | ||
* Emits a Gauge metric | ||
* | ||
* @param key A unique key identifying the metric | ||
* @param value The value to be added | ||
* @param unit An optional unit, see {@link MeasurementUnit} | ||
* @param tags Optional Tags to associate with the metric | ||
* @param timestampMs The time when the metric was emitted. Defaults to the time at which the | ||
* metric is emitted, if no value is provided. | ||
* @param stackLevel Optional number of stacks levels to ignore when determining the code location | ||
*/ | ||
void gauge( | ||
final @NotNull String key, | ||
final double value, | ||
final @Nullable MeasurementUnit unit, | ||
final @Nullable Map<String, String> tags, | ||
final long timestampMs, | ||
final int stackLevel); | ||
|
||
/** | ||
* Emits a Distribution metric | ||
* | ||
* @param key A unique key identifying the metric | ||
* @param value The value to be added | ||
* @param unit An optional unit, see {@link MeasurementUnit} | ||
* @param tags Optional Tags to associate with the metric | ||
* @param timestampMs The time when the metric was emitted. Defaults to the time at which the | ||
* metric is emitted, if no value is provided. | ||
* @param stackLevel Optional number of stacks levels to ignore when determining the code location | ||
*/ | ||
void distribution( | ||
final @NotNull String key, | ||
final double value, | ||
final @Nullable MeasurementUnit unit, | ||
final @Nullable Map<String, String> tags, | ||
final long timestampMs, | ||
final int stackLevel); | ||
|
||
/** | ||
* Emits a Set metric | ||
* | ||
* @param key A unique key identifying the metric | ||
* @param value The value to be added | ||
* @param unit An optional unit, see {@link MeasurementUnit} | ||
* @param tags Optional Tags to associate with the metric | ||
* @param timestampMs The time when the metric was emitted. Defaults to the time at which the | ||
* metric is emitted, if no value is provided. | ||
* @param stackLevel Optional number of stacks levels to ignore when determining the code location | ||
*/ | ||
void set( | ||
final @NotNull String key, | ||
final int value, | ||
final @Nullable MeasurementUnit unit, | ||
final @Nullable Map<String, String> tags, | ||
final long timestampMs, | ||
final int stackLevel); | ||
|
||
/** | ||
* Emits a Set metric | ||
* | ||
* @param key A unique key identifying the metric | ||
* @param value The value to be added | ||
* @param unit An optional unit, see {@link MeasurementUnit} | ||
* @param tags Optional Tags to associate with the metric | ||
* @param timestampMs The time when the metric was emitted. Defaults to the time at which the | ||
* metric is emitted, if no value is provided. | ||
* @param stackLevel Optional number of stacks levels to ignore when determining the code location | ||
*/ | ||
void set( | ||
final @NotNull String key, | ||
final @NotNull String value, | ||
final @Nullable MeasurementUnit unit, | ||
final @Nullable Map<String, String> tags, | ||
final long timestampMs, | ||
final int stackLevel); | ||
|
||
/** | ||
* Emits a distribution with the time it takes to run a given code block. | ||
* | ||
* @param key A unique key identifying the metric | ||
* @param callback The code block to measure | ||
* @param unit An optional unit, see {@link MeasurementUnit.Duration}, defaults to seconds | ||
* @param tags Optional Tags to associate with the metric | ||
* @param stackLevel Optional number of stacks levels to ignore when determining the code location | ||
*/ | ||
void timing( | ||
final @NotNull String key, | ||
final @NotNull Runnable callback, | ||
final @NotNull MeasurementUnit.Duration unit, | ||
final @Nullable Map<String, String> tags, | ||
final int stackLevel); | ||
|
||
void flush(boolean force); | ||
} |
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.