Class HealthReporter
Logic responsible for reporting device health metrics to Meadow.Cloud.
Assembly: Meadow.dll
View Source
Declaration
public class HealthReporter : IHealthReporter
Implements:
Meadow.Cloud.IHealthReporter
Methods
Start(int)
Starts the health reporter based on the desired interval.
View Source
Declaration
public Task Start(int interval)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | interval | In minutes |
AddMetric(string, Func<object>)
Add a custom health metric.
View Source
Declaration
public bool AddMetric(string name, Func<object> func)
Returns
System.Boolean
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Metric name. |
System.Func<System.Object> | func | Function to calculate metric value. |
AddMetric(string, Func<Task<object>>)
Add a custom health metric.
View Source
Declaration
public bool AddMetric(string name, Func<Task<object>> func)
Returns
System.Boolean
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Metric name. |
System.Func<System.Threading.Tasks.Task<System.Object>> | func | Function to calculate the metric value. |
Send()
Can be called to manually send a health report event.
View Source
Declaration
public Task Send()
Returns
System.Threading.Tasks.Task