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:21 UTC
[10/20] incubator-trafficcontrol git commit: Rename TM2
getEventDescription to eventDesc
Rename TM2 getEventDescription to eventDesc
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/7a748fe3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/7a748fe3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/7a748fe3
Branch: refs/heads/master
Commit: 7a748fe3a22edd60529e8da94242fbd8f20e9261
Parents: 0d898cc
Author: Robert Butts <ro...@gmail.com>
Authored: Tue Jan 24 11:16:38 2017 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Wed Jan 25 10:29:46 2017 -0700
----------------------------------------------------------------------
.../experimental/traffic_monitor/health/cache.go | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/7a748fe3/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 68f64a7..aec1d8f 100644
--- a/traffic_monitor/experimental/traffic_monitor/health/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/health/cache.go
@@ -122,16 +122,16 @@ func EvalCache(result cache.ResultInfo, resultStats cache.ResultStatValHistory,
switch {
case status == enum.CacheStatusInvalid:
log.Errorf("Cache %v got invalid status from Traffic Ops '%v' - treating as OFFLINE\n", result.ID, serverInfo.Status)
- return false, getEventDescription(status, availability+"; invalid status"), ""
+ return false, eventDesc(status, availability+"; invalid status"), ""
case status == enum.CacheStatusAdminDown:
- return false, getEventDescription(status, availability), ""
+ return false, eventDesc(status, availability), ""
case status == enum.CacheStatusOffline:
log.Errorf("Cache %v set to offline, but still polled\n", result.ID)
- return false, getEventDescription(status, availability), ""
+ return false, eventDesc(status, availability), ""
case status == enum.CacheStatusOnline:
- return true, getEventDescription(status, availability), ""
+ return true, eventDesc(status, availability), ""
case result.Error != nil:
- return false, getEventDescription(status, fmt.Sprintf("%v", result.Error)), ""
+ return false, eventDesc(status, fmt.Sprintf("%v", result.Error)), ""
}
computedStats := cache.ComputedStats()
@@ -162,11 +162,11 @@ func EvalCache(result cache.ResultInfo, resultStats cache.ResultStatValHistory,
}
if !InThreshold(threshold, resultStatNum) {
- return false, getEventDescription(status, ExceedsThresholdMsg(stat, threshold, resultStatNum)), stat
+ return false, eventDesc(status, ExceedsThresholdMsg(stat, threshold, resultStatNum)), stat
}
}
- return result.Available, getEventDescription(status, availability), ""
+ return result.Available, eventDesc(status, availability), ""
}
// ExceedsThresholdMsg returns a human-readable message for why the given value exceeds the threshold. It does NOT check whether the value actually exceeds the threshold; call `InThreshold` to check first.
@@ -205,6 +205,6 @@ func InThreshold(threshold to.HealthThreshold, val float64) bool {
}
}
-func getEventDescription(status enum.CacheStatus, message string) string {
+func eventDesc(status enum.CacheStatus, message string) string {
return fmt.Sprintf("%s - %s", status, message)
}