commit | 928fefb9a542b816d7c0418077def2b3874d1b0f | [log] [tgz] |
---|---|---|
author | Nan Zhou <nanzhoumails@gmail.com> | Mon Mar 28 08:45:00 2022 -0700 |
committer | Nan Zhou <nanzhoumails@gmail.com> | Mon Apr 11 15:42:31 2022 +0000 |
tree | fbbf2c8924b3ffbab4159ce54b9a7c3f1b7e71c6 | |
parent | a6b9125ff91500afed34dc923e9bafb90da75ec4 [diff] |
sensor collection: implement efficient expand handler This change adds an efficient expand handler for $levels=1 expand at the sensors collection. Instead of Query one sensor at time, it reuses existing codes for Thermal and Power (which has AutoExpand), and queries the whole sensor at one query. It's more efficient than the default expand handler as well since the default handler stills query all the sensors and filter other sensors when querying a single sensor. Performance improves dramatically on a real hardware with 220+ sensors: Before this change, time wget -qO- 'http://localhost/redfish/v1/Chassis/xxx/Sensors?$expand=.($levels=1)' > /tmp/log_slow.json real 0m33.786s user 0m0.000s sys 0m0.000s After this change time wget -qO- 'http://localhost/redfish/v1/Chassis/xxx/Sensors?$expand=.($levels=1)' > /tmp/log_fast.json real 0m0.769s user 0m0.010s sys 0m0.010s TESTED:: 1. QEMU Redfish/IPMI passed 2. Validator passed (though it doesn't support query paramters) 3. Tested on real hardware. { "@odata.id": "/redfish/v1/Chassis/xxx/Sensors", "@odata.type": "#SensorCollection.SensorCollection", "Description": "Collection of Sensors for this Chassis", "Members": [ { "@odata.id": "/redfish/v1/Chassis/xxx/Sensors/abc", "@odata.type": "#Sensor.v1_0_0.Sensor", "Id": "abc", "Name": "abc", "Reading": 3.133, "ReadingRangeMax": 5.8500060148599005, "ReadingRangeMin": 0.0, "ReadingType": "Voltage", "ReadingUnits": "V", "Status": { "Health": "OK", "State": "Enabled" }, "Thresholds": { "LowerCritical": { "Reading": 2.205 }, "UpperCritical": { "Reading": 3.507 } } }, ], "Members@odata.count": 225, "Name": "Sensors" } Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I745a31d6fe8d0aac08d532ea976bfc1a4a40b19c
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja -C builddir test ninja -C builddir coverage
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.