From bff298d47cb8c6ca222ba2ba423d56ff6dfabd93 Mon Sep 17 00:00:00 2001 From: Mark Studer Date: Tue, 20 Oct 2015 19:32:05 -0600 Subject: [PATCH] Moving try catch inside node loop and adding additional context to failure error. Nodes without data will return 400 errors this change allows other nodes to be collected without issue. --- VTMAgent.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/VTMAgent.cs b/VTMAgent.cs index a59840f..d42d92e 100644 --- a/VTMAgent.cs +++ b/VTMAgent.cs @@ -120,12 +120,12 @@ private void PollPool() private void PollNodes() { - try - { - Children nodes = VTM.fetchVTMObject("/api/tm/3.3/status/local_tm/statistics/nodes/node"); + Children nodes = VTM.fetchVTMObject("/api/tm/3.3/status/local_tm/statistics/nodes/node"); - foreach (var node in nodes.children) - { + foreach (var node in nodes.children) + { + try + { // Setup new EpochProcessors for each Node // Check for existance of first Dictionary Item for the Node if (!processors.ContainsKey("node_" + node.name + "_errors")) @@ -141,10 +141,10 @@ private void PollNodes() ReportMetric("nodes/" + node.name + "/current_conn", "connections", nodeStats.current_conn); ReportMetric("nodes/" + node.name + "/current_requests", "requests", nodeStats.current_requests); } - } - catch - { - log.Error("Unable to fetch Node information from the Virtual Traffic Manager '{0}'", this.name); + catch + { + log.Error("Unable to fetch Node information from the Virtual Traffic Manager '{0}' for Node: '{1}'", this.name, node.name); + } } }