You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ne...@apache.org on 2017/01/25 17:30:13 UTC

[02/20] incubator-trafficcontrol git commit: Fix TM2 threshold msg to truncate precision

Fix TM2 threshold msg to truncate precision


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ae137e5a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ae137e5a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ae137e5a

Branch: refs/heads/master
Commit: ae137e5aba5e7dd422ce1aeeac7577370fb282ac
Parents: f9115dc
Author: Robert Butts <ro...@gmail.com>
Authored: Tue Jan 24 14:23:10 2017 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Wed Jan 25 10:29:46 2017 -0700

----------------------------------------------------------------------
 .../experimental/traffic_monitor/health/cache.go          | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ae137e5a/traffic_monitor/experimental/traffic_monitor/health/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/health/cache.go b/traffic_monitor/experimental/traffic_monitor/health/cache.go
index fd3fcec..323d8e0 100644
--- a/traffic_monitor/experimental/traffic_monitor/health/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/health/cache.go
@@ -214,15 +214,15 @@ func setErr(newResult *cache.Result, err error) {
 func exceedsThresholdMsg(stat string, threshold to.HealthThreshold, val float64) string {
 	switch threshold.Comparator {
 	case "=":
-		return fmt.Sprintf("%s not equal (%f != %f)", stat, val, threshold.Val)
+		return fmt.Sprintf("%s not equal (%.2f != %.2f)", stat, val, threshold.Val)
 	case ">":
-		return fmt.Sprintf("%s too low (%f < %f)", stat, val, threshold.Val)
+		return fmt.Sprintf("%s too low (%.2f < %.2f)", stat, val, threshold.Val)
 	case "<":
-		return fmt.Sprintf("%s too high (%f > %f)", stat, val, threshold.Val)
+		return fmt.Sprintf("%s too high (%.2f > %.2f)", stat, val, threshold.Val)
 	case ">=":
-		return fmt.Sprintf("%s too low (%f <= %f)", stat, val, threshold.Val)
+		return fmt.Sprintf("%s too low (%.2f <= %.2f)", stat, val, threshold.Val)
 	case "<=":
-		return fmt.Sprintf("%s too high (%f >= %f)", stat, val, threshold.Val)
+		return fmt.Sprintf("%s too high (%.2f >= %.2f)", stat, val, threshold.Val)
 	default:
 		return fmt.Sprintf("ERROR: Invalid Threshold: %+v", threshold)
 	}