Skip to content

Commit

Permalink
Add MeasurementKind::Dimensionless
Browse files Browse the repository at this point in the history
This commit adds a `Dimensionless` variant to the `MeasurementKind` enum
to represent measurements without units. This is intended to be used to
represent AMD CPU T<sub>ctl</sub> thermal values, which are a unitless
value from 0-100 representing a kind of "abstract thermal throttling
danger level" --- see oxidecomputer/hubris#1881 for details on why we
need to differentiate this from other temperature measurements.

I wasn't totally sure as to the best approach for naming this variant. I
note that the name of the enum is "measurement kind", not "measurement
unit", so it doesn't directly represent the unit of the measurement but
rather, the kind of quantity being measured. So, perhaps this ought to
be a `CpuTctl` variant or similar, to *specifically* represent
T<sub>ctl</sub> measurements. If other dimensionless values show up in
future, they would then have their own variant. I'm open to being
convicned either way --- what do others think?
  • Loading branch information
hawkw committed Sep 26, 2024
1 parent ba29f1f commit fdf1485
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gateway-messages/src/sp_to_mgs/measurement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ pub enum MeasurementKind {
InputCurrent,
InputVoltage,
Speed,
/// A dimensionless measurement, without units.
Dimensionless,
}

0 comments on commit fdf1485

Please sign in to comment.