Add median* condition

The median condition determines the median value from a configured group
of properties and checks that against a defined condition to determine
whether or not the callback is called.

*Note: When 2 properties are used with the median condition, the
property determined to be the max is used instead of the average of the
2 properties. This is for providing a "worst case" median value.

An example would be to create a group consisting of multiple ambient
sensors where the median value from these ambient sensors would be used
to shutdown the system if above a given temperature.

i.e.)

- name: median temps
  description: >
    'If this condition passes the median ambient temperature
    is too high(>= 45C). Shut the system down.'
  class: condition
  condition: median
  paths: ambient sensors
  properties: ambient temp
  callback: ambient log and shutdown
  op: '>='
  bound: 45000
  oneshot: true

Tested:
    A defined median condition is generated according to the
MedianCondition class
    The MedianCondition class produces a single median value from a
group of property values
    Median value used against the given operation to determine if
callback is called or not

Change-Id: Icd53e1a6e30a263b7706a935f040eea97dcc2414
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
5 files changed