Skip to content

Commit

Permalink
Change sensor Value to double
Browse files Browse the repository at this point in the history
Generally most demons we've looked at take the int64 values and
immediately translates the value to a double. As the individual demons
are doing the floating point computation anyway, there doesn't seem to be
a large benefit to keeping separating the value on dbus, only to recompute
in each demon, causing extra overhead for consumers. In some cases this
causes an extra d-bus call, for instance when reading a threshold a
consumer to know the value needs to also access the value field to get
the scale, which is arguably more expensive than having the property be a
double in the first place.

Change-Id: If47c19f77286e3764d167a6843ba91e2ca1769b8
Signed-off-by: James Feist <james.feist@linux.intel.com>
  • Loading branch information
feistjj committed Jun 17, 2020
1 parent 12a8ca8 commit 4ec6587
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions xyz/openbmc_project/Sensor/Threshold/Critical.interface.yaml
Expand Up @@ -15,11 +15,11 @@ description: >
properties:
- name: CriticalHigh
type: int64
type: double
description: >
The upper bound of the critical threshold.
- name: CriticalLow
type: int64
type: double
description: >
The lower bound of the critical threshold.
- name: CriticalAlarmHigh
Expand Down
4 changes: 2 additions & 2 deletions xyz/openbmc_project/Sensor/Threshold/Warning.interface.yaml
Expand Up @@ -16,11 +16,11 @@ description: >
properties:
- name: WarningHigh
type: int64
type: double
description: >
The upper bound of the warning threshold.
- name: WarningLow
type: int64
type: double
description: >
The lower bound of the warning threshold.
- name: WarningAlarmHigh
Expand Down
11 changes: 3 additions & 8 deletions xyz/openbmc_project/Sensor/Value.interface.yaml
Expand Up @@ -19,15 +19,15 @@ description: >
properties:
- name: Value
type: int64
type: double
description: >
The sensor reading.
- name: MaxValue
type: int64
type: double
description: >
The Maximum supported sensor reading.
- name: MinValue
type: int64
type: double
description: >
The Minimum supported sensor reading.
- name: Unit
Expand All @@ -42,11 +42,6 @@ properties:
For objects in the power namespace, Unit must be "Watts".
For objects in the energy namespace, Unit must be "Joules".
For objects in the utilization namespace, Unit must be "Percent"
- name: Scale
type: int64
description: >
The reading scaling factor N, where the actual reading is Value * 10^N.
This is immutable once set for a sensor.
enumerations:
- name: Unit
Expand Down

0 comments on commit 4ec6587

Please sign in to comment.