From 85aed364b76b65c4451bbb4bae76ecd15f5c7f6a Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 25 Jun 2014 15:02:04 +0200 Subject: [PATCH] Fix typing error in 'threshold' --- .../application/views/helpers/Perfdata.php | 4 ++-- .../library/Monitoring/Plugin/Perfdata.php | 20 ++++++++--------- .../Monitoring/Plugin/PerfdataTest.php | 22 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/monitoring/application/views/helpers/Perfdata.php b/modules/monitoring/application/views/helpers/Perfdata.php index 72d99c574..74fec2f6b 100644 --- a/modules/monitoring/application/views/helpers/Perfdata.php +++ b/modules/monitoring/application/views/helpers/Perfdata.php @@ -61,9 +61,9 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract $gray = $unusedValue; $green = $orange = $red = 0; // TODO(#6122): Add proper treshold parsing. - if ($perfdata->getCriticalTreshold() && $perfdata->getValue() > $perfdata->getCriticalTreshold()) { + if ($perfdata->getCriticalThreshold() && $perfdata->getValue() > $perfdata->getCriticalThreshold()) { $red = $usedValue; - } elseif ($perfdata->getWarningTreshold() && $perfdata->getValue() > $perfdata->getWarningTreshold()) { + } elseif ($perfdata->getWarningThreshold() && $perfdata->getValue() > $perfdata->getWarningThreshold()) { $orange = $usedValue; } else { $green = $usedValue; diff --git a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php index f01880885..a23c60392 100644 --- a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php +++ b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php @@ -44,18 +44,18 @@ class Perfdata protected $maxValue; /** - * The WARNING treshold + * The WARNING threshold * * @var string */ - protected $warningTreshold; + protected $warningThreshold; /** - * The CRITICAL treshold + * The CRITICAL threshold * * @var string */ - protected $criticalTreshold; + protected $criticalThreshold; /** * Create a new Perfdata object based on the given performance data value @@ -180,9 +180,9 @@ class Perfdata * * @return null|string */ - public function getWarningTreshold() + public function getWarningThreshold() { - return $this->warningTreshold; + return $this->warningThreshold; } /** @@ -190,9 +190,9 @@ class Perfdata * * @return null|string */ - public function getCriticalTreshold() + public function getCriticalThreshold() { - return $this->criticalTreshold; + return $this->criticalThreshold; } /** @@ -240,10 +240,10 @@ class Perfdata $this->minValue = self::convert($parts[3], $this->unit); case 3: // TODO(#6123): Tresholds have the same UOM and need to be converted as well! - $this->criticalTreshold = trim($parts[2]) ? trim($parts[2]) : null; + $this->criticalThreshold = trim($parts[2]) ? trim($parts[2]) : null; case 2: // TODO(#6123): Tresholds have the same UOM and need to be converted as well! - $this->warningTreshold = trim($parts[1]) ? trim($parts[1]) : null; + $this->warningThreshold = trim($parts[1]) ? trim($parts[1]) : null; } } diff --git a/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php b/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php index 9bb32ffd8..be1de875e 100644 --- a/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php +++ b/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php @@ -61,27 +61,27 @@ class PerfdataTest extends BaseTestCase { $this->assertEquals( '10', - Perfdata::fromString('1;10')->getWarningTreshold(), + Perfdata::fromString('1;10')->getWarningThreshold(), 'Perfdata::getWarningTreshold does not return correct values' ); $this->assertEquals( '10:', - Perfdata::fromString('1;10:')->getWarningTreshold(), + Perfdata::fromString('1;10:')->getWarningThreshold(), 'Perfdata::getWarningTreshold does not return correct values' ); $this->assertEquals( '~:10', - Perfdata::fromString('1;~:10')->getWarningTreshold(), + Perfdata::fromString('1;~:10')->getWarningThreshold(), 'Perfdata::getWarningTreshold does not return correct values' ); $this->assertEquals( '10:20', - Perfdata::fromString('1;10:20')->getWarningTreshold(), + Perfdata::fromString('1;10:20')->getWarningThreshold(), 'Perfdata::getWarningTreshold does not return correct values' ); $this->assertEquals( '@10:20', - Perfdata::fromString('1;@10:20')->getWarningTreshold(), + Perfdata::fromString('1;@10:20')->getWarningThreshold(), 'Perfdata::getWarningTreshold does not return correct values' ); } @@ -90,27 +90,27 @@ class PerfdataTest extends BaseTestCase { $this->assertEquals( '10', - Perfdata::fromString('1;;10')->getCriticalTreshold(), + Perfdata::fromString('1;;10')->getCriticalThreshold(), 'Perfdata::getCriticalTreshold does not return correct values' ); $this->assertEquals( '10:', - Perfdata::fromString('1;;10:')->getCriticalTreshold(), + Perfdata::fromString('1;;10:')->getCriticalThreshold(), 'Perfdata::getCriticalTreshold does not return correct values' ); $this->assertEquals( '~:10', - Perfdata::fromString('1;;~:10')->getCriticalTreshold(), + Perfdata::fromString('1;;~:10')->getCriticalThreshold(), 'Perfdata::getCriticalTreshold does not return correct values' ); $this->assertEquals( '10:20', - Perfdata::fromString('1;;10:20')->getCriticalTreshold(), + Perfdata::fromString('1;;10:20')->getCriticalThreshold(), 'Perfdata::getCriticalTreshold does not return correct values' ); $this->assertEquals( '@10:20', - Perfdata::fromString('1;;@10:20')->getCriticalTreshold(), + Perfdata::fromString('1;;@10:20')->getCriticalThreshold(), 'Perfdata::getCriticalTreshold does not return correct values' ); } @@ -147,7 +147,7 @@ class PerfdataTest extends BaseTestCase { $perfdata = Perfdata::fromString('1;;3;5'); $this->assertNull( - $perfdata->getWarningTreshold(), + $perfdata->getWarningThreshold(), 'Perfdata objects do not return null for missing warning tresholds' ); $this->assertNull(