You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2020/11/20 17:44:21 UTC
[trafficcontrol] branch 5.0.x updated: Fix Traffic Monitor Log Spam
(#5309)
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/5.0.x by this push:
new e4e2113 Fix Traffic Monitor Log Spam (#5309)
e4e2113 is described below
commit e4e211363b5dc5a698993da1bca5769d50a615f1
Author: ocket8888 <oc...@apache.org>
AuthorDate: Thu Nov 19 15:26:43 2020 -0700
Fix Traffic Monitor Log Spam (#5309)
* Add Anjuta IDE files to .gitignore
* Add Kate IDE project files to .gitignore
* Fixed TM spamming logs for ADMIN_DOWN cache servers
(cherry picked from commit a2313553db3a5c7b0176e0205eee345854dc695d)
---
.gitignore | 4 ++++
traffic_monitor/health/cache.go | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 54af8de..a07904b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,10 @@ local.tar.gz
.projectile
*.bak
*.iml
+.anjuta/
+.anjuta_sym_db.db
+*.anjuta
+*.kateproject
# built local binaries
./traffic_ops_golang
# Created by TP/TO docker integration tests
diff --git a/traffic_monitor/health/cache.go b/traffic_monitor/health/cache.go
index 208e837..899187f 100644
--- a/traffic_monitor/health/cache.go
+++ b/traffic_monitor/health/cache.go
@@ -87,6 +87,9 @@ func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *tc.Traffic
}
+// EvalCacheWithStatusInfo evaluates whether the given cache should be marked
+// available, taking the server's configured Status into account as well as its
+// polling information.
func EvalCacheWithStatusInfo(result cache.ResultInfo, mc *tc.TrafficMonitorConfigMap, status tc.CacheStatus, serverStatus string) (bool, string, string) {
availability := AvailableStr
if !result.Available {
@@ -143,6 +146,8 @@ func EvalInterface(infVitals map[string]cache.Vitals, inf tc.ServerInterfaceInfo
return true, ""
}
+// EvalAggregate calculates the availability of a cache server as an aggregate
+// of server metrics and metrics of its network interfaces.
func EvalAggregate(result cache.ResultInfo, resultStats *threadsafe.ResultStatValHistory, mc *tc.TrafficMonitorConfigMap) (bool, string, string) {
serverInfo, ok := mc.TrafficServer[string(result.ID)]
if !ok {
@@ -322,7 +327,7 @@ func CalcAvailability(
Ipv6Available: availStatus.Available.IPv6,
})
- if available, ok := localStates.GetCache(tc.CacheName(result.ID)); !ok || !available.IsAvailable || !availStatus.ProcessedAvailable {
+ if available, ok := localStates.GetCache(tc.CacheName(result.ID)); !ok || available.IsAvailable != lastStatus.ProcessedAvailable {
protocol := "IPv4"
if !availStatus.LastCheckedIPv4 {
protocol = "IPv6"