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/02/09 16:55:14 UTC

[1/3] incubator-trafficcontrol git commit: [TC-143] Only omitempty on notAvailable to preserve existing structures.

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master b2fa70bdb -> b310e4fe5


[TC-143] Only omitempty on notAvailable to preserve existing structures.


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

Branch: refs/heads/master
Commit: f7889ea30e0a03115cef46fa5fc80dafb392fbd9
Parents: 27343ed
Author: Jeff Elsloo <je...@cable.comcast.com>
Authored: Thu Feb 9 08:57:49 2017 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Thu Feb 9 09:54:25 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f7889ea3/traffic_monitor_golang/traffic_monitor/cache/astats.go
----------------------------------------------------------------------
diff --git a/traffic_monitor_golang/traffic_monitor/cache/astats.go b/traffic_monitor_golang/traffic_monitor/cache/astats.go
index 58cdfb3..fb56454 100644
--- a/traffic_monitor_golang/traffic_monitor/cache/astats.go
+++ b/traffic_monitor_golang/traffic_monitor/cache/astats.go
@@ -35,11 +35,11 @@ type AstatsSystem struct {
 	InfSpeed          int    `json:"inf.speed"`
 	ProcNetDev        string `json:"proc.net.dev"`
 	ProcLoadavg       string `json:"proc.loadavg"`
-	ConfigLoadRequest int    `json:"configReloadRequests,omitempty"`
-	LastReloadRequest int    `json:"lastReloadRequest,omitempty"`
-	ConfigReloads     int    `json:"configReloads,omitempty"`
-	LastReload        int    `json:"lastReload,omitempty"`
-	AstatsLoad        int    `json:"astatsLoad,omitempty"`
+	ConfigLoadRequest int    `json:"configReloadRequests"`
+	LastReloadRequest int    `json:"lastReloadRequest"`
+	ConfigReloads     int    `json:"configReloads"`
+	LastReload        int    `json:"lastReload"`
+	AstatsLoad        int    `json:"astatsLoad"`
 	NotAvailable      bool   `json:"notAvailable,omitempty"`
 }
 


[2/3] incubator-trafficcontrol git commit: [TC-143] Add support in the golang version of Traffic Monitor for consuming and acting upon system.notAvailable.

Posted by ne...@apache.org.
[TC-143] Add support in the golang version of Traffic Monitor for consuming and acting upon system.notAvailable.


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

Branch: refs/heads/master
Commit: 27343ede3dec6bb1129df84458a501a2b421b732
Parents: b2fa70b
Author: Jeff Elsloo <je...@cable.comcast.com>
Authored: Wed Feb 8 14:00:44 2017 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Thu Feb 9 09:54:25 2017 -0700

----------------------------------------------------------------------
 .../traffic_monitor/cache/astats.go                 | 16 ++++++++--------
 .../traffic_monitor/cache/astats.json               |  1 +
 .../traffic_monitor/cache/cache.go                  |  3 +++
 .../traffic_monitor/health/cache.go                 |  2 ++
 4 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/27343ede/traffic_monitor_golang/traffic_monitor/cache/astats.go
----------------------------------------------------------------------
diff --git a/traffic_monitor_golang/traffic_monitor/cache/astats.go b/traffic_monitor_golang/traffic_monitor/cache/astats.go
index 96258c8..58cdfb3 100644
--- a/traffic_monitor_golang/traffic_monitor/cache/astats.go
+++ b/traffic_monitor_golang/traffic_monitor/cache/astats.go
@@ -8,9 +8,9 @@ package cache
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,7 +19,6 @@ package cache
  * under the License.
  */
 
-
 import (
 	"encoding/json"
 )
