hardcoded median function in phosphor-virtual-sensor

Ed Tanous edtanous at google.com
Wed Jan 6 04:31:57 AEDT 2021


On Mon, Jan 4, 2021 at 12:55 PM Vijay Khemka <vijaykhemkalinux at gmail.com> wrote:
>
>
>
> On Mon, Jan 4, 2021 at 9:49 AM Matt Spinler <mspinler at linux.ibm.com> wrote:
>>
>> Hi,
>>
>> Just putting on the list what was decided after some lengthy discussions
>> on discord.
>>
>> I need a median of some sensor values, where this median sensor has
>> threshold interfaces
>> whose values must be defined in entity-manager.  Since exprtk
>> expressions are not allowed in
>> entity-manager, I cannot just port the PVS's JSON config into an
>> entity-manager config.
>>
> I missed this discussion but why can't we simply use virtual sensor as
> expertk provides median function and we have threshold support for
> each virtual sensor. Please help, if I am missing anything.

We had a lengthy discussion on discord the other day (hooray for
having chat history), and previously on your design review for this
feature.  Those two places are probably the best way to get caught up.

>
>>
>> Instead, I will make a new entity-manager config that will have the
>> component sensors
>> along  with the thresholds to use, with a subtype of median, vaguely
>> something like:
>>
>> {
>>
>> Type: "VirtualSensor"
>>
>> Name: "MySensorName"
>>
>> Subtype: "Median"
>>
>> Sensors: [ "Sensor1", "Sensor2", .... ]
>>
>> ThresholdsWithHysteresis [ ]
>>
>> minInput: 0
>>
>> maxInput: 100
>>
>> }
>>
>>
>> The minInput/maxInput are needed so we don't use garbage sensor readings
>> in the median
>> algorithm.  PVS will look for this config to be provided on D-Bus by
>> entity-manager, and if
>> it's there it will calculate the median (in C++, not exprtk) and use it
>> as the virtual sensor value.
>>
>> Thanks,
>> Matt
>>


More information about the openbmc mailing list