Skip to content

Commit

Permalink
Rename MetricSampleVariant to MetricValueVariant
Browse files Browse the repository at this point in the history
This variants present in this enum are not called samples anymore, but
values.

Signed-off-by: Tiyash Basu <[email protected]>
  • Loading branch information
tiyash-basu-frequenz committed Mar 22, 2024
1 parent cb6cc75 commit fbcc68b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
- Renamed `AggregatedMetricSample` to `AggregatedMetricValue`, because it does not
contain a timestamp, so it does not represent a sample but a value.

- Renamed `MetricSampleVariant` to `MetricValueVariant`.

## New Features

- Added a `Frequenz.api.common.v1.types.Decimal` type, compatible with
Expand Down
10 changes: 5 additions & 5 deletions proto/frequenz/api/common/v1/metrics/metric_sample.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ message AggregatedMetricValue {
repeated float raw_values = 5;
}

// MetricSampleVariant serves as a union type that can encapsulate either a
// `MetricValueVariant` serves as a union type that can encapsulate either a
// `SimpleMetricValue` or an `AggregatedMetricValue`.
//
// This message is designed to offer flexibility in capturing different
// granularities of metric samples—either a simple single-point measurement
// or an aggregated set of measurements for a metric.
//
// A `MetricSampleVariant` can hold either a `SimpleMetricValue` or an
// A `MetricValueVariant` can hold either a `SimpleMetricValue` or an
// `AggregatedMetricValue`, but not both simultaneously. Setting one will
// nullify the other.
message MetricSampleVariant {
oneof metric_sample_type {
message MetricValueVariant {
oneof metric_value_variant {
SimpleMetricValue simple_metric = 1;
AggregatedMetricValue aggregated_metric = 2;
}
Expand Down Expand Up @@ -178,7 +178,7 @@ message MetricSample {
Metric metric = 2;

// The value of the sampled metric.
MetricSampleVariant sample = 3;
MetricValueVariant sample = 3;

// List of bounds that apply to the metric sample.
//
Expand Down
6 changes: 3 additions & 3 deletions proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ enum SensorMetric {
// {
// sampled_at: "2023-10-01T00:00:00Z",
// metric: "METRIC_SENSOR_TEMPERATURE",
// sample: metric_sample_type: {simple_metric: {value: 23.5},
// sample: metric_value_variant: {simple_metric: {value: 23.5},
// },
// {
// sampled_at: "2023-10-01T00:00:00Z",
// metric: "METRIC_SENSOR_RELATIVE_HUMIDITY",
// sample: metric_sample_type: {simple_metric: {value: 23.5},
// sample: metric_value_variant: {simple_metric: {value: 23.5},
// }
// ],
// states: [
Expand Down Expand Up @@ -209,5 +209,5 @@ message SensorMetricSample {
frequenz.api.common.v1.metrics.Metric metric = 2;

// The value of the sampled metric.
frequenz.api.common.v1.metrics.MetricSampleVariant sample = 3;
frequenz.api.common.v1.metrics.MetricValueVariant sample = 3;
}

0 comments on commit fbcc68b

Please sign in to comment.