Skip to content

Commit

Permalink
Moving try catch inside node loop and adding additional context to fa…
Browse files Browse the repository at this point in the history
…ilure error. Nodes without data will return 400 errors this change allows other nodes to be collected without issue.
  • Loading branch information
Mark Studer committed Oct 21, 2015
1 parent 78f9d63 commit bff298d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions VTMAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ private void PollPool()

private void PollNodes()
{
try
{
Children nodes = VTM.fetchVTMObject<Children>("/api/tm/3.3/status/local_tm/statistics/nodes/node");
Children nodes = VTM.fetchVTMObject<Children>("/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"))
Expand All @@ -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);
}
}
}

Expand Down

0 comments on commit bff298d

Please sign in to comment.