Skip to content

Commit

Permalink
Merge pull request #222 from WildernessLabs/custom_health_metric
Browse files Browse the repository at this point in the history
add AddMetric(...) to IHealthReporter
  • Loading branch information
ctacke committed May 1, 2024
2 parents 59f0450 + b08df99 commit 95964a9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Source/Meadow.Contracts/Cloud/IHealthReporter.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Threading.Tasks;

namespace Meadow.Cloud;
Expand All @@ -18,4 +19,20 @@ public interface IHealthReporter
/// </summary>
/// <returns></returns>
Task Send();

/// <summary>
/// Add a custom health metric.
/// </summary>
/// <param name="name">Metric name.</param>
/// <param name="func">Function to calculate metric value.</param>
/// <returns></returns>
bool AddMetric(string name, Func<object> func);

/// <summary>
/// Add a custom health metric.
/// </summary>
/// <param name="name">Metric name.</param>
/// <param name="func">Function to calculate the metric value.</param>
/// <returns></returns>
bool AddMetric(string name, Func<Task<object>> func);
}

0 comments on commit 95964a9

Please sign in to comment.