Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from SonicGD/fix-metric-current-route
Browse files Browse the repository at this point in the history
Fixes #2. Check if curent route metric name was already added to context
  • Loading branch information
alhardy authored Nov 2, 2017
2 parents 8ac415a + f216e78 commit 644440c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ internal static class MetricsHttpContextExtensions

public static void AddMetricsCurrentRouteName(this HttpContext context, string metricName)
{
context.Items.Add(MetricsCurrentRouteName, metricName);
if (!context.Items.ContainsKey(MetricsCurrentRouteName))
{
context.Items.Add(MetricsCurrentRouteName, metricName);
}
}

public static string GetMetricsCurrentRouteName(this HttpContext context)
Expand Down

0 comments on commit 644440c

Please sign in to comment.