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:26 UTC
[15/20] incubator-trafficcontrol git commit: Rename TM2 setError to
setErr
Rename TM2 setError to setErr
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/cc10a02f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/cc10a02f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/cc10a02f
Branch: refs/heads/master
Commit: cc10a02faed08d8804438cce1be4ff2e116c5ab8
Parents: 3db9dd7
Author: Robert Butts <ro...@gmail.com>
Authored: Tue Jan 24 10:44:41 2017 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Wed Jan 25 10:29:46 2017 -0700
----------------------------------------------------------------------
.../experimental/traffic_monitor/health/cache.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cc10a02f/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 0a00838..68f64a7 100644
--- a/traffic_monitor/experimental/traffic_monitor/health/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/health/cache.go
@@ -31,7 +31,7 @@ import (
to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
)
-func setError(newResult *cache.Result, err error) {
+func setErr(newResult *cache.Result, err error) {
newResult.Error = err
newResult.Available = false
}
@@ -48,12 +48,12 @@ func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *to.Traffic
if len(loadAverages) > 0 {
oneMinAvg, err := strconv.ParseFloat(loadAverages[0], 64)
if err != nil {
- setError(newResult, fmt.Errorf("Error converting load average string '%s': %v", newResult.Astats.System.ProcLoadavg, err))
+ setErr(newResult, fmt.Errorf("Error converting load average string '%s': %v", newResult.Astats.System.ProcLoadavg, err))
return
}
newResult.Vitals.LoadAvg = oneMinAvg
} else {
- setError(newResult, fmt.Errorf("Can't make sense of '%s' as a load average for %s", newResult.Astats.System.ProcLoadavg, newResult.ID))
+ setErr(newResult, fmt.Errorf("Can't make sense of '%s' as a load average for %s", newResult.Astats.System.ProcLoadavg, newResult.ID))
return
}
@@ -67,12 +67,12 @@ func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *to.Traffic
var err error
newResult.Vitals.BytesOut, err = strconv.ParseInt(numbers[8], 10, 64)
if err != nil {
- setError(newResult, fmt.Errorf("Error converting BytesOut from procnetdev: %v", err))
+ setErr(newResult, fmt.Errorf("Error converting BytesOut from procnetdev: %v", err))
return
}
newResult.Vitals.BytesIn, err = strconv.ParseInt(numbers[0], 10, 64)
if err != nil {
- setError(newResult, fmt.Errorf("Error converting BytesIn from procnetdev: %v", err))
+ setErr(newResult, fmt.Errorf("Error converting BytesIn from procnetdev: %v", err))
return
}
if prevResult != nil && prevResult.Vitals.BytesOut != 0 {
@@ -82,7 +82,7 @@ func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *to.Traffic
// log.Infoln("prevResult == nil for id " + newResult.Id + ". Hope we're just starting up?")
}
} else {
- setError(newResult, fmt.Errorf("Error parsing procnetdev: no fields found"))
+ setErr(newResult, fmt.Errorf("Error parsing procnetdev: no fields found"))
return
}