@@ -36,11 +35,12 @@ type AstatsSystem struct {
 	InfSpeed          int    `json:"inf.speed"`
 	ProcNetDev        string `json:"proc.net.dev"`
 	ProcLoadavg       string `json:"proc.loadavg"`
-	ConfigLoadRequest int    `json:"configReloadRequests"`
-	LastReloadRequest int    `json:"lastReloadRequest"`
-	ConfigReloads     int    `json:"configReloads"`
-	LastReload        int    `json:"lastReload"`
-	AstatsLoad        int    `json:"astatsLoad"`
+	ConfigLoadRequest int    `json:"configReloadRequests,omitempty"`
+	LastReloadRequest int    `json:"lastReloadRequest,omitempty"`
+	ConfigReloads     int    `json:"configReloads,omitempty"`
+	LastReload        int    `json:"lastReload,omitempty"`
+	AstatsLoad        int    `json:"astatsLoad,omitempty"`
+	NotAvailable      bool   `json:"notAvailable,omitempty"`
 }
 
 // Unmarshal unmarshalls the given bytes, which must be JSON Astats data, into an Astats object.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/27343ede/traffic_monitor_golang/traffic_monitor/cache/astats.json
----------------------------------------------------------------------
diff --git a/traffic_monitor_golang/traffic_monitor/cache/astats.json b/traffic_monitor_golang/traffic_monitor/cache/astats.json
index df0e9d7..db0b0f8 100644
--- a/traffic_monitor_golang/traffic_monitor/cache/astats.json
+++ b/traffic_monitor_golang/traffic_monitor/cache/astats.json
@@ -526,6 +526,7 @@
    "configReloads": 9,
    "lastReload": 4703274272,
    "astatsLoad": 4703274272,
+   "notAvailable": false,
 "something": "here"
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/27343ede/traffic_monitor_golang/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor_golang/traffic_monitor/cache/cache.go b/traffic_monitor_golang/traffic_monitor/cache/cache.go
index aa2ac6a..b90a3f3 100644
--- a/traffic_monitor_golang/traffic_monitor/cache/cache.go
+++ b/traffic_monitor_golang/traffic_monitor/cache/cache.go
@@ -201,6 +201,9 @@ func ComputedStats() map[string]StatComputeFunc {
 		"system.lastReloadRequest": func(info ResultInfo, serverInfo to.TrafficServer, serverProfile to.TMProfile, combinedState peer.IsAvailable) interface{} {
 			return info.System.LastReloadRequest
 		},
+		"system.notAvailable": func(info ResultInfo, serverInfo to.TrafficServer, serverProfile to.TMProfile, combinedState peer.IsAvailable) interface{} {
+			return info.System.NotAvailable
+		},
 		"system.proc.loadavg": func(info ResultInfo, serverInfo to.TrafficServer, serverProfile to.TMProfile, combinedState peer.IsAvailable) interface{} {
 			return info.System.ProcLoadavg
 		},

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/27343ede/traffic_monitor_golang/traffic_monitor/health/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor_golang/traffic_monitor/health/cache.go b/traffic_monitor_golang/traffic_monitor/health/cache.go
index 552157d..94be59f 100644
--- a/traffic_monitor_golang/traffic_monitor/health/cache.go
+++ b/traffic_monitor_golang/traffic_monitor/health/cache.go
@@ -131,6 +131,8 @@ func EvalCache(result cache.ResultInfo, resultStats cache.ResultStatValHistory,
 		return true, eventDesc(status, availability), ""
 	case result.Error != nil:
 		return false, eventDesc(status, fmt.Sprintf("%v", result.Error)), ""
+	case result.System.NotAvailable == true:
+		return false, eventDesc(status, fmt.Sprintf("system.notAvailable == %v", result.System.NotAvailable)), ""
 	}
 
 	computedStats := cache.ComputedStats()


[3/3] incubator-trafficcontrol git commit: This closes #265

Posted by ne...@apache.org.
This closes #265


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

Branch: refs/heads/master
Commit: b310e4fe568e926f6bf518bf82f91390933062f0
Parents: f7889ea
Author: Dave Neuman <ne...@apache.org>
Authored: Thu Feb 9 09:54:48 2017 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Thu Feb 9 09:54:48 2017 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------