Skip to main content

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
TypeNameDescription
System.Int32intervalIn 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
TypeNameDescription
System.StringnameMetric name.
System.Func<System.Object>funcFunction 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
TypeNameDescription
System.StringnameMetric name.
System.Func<System.Threading.Tasks.Task<System.Object>>funcFunction 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

Implements