-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
Signed-off-by: Gagan Juneja <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.telemetry.metrics; | ||
|
||
import org.opensearch.common.annotation.ExperimentalApi; | ||
import org.opensearch.telemetry.metrics.tags.Tags; | ||
|
||
/** | ||
* Observable Measurement for the Asynchronous instruments. | ||
* @opensearch.experimental | ||
*/ | ||
@ExperimentalApi | ||
public class ObservableMeasurement { | ||
private final Double value; | ||
private final Tags tags; | ||
|
||
/** | ||
* Factory method to create the {@link ObservableMeasurement} object. | ||
* @param value value. | ||
* @param tags tags to be added per value. | ||
* @return ObservableMeasurement | ||
*/ | ||
public static ObservableMeasurement create(double value, Tags tags) { | ||
return new ObservableMeasurement(value, tags); | ||
Check warning on line 30 in libs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java Codecov / codecov/patchlibs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java#L30
|
||
} | ||
|
||
private ObservableMeasurement(double value, Tags tags) { | ||
this.value = value; | ||
this.tags = tags; | ||
} | ||
Check warning on line 36 in libs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java Codecov / codecov/patchlibs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java#L33-L36
|
||
|
||
/** | ||
* Returns the value. | ||
* @return value | ||
*/ | ||
public Double getValue() { | ||
return value; | ||
Check warning on line 43 in libs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java Codecov / codecov/patchlibs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java#L43
|
||
} | ||
|
||
/** | ||
* Returns the tags. | ||
* @return tags | ||
*/ | ||
public Tags getTags() { | ||
return tags; | ||
Check warning on line 51 in libs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java Codecov / codecov/patchlibs/telemetry/src/main/java/org/opensearch/telemetry/metrics/ObservableMeasurement.java#L51
|
||
} | ||
} |