phosphor-health-monitor: add new D-Bus interface
This commit introduces following changes -
- A new Metrics Value Interface.
- An interface to reset the metrics, if needed.
- Common Threshold interface so it can be used in Metrics and Sensors.
For more detail, please refer to design -
https://gerrit.openbmc.org/c/openbmc/docs/+/64917
Unit Test: meson build passes.
Change-Id: I014a047f9db6fe470124baa41dcce93caf7ceb4b
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/yaml/xyz/openbmc_project/Metrics/Value.interface.yaml b/yaml/xyz/openbmc_project/Metrics/Value.interface.yaml
new file mode 100644
index 0000000..e0d6441
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Metrics/Value.interface.yaml
@@ -0,0 +1,57 @@
+description: >
+ This interface provides the Board Manager Metric values for resource
+ utilization.
+
+properties:
+ - name: Value
+ type: double
+ description: >
+ The current metric value.
+ flags:
+ - readonly
+ - name: MaxValue
+ type: double
+ default: infinity
+ flags:
+ - readonly
+ description: >
+ The maximum supported metric value.
+ - name: MinValue
+ type: double
+ default: -infinity
+ flags:
+ - readonly
+ description: >
+ The minimum supported metric value.
+ - name: Unit
+ type: enum[self.Unit]
+ description: >
+ The unit for metric value. For example, memory in bytes, CPU in
+ percent, reboots in count.
+ flags:
+ - const
+
+enumerations:
+ - name: Unit
+ description: >
+ Metric value unit.
+ values:
+ - name: Bytes
+ description: >
+ Unit to indicate bytes.
+ - name: Count
+ description: >
+ Unit to indicate counts.
+ - name: Percent
+ description: >
+ Unit to indicate percentage.
+
+associations:
+ - name: measuring
+ description: >
+ Metrics measure the inventory item's resource utilization, therefore
+ implement an association to the inventory item.
+ reverse_names:
+ - measured_by
+ required_endpoint_interfaces:
+ - xyz.openbmc_project.Inventory.Item