You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue earlier today while working on an API to get sensors.
When extracting data for all sensors, the ReadingRangeMax value for some sensors is too large to be processed in the Go struct from the library. I can't ignore specific sensors because the process retrieves all sensors, deconstructs the data using the GoFish library's built-in API, and extracts the relevant information.
While I can choose not to output the data, I’m not sure how to block its processing due to how the underlying API is constructed. Although the actual readings are typically around 157 for most sensors, the maximum limit is set to "ReadingRangeMax": 1.7976931348623157e+308. The API hangs on this max value and doesn't proceed for those instances, as it doesn’t parse them.
For example, when requesting one of the PMT_Socket objects, the ReadingRangeMax is "1.7976931348623157e+308". This is the max value for float64, but the Go struct in the API uses a float32 for ReadingRangeMax.
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/count_PMT_Socket0_Core7_CSTATE_RESIDENCY_C0",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "count_PMT_Socket0_Core7_CSTATE_RESIDENCY_C0",
"Name": "PMT Socket0 Core7 CSTATE RESIDENCY C0",
"Reading": 157.78590568, "ReadingRangeMax": 1.7976931348623157e+308,
"ReadingRangeMin": 0.0,
"ReadingUnits": "Units",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
Would you be interested in updating it to use float64, given that we have a BMC instance returning the max float64 value for the “ReadingRangeMax” field.
Best,
Rachana Murali Narayanan
The text was updated successfully, but these errors were encountered:
The spec isn't always too clear on number ranges, so I know we've had a few of these where it's been found to need a much larger type. I'll put up an update for the ReadingRangeMax. Just let me know if you run in to any others like this.
Hi,
I encountered an issue earlier today while working on an API to get sensors.
When extracting data for all sensors, the ReadingRangeMax value for some sensors is too large to be processed in the Go struct from the library. I can't ignore specific sensors because the process retrieves all sensors, deconstructs the data using the GoFish library's built-in API, and extracts the relevant information.
While I can choose not to output the data, I’m not sure how to block its processing due to how the underlying API is constructed. Although the actual readings are typically around 157 for most sensors, the maximum limit is set to "ReadingRangeMax": 1.7976931348623157e+308. The API hangs on this max value and doesn't proceed for those instances, as it doesn’t parse them.
For example, when requesting one of the PMT_Socket objects, the ReadingRangeMax is "1.7976931348623157e+308". This is the max value for float64, but the Go struct in the API uses a float32 for ReadingRangeMax.
gofish/redfish/sensor.go
Line 399 in 934e39a
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/count_PMT_Socket0_Core7_CSTATE_RESIDENCY_C0",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "count_PMT_Socket0_Core7_CSTATE_RESIDENCY_C0",
"Name": "PMT Socket0 Core7 CSTATE RESIDENCY C0",
"Reading": 157.78590568,
"ReadingRangeMax": 1.7976931348623157e+308,
"ReadingRangeMin": 0.0,
"ReadingUnits": "Units",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
Would you be interested in updating it to use float64, given that we have a BMC instance returning the max float64 value for the “ReadingRangeMax” field.
Best,
Rachana Murali Narayanan
The text was updated successfully, but these errors were encountered: