summaryrefslogtreecommitdiff
path: root/redfish-core/lib/sensors.hpp
diff options
context:
space:
mode:
authorGeorge Liu <liuxiwei@inspur.com>2021-02-01 09:42:49 +0300
committerEd Tanous <ed@tanous.net>2021-08-20 22:12:03 +0300
commite8204933be90353ef672e62dc628448173279e1c (patch)
treedd769e166882e233a619089f0959aa5fd70c3d3d /redfish-core/lib/sensors.hpp
parent1c05dae3011628e5726eefc3ec4dbe7733fbb4d5 (diff)
downloadbmcweb-e8204933be90353ef672e62dc628448173279e1c.tar.xz
Move sensor collection to all sensors
Redfish's thinking on what sensors should be included in the sensor collection has changed. Roughly two years ago their thinking was "for sensors that are not covered elsewhere in the model-meaning do not duplicate Power and Thermal" and that is what OpenBMC implemented. Today, as described in the new thermalSubsystem and powerSubsystem doc the sensor collection should contain all sensors that are associated with that chassis. Link with: https://redfishforum.com/thread/190/sensorcollection-contain-all-sensors-chassis All things considered as "sensors" should be included in the Sensor collection. To make this transition as easy as possible for clients, create a new meson option, new-powersubsystem-thermalsubsystem. This "all sensors in the sensor collection" behavior as well as the new ThermalSubsystem, PowerSubsystem, Fans, and Power Supplies schemas will be under this option. This option is defaulted to disabled. At a later time, the default will move to enabled. Move Redfish SensorCollection to show all sensors from /xyz/openbmc_project/sensors with the "all_sensors" association for that chassis if this option is enabled. The SensorCollection is found at /redfish/v1/Chassis/<Id>/Sensors. Tested: 1. Enabled redfish-new-powersubsystem-thermalsubsystem and validator passes. 2. Performance testing (average of 5 times): a. Redfish validator time: without this patch: 71.375s with this patch: 71.763s b. Number of sensors tested: without this patch: 8 with this patch: 63 c. Run `https://${bmc}/redfish/v1/Chassis/chassis/Sensors`: without this patch: 0.197s with this patch: 0.228s Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I2bdddcf616dc72cf0683515c9ab8453bd35eee09
Diffstat (limited to 'redfish-core/lib/sensors.hpp')
-rw-r--r--redfish-core/lib/sensors.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index cb7ea15381..f9d806b89c 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -64,6 +64,14 @@ static const boost::container::flat_map<std::string_view,
{"/xyz/openbmc_project/sensors/power",
"/xyz/openbmc_project/sensors/current",
"/xyz/openbmc_project/sensors/airflow",
+#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
+ "/xyz/openbmc_project/sensors/voltage",
+ "/xyz/openbmc_project/sensors/fan_tach",
+ "/xyz/openbmc_project/sensors/temperature",
+ "/xyz/openbmc_project/sensors/fan_pwm",
+ "/xyz/openbmc_project/sensors/altitude",
+ "/xyz/openbmc_project/sensors/energy",
+#endif
"/xyz/openbmc_project/sensors/utilization"}},
{node::thermal,
{"/xyz/openbmc_project/sensors/fan_tach",