Add PerformanceLoss threshold checking

This xyz.openbmc_project.Sensor.Threshold.PerformanceLoss interface will
be checked along with the other threshold interfaces.  It can be used to
indicate the system will suffer a performance loss when the sensor goes
above/below the high/low threshold values.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I855aaf6ea550e672bf52af5631533049269934d1
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index a67077b..b74f0d3 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -132,6 +132,20 @@
             softShutdownIface->softShutdownLow(threshold.value(
                 "SoftShutdownLow", std::numeric_limits<double>::quiet_NaN()));
         }
+
+        if (threshold.contains("PerformanceLossHigh") ||
+            threshold.contains("PerformanceLossLow"))
+        {
+            perfLossIface = std::make_unique<Threshold<PerformanceLossObject>>(
+                bus, objPath.c_str());
+
+            perfLossIface->performanceLossHigh(
+                threshold.value("PerformanceLossHigh",
+                                std::numeric_limits<double>::quiet_NaN()));
+            perfLossIface->performanceLossLow(
+                threshold.value("PerformanceLossLow",
+                                std::numeric_limits<double>::quiet_NaN()));
+        }
     }
 
     /* Get expression string */
@@ -248,6 +262,7 @@
         std::cout << "Sensor value is " << val << "\n";
 
     /* Check sensor thresholds and log required message */
+    checkThresholds(val, perfLossIface);
     checkThresholds(val, warningIface);
     checkThresholds(val, criticalIface);
     checkThresholds(val, softShutdownIface);