Skip to content

Commit

Permalink
Rename SimpleMetricSample to SimpleMetricValue
Browse files Browse the repository at this point in the history
In out terminology, we refer to a "sample" as a data structure that stores
a value alongside a timestamp. Since the message `SimpleMetricSample` does
not contain timestamps, it needs to be renamed.

Signed-off-by: Tiyash Basu <tiyash.basu@frequenz.com>
  • Loading branch information
tiyash-basu-frequenz committed Mar 22, 2024
1 parent 3a396c0 commit 56ed231
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
`METRIC_AC_THD_CURRENT` -> `METRIC_AC_TOTAL_HARMONIC_DISTORTION_CURRENT`
`METRIC_AC_THD_CURRENT_PHASE_[1|2|3]` -> `METRIC_AC_TOTAL_HARMONIC_DISTORTION_CURRENT_PHASE_[1|2|3]`

- Renamed `SimpleMetricSample` to `SimpleMetricValue`, because it does not
contain a timestamp, so it does not represent a sample but a value.

## New Features

- Added a `Frequenz.api.common.v1.types.Decimal` type, compatible with
Expand Down
8 changes: 4 additions & 4 deletions proto/frequenz/api/common/v1/metrics/metric_sample.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import "google/protobuf/timestamp.proto";

// Represents a single sample of a specific metric, the value of which is either
// measured or derived at a particular time.
message SimpleMetricSample {
message SimpleMetricValue {
// The value of the metric, which could be either measured or derived.
float value = 2;
}
Expand Down Expand Up @@ -46,18 +46,18 @@ message AggregatedMetricSample {
}

// MetricSampleVariant serves as a union type that can encapsulate either a
// `SimpleMetricSample` or an `AggregatedMetricSample`.
// `SimpleMetricValue` or an `AggregatedMetricSample`.
//
// 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 `SimpleMetricSample` or an
// A `MetricSampleVariant` can hold either a `SimpleMetricValue` or an
// `AggregatedMetricSample`, but not both simultaneously. Setting one will
// nullify the other.
message MetricSampleVariant {
oneof metric_sample_type {
SimpleMetricSample simple_metric = 1;
SimpleMetricValue simple_metric = 1;
AggregatedMetricSample aggregated_metric = 2;
}
}
Expand Down

0 comments on commit 56ed231

Please sign in to comment.