public void MonitorServiceAlive() { string path = $"{TextConstants.PerformanceNodeName}/Service alive"; _logger?.Info($"Initialize {path} sensor..."); NoParamsFuncSensor <bool> aliveSensor = new NoParamsFuncSensor <bool>(path, _productKey, _dataQueue as IValuesQueue, "", TimeSpan.FromSeconds(15), SensorType.BooleanSensor, () => true, _isLogging); AddNewSensor(aliveSensor, path); }
public void MonitorServiceAlive(string specificPath) { var path = $"{specificPath ?? TextConstants.PerformanceNodeName}/{TextConstants.ServiceAlive}"; _logger?.Info($"Initialize {path} sensor..."); NoParamsFuncSensor <bool> aliveSensor = new NoParamsFuncSensor <bool>(path, _productKey, _dataQueue as IValuesQueue, string.Empty, TimeSpan.FromSeconds(15), SensorType.BooleanSensor, () => true, _isLogging); AddNewSensor(aliveSensor, aliveSensor.Path); }
private INoParamsFuncSensor <T> CreateNoParamsFuncSensorInternal <T>(string path, string description, Func <T> function, TimeSpan interval) { var existingSensor = GetExistingSensor(path); var typedSensor = existingSensor as INoParamsFuncSensor <T>; if (typedSensor != null) { return(typedSensor); } NoParamsFuncSensor <T> sensor = new NoParamsFuncSensor <T>(path, _productKey, _dataQueue as IValuesQueue, description, interval, GetSensorType(typeof(T)), function, _isLogging); AddNewSensor(sensor, path); return(sensor); }