Skip to content

Commit af97c70

Browse files
Rename [Simple|Aggregated]MetricSample to [Simple|Aggregated]MetricValue (#210)
Closes #141
2 parents 3a396c0 + 9ccb5b6 commit af97c70

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

RELEASE_NOTES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
`METRIC_AC_THD_CURRENT` -> `METRIC_AC_TOTAL_HARMONIC_DISTORTION_CURRENT`
3131
`METRIC_AC_THD_CURRENT_PHASE_[1|2|3]` -> `METRIC_AC_TOTAL_HARMONIC_DISTORTION_CURRENT_PHASE_[1|2|3]`
3232

33+
- Renamed `SimpleMetricSample` to `SimpleMetricValue`, because it does not
34+
contain a timestamp, so it does not represent a sample but a value.
35+
36+
- Renamed `AggregatedMetricSample` to `AggregatedMetricValue`, because it does not
37+
contain a timestamp, so it does not represent a sample but a value.
38+
39+
- Renamed `MetricSampleVariant` to `MetricValueVariant`.
40+
41+
- Rename `MetricSample.sample` to `MetricSample.value`.
42+
43+
- Rename `SensorMetricSample.sample` to `SensorMetricSample.value`.
44+
3345
## New Features
3446

3547
- Added a `Frequenz.api.common.v1.types.Decimal` type, compatible with

proto/frequenz/api/common/v1/metrics/metric_sample.proto

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import "google/protobuf/timestamp.proto";
1616

1717
// Represents a single sample of a specific metric, the value of which is either
1818
// measured or derived at a particular time.
19-
message SimpleMetricSample {
19+
message SimpleMetricValue {
2020
// The value of the metric, which could be either measured or derived.
2121
float value = 2;
2222
}
@@ -31,7 +31,7 @@ message SimpleMetricSample {
3131
// summaries—minimum, maximum, and average values. Individual measurements are
3232
// are optional, accommodating scenarios where only subsets of this information
3333
// are available.
34-
message AggregatedMetricSample {
34+
message AggregatedMetricValue {
3535
// The derived average value of the metric.
3636
float avg_value = 2;
3737

@@ -45,20 +45,20 @@ message AggregatedMetricSample {
4545
repeated float raw_values = 5;
4646
}
4747

48-
// MetricSampleVariant serves as a union type that can encapsulate either a
49-
// `SimpleMetricSample` or an `AggregatedMetricSample`.
48+
// `MetricValueVariant` serves as a union type that can encapsulate either a
49+
// `SimpleMetricValue` or an `AggregatedMetricValue`.
5050
//
5151
// This message is designed to offer flexibility in capturing different
5252
// granularities of metric samples—either a simple single-point measurement
5353
// or an aggregated set of measurements for a metric.
5454
//
55-
// A `MetricSampleVariant` can hold either a `SimpleMetricSample` or an
56-
// `AggregatedMetricSample`, but not both simultaneously. Setting one will
55+
// A `MetricValueVariant` can hold either a `SimpleMetricValue` or an
56+
// `AggregatedMetricValue`, but not both simultaneously. Setting one will
5757
// nullify the other.
58-
message MetricSampleVariant {
59-
oneof metric_sample_type {
60-
SimpleMetricSample simple_metric = 1;
61-
AggregatedMetricSample aggregated_metric = 2;
58+
message MetricValueVariant {
59+
oneof metric_value_variant {
60+
SimpleMetricValue simple_metric = 1;
61+
AggregatedMetricValue aggregated_metric = 2;
6262
}
6363
}
6464

@@ -178,7 +178,7 @@ message MetricSample {
178178
Metric metric = 2;
179179

180180
// The value of the sampled metric.
181-
MetricSampleVariant sample = 3;
181+
MetricValueVariant value = 3;
182182

183183
// List of bounds that apply to the metric sample.
184184
//

proto/frequenz/api/common/v1/microgrid/components/components.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ message ComponentConnection {
214214
// {
215215
// sampled_at: "2023-10-01T00:00:00Z",
216216
// metric: "DC_VOLTAGE_V",
217-
// sample: {},
217+
// value: {},
218218
// bounds: {},
219219
// },
220220
// {
221221
// sampled_at: "2023-10-01T00:00:00Z",
222222
// metric: "DC_VOLTAGE_V",
223-
// sample: {},
223+
// value: {},
224224
// bounds: {},
225225
// }
226226
// ],

proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ enum SensorMetric {
120120
// {
121121
// sampled_at: "2023-10-01T00:00:00Z",
122122
// metric: "METRIC_SENSOR_TEMPERATURE",
123-
// sample: metric_sample_type: {simple_metric: {value: 23.5},
123+
// value: metric_value_variant: {simple_metric: {value: 23.5},
124124
// },
125125
// {
126126
// sampled_at: "2023-10-01T00:00:00Z",
127127
// metric: "METRIC_SENSOR_RELATIVE_HUMIDITY",
128-
// sample: metric_sample_type: {simple_metric: {value: 23.5},
128+
// value: metric_value_variant: {simple_metric: {value: 23.5},
129129
// }
130130
// ],
131131
// states: [
@@ -209,5 +209,5 @@ message SensorMetricSample {
209209
frequenz.api.common.v1.metrics.Metric metric = 2;
210210

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

0 commit comments

Comments
 (0)