Skip to content

Commit

Permalink
Clear up metrics obsolete build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Feb 14, 2024
1 parent 48ba693 commit eb5b42d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Foundatio/Metrics/DiagnosticsMetricsClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Diagnostics.Metrics;
#pragma warning disable 612, 618

namespace Foundatio.Metrics;

Expand Down Expand Up @@ -57,3 +58,5 @@ public GaugeInfo(Meter meter, string name)
public double Value { get; set; }
}
}

#pragma warning restore 612, 618
6 changes: 5 additions & 1 deletion src/Foundatio/Metrics/IMetricsClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#pragma warning disable 612, 618

using System;
using System.Threading.Tasks;
using Foundatio.Utility;

Expand Down Expand Up @@ -42,3 +44,5 @@ public static async Task<T> TimeAsync<T>(this IMetricsClient client, Func<Task<T
return await func().AnyContext();
}
}

#pragma warning restore 612, 618
7 changes: 6 additions & 1 deletion src/Foundatio/Metrics/MetricTimer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#pragma warning disable 612, 618

using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Foundatio.Utility;
Expand Down Expand Up @@ -29,3 +31,6 @@ public void Dispose()
_client.Timer(_name, (int)_stopWatch.ElapsedMilliseconds);
}
}

#pragma warning restore 612, 618

6 changes: 5 additions & 1 deletion src/Foundatio/Metrics/NullMetricsClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Threading.Tasks;
#pragma warning disable 612, 618

using System.Threading.Tasks;

namespace Foundatio.Metrics;

Expand All @@ -10,3 +12,5 @@ public void Gauge(string name, double value) { }
public void Timer(string name, int milliseconds) { }
public void Dispose() { }
}

#pragma warning restore 612, 618

0 comments on commit eb5b42d

Please sign in to comment.