Skip to content

Commit

Permalink
updated code to use APIVersion variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Studer committed Aug 4, 2016
1 parent 75f685d commit fde7d84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions VTMAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void PollGlobal()
}

// Get Global Statistics and report to New Relic
GlobalStatistics globalStats = VTM.fetchVTMObject<GlobalStatObject>("/api/tm/3.3/status/local_tm/statistics/globals").statistics;
GlobalStatistics globalStats = VTM.fetchVTMObject<GlobalStatObject>($"/api/tm/{APIVersion}/status/local_tm/statistics/globals").statistics;

// Calculate System Memory Percent Used
float systemMemoryPercentUsed = (((float)globalStats.sys_mem_in_use) / (globalStats.sys_mem_total))*100;
Expand All @@ -95,7 +95,7 @@ private void PollPool()
{
try
{
Children pools = VTM.fetchVTMObject<Children>("/api/tm/3.3/status/local_tm/statistics/pools");
Children pools = VTM.fetchVTMObject<Children>($"/api/tm/{APIVersion}/status/local_tm/statistics/pools");

foreach (var pool in pools.children)
{
Expand Down Expand Up @@ -124,7 +124,7 @@ private void PollPool()

private void PollNodes()
{
Children nodes = VTM.fetchVTMObject<Children>("/api/tm/3.3/status/local_tm/statistics/nodes/node");
Children nodes = VTM.fetchVTMObject<Children>($"/api/tm/{APIVersion}/status/local_tm/statistics/nodes/node");

foreach (var node in nodes.children)
{
Expand Down Expand Up @@ -156,7 +156,7 @@ private void PollVirtualServer()
{
try
{
Children virtualServers = VTM.fetchVTMObject<Children>("/api/tm/3.3/status/local_tm/statistics/virtual_servers");
Children virtualServers = VTM.fetchVTMObject<Children>($"/api/tm/{APIVersion}/status/local_tm/statistics/virtual_servers");

foreach (var virtualServer in virtualServers.children)
{
Expand Down

0 comments on commit fde7d84

Please sign in to comment.