Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->
* Additional information for energy metric

## Bug Fixes

Expand Down
15 changes: 13 additions & 2 deletions src/frequenz/client/common/metric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@


class Metric(Enum):
"""List of supported metrics."""
"""List of supported metrics.

AC energy metrics information:
* This energy metric is reported directly from the component, and not a
result of aggregations in our systems. If a component does not have this
metric, this field cannot be populated.
* Components that provide energy metrics reset this metric from time to
time. This behaviour is specific to each component model. E.g., some
components reset it on UTC 00:00:00.
* This energy metric does not specify the timestamp since when the energy
was being accumulated, and therefore can be inconsistent.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels almost like "USE AT YOUR OWN RISK" disclaimer XD

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a sense, yes. We decided to be transparent to the client, and expose whatever metric the components provide. We can sanitise a few, but not all, e.g., energy.

I guess we will get more user feedback for this field in the future ..

"""

# Default value
UNSPECIFIED = PBMetric.METRIC_UNSPECIFIED
Expand Down Expand Up @@ -57,7 +68,7 @@ class Metric(Enum):
AC_POWER_FACTOR_PHASE_2 = PBMetric.METRIC_AC_POWER_FACTOR_PHASE_2
AC_POWER_FACTOR_PHASE_3 = PBMetric.METRIC_AC_POWER_FACTOR_PHASE_3

# AC energy metrics
# AC energy metrics - Please be careful when using and check Enum docs
AC_APPARENT_ENERGY = PBMetric.METRIC_AC_APPARENT_ENERGY
AC_APPARENT_ENERGY_PHASE_1 = PBMetric.METRIC_AC_APPARENT_ENERGY_PHASE_1
AC_APPARENT_ENERGY_PHASE_2 = PBMetric.METRIC_AC_APPARENT_ENERGY_PHASE_2
Expand Down