Skip to content

Commit 8b66fd1

Browse files
Rename metric variants to follow a consistent naming scheme
This commit renames the metric variants in `metrics.proto` to follow a more consistent naming scheme. The new naming convention uses a core-concept to modifier format, which improves clarity and consistency across the metric definitions. Signed-off-by: Tiyash Basu <[email protected]>
1 parent 0e45c6d commit 8b66fd1

File tree

2 files changed

+42
-32
lines changed

2 files changed

+42
-32
lines changed

RELEASE_NOTES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
* `MetricSample.source` to `MetricSample.connection`
4848
* `MetricSample.sampled_at` to `sample_time`
4949

50+
+ `metrics.Metric`:
51+
52+
* The enum variants to follow a more consistent naming scheme of core-concept to modifier.
53+
* `METRIC_AC_APPARENT_POWER*` to `METRIC_AC_POWER_APPARENT*`
54+
* `METRIC_AC_ACTIVE_POWER*` to `METRIC_AC_POWER_ACTIVE*`
55+
* `METRIC_AC_REACTIVE_POWER*` to `METRIC_AC_POWER_REACTIVE*`
56+
* `METRIC_AC_APPARENT_ENERGY*` to `METRIC_AC_ENERGY_APPARENT*`
57+
* `METRIC_AC_ACTIVE_ENERGY*` to `METRIC_AC_ENERGY_ACTIVE*`
58+
* `METRIC_AC_REACTIVE_ENERGY*` to `METRIC_AC_ENERGY_REACTIVE*`
59+
5060
- Renumbered some enum values to remove unnecessary gaps:
5161

5262
+ `microgrid.components.ComponentCategory` (`microgrid.electrical_components.ElectricalComponentCategory`)

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

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,18 @@ enum Metric {
101101
METRIC_AC_CURRENT_PHASE_3 = 21;
102102

103103
// AC power metrics
104-
METRIC_AC_APPARENT_POWER = 22;
105-
METRIC_AC_APPARENT_POWER_PHASE_1 = 23;
106-
METRIC_AC_APPARENT_POWER_PHASE_2 = 24;
107-
METRIC_AC_APPARENT_POWER_PHASE_3 = 25;
108-
METRIC_AC_ACTIVE_POWER = 26;
109-
METRIC_AC_ACTIVE_POWER_PHASE_1 = 27;
110-
METRIC_AC_ACTIVE_POWER_PHASE_2 = 28;
111-
METRIC_AC_ACTIVE_POWER_PHASE_3 = 29;
112-
METRIC_AC_REACTIVE_POWER = 30;
113-
METRIC_AC_REACTIVE_POWER_PHASE_1 = 31;
114-
METRIC_AC_REACTIVE_POWER_PHASE_2 = 32;
115-
METRIC_AC_REACTIVE_POWER_PHASE_3 = 33;
104+
METRIC_AC_POWER_APPARENT = 22;
105+
METRIC_AC_POWER_APPARENT_PHASE_1 = 23;
106+
METRIC_AC_POWER_APPARENT_PHASE_2 = 24;
107+
METRIC_AC_POWER_APPARENT_PHASE_3 = 25;
108+
METRIC_AC_POWER_ACTIVE = 26;
109+
METRIC_AC_POWER_ACTIVE_PHASE_1 = 27;
110+
METRIC_AC_POWER_ACTIVE_PHASE_2 = 28;
111+
METRIC_AC_POWER_ACTIVE_PHASE_3 = 29;
112+
METRIC_AC_POWER_REACTIVE = 30;
113+
METRIC_AC_POWER_REACTIVE_PHASE_1 = 31;
114+
METRIC_AC_POWER_REACTIVE_PHASE_2 = 32;
115+
METRIC_AC_POWER_REACTIVE_PHASE_3 = 33;
116116

117117
// AC Power factor
118118
METRIC_AC_POWER_FACTOR = 40;
@@ -121,26 +121,26 @@ enum Metric {
121121
METRIC_AC_POWER_FACTOR_PHASE_3 = 43;
122122

123123
// AC energy metrics
124-
METRIC_AC_APPARENT_ENERGY = 50;
125-
METRIC_AC_APPARENT_ENERGY_PHASE_1 = 51;
126-
METRIC_AC_APPARENT_ENERGY_PHASE_2 = 52;
127-
METRIC_AC_APPARENT_ENERGY_PHASE_3 = 53;
128-
METRIC_AC_ACTIVE_ENERGY = 54;
129-
METRIC_AC_ACTIVE_ENERGY_PHASE_1 = 55;
130-
METRIC_AC_ACTIVE_ENERGY_PHASE_2 = 56;
131-
METRIC_AC_ACTIVE_ENERGY_PHASE_3 = 57;
132-
METRIC_AC_ACTIVE_ENERGY_CONSUMED = 58;
133-
METRIC_AC_ACTIVE_ENERGY_CONSUMED_PHASE_1 = 59;
134-
METRIC_AC_ACTIVE_ENERGY_CONSUMED_PHASE_2 = 60;
135-
METRIC_AC_ACTIVE_ENERGY_CONSUMED_PHASE_3 = 61;
136-
METRIC_AC_ACTIVE_ENERGY_DELIVERED = 62;
137-
METRIC_AC_ACTIVE_ENERGY_DELIVERED_PHASE_1 = 63;
138-
METRIC_AC_ACTIVE_ENERGY_DELIVERED_PHASE_2 = 64;
139-
METRIC_AC_ACTIVE_ENERGY_DELIVERED_PHASE_3 = 65;
140-
METRIC_AC_REACTIVE_ENERGY = 66;
141-
METRIC_AC_REACTIVE_ENERGY_PHASE_1 = 67;
142-
METRIC_AC_REACTIVE_ENERGY_PHASE_2 = 68;
143-
METRIC_AC_REACTIVE_ENERGY_PHASE_3 = 69;
124+
METRIC_AC_ENERGY_APPARENT = 50;
125+
METRIC_AC_ENERGY_APPARENT_PHASE_1 = 51;
126+
METRIC_AC_ENERGY_APPARENT_PHASE_2 = 52;
127+
METRIC_AC_ENERGY_APPARENT_PHASE_3 = 53;
128+
METRIC_AC_ENERGY_ACTIVE = 54;
129+
METRIC_AC_ENERGY_ACTIVE_PHASE_1 = 55;
130+
METRIC_AC_ENERGY_ACTIVE_PHASE_2 = 56;
131+
METRIC_AC_ENERGY_ACTIVE_PHASE_3 = 57;
132+
METRIC_AC_ENERGY_ACTIVE_CONSUMED = 58;
133+
METRIC_AC_ENERGY_ACTIVE_CONSUMED_PHASE_1 = 59;
134+
METRIC_AC_ENERGY_ACTIVE_CONSUMED_PHASE_2 = 60;
135+
METRIC_AC_ENERGY_ACTIVE_CONSUMED_PHASE_3 = 61;
136+
METRIC_AC_ENERGY_ACTIVE_DELIVERED = 62;
137+
METRIC_AC_ENERGY_ACTIVE_DELIVERED_PHASE_1 = 63;
138+
METRIC_AC_ENERGY_ACTIVE_DELIVERED_PHASE_2 = 64;
139+
METRIC_AC_ENERGY_ACTIVE_DELIVERED_PHASE_3 = 65;
140+
METRIC_AC_ENERGY_REACTIVE = 66;
141+
METRIC_AC_ENERGY_REACTIVE_PHASE_1 = 67;
142+
METRIC_AC_ENERGY_REACTIVE_PHASE_2 = 68;
143+
METRIC_AC_ENERGY_REACTIVE_PHASE_3 = 69;
144144

145145
// AC harmonics
146146
METRIC_AC_TOTAL_HARMONIC_DISTORTION_CURRENT = 80;

0 commit comments

Comments
 (0)