Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

C# Tool to Simulate IoT Sensor Telemetry for OpenTSDB

DZone's Guide to

C# Tool to Simulate IoT Sensor Telemetry for OpenTSDB

TSDBWriter is a simpel .NET solution that writes a single metric in a given time range at a configurable sample rate to OpenTSDB. Here is some sample code.

· IoT Zone ·
Free Resource

Download The Comparative Guide to Rules Engines for IoT to learn what are the most common automation technologies used in the IoT domain for application development

tsdbwriter is a simple .NET solution that writes a single metric (e.g. LivingRoom.Temperature, FlowSensor.FlowRate) in a given time range at a configurable sampling rate to OpenTSDB (http://opentsdb.net/). The generated metric value is random within the given range that is specified in the configuration file. For now only analog metrics like temperature, pressure, flow, wind speed, etc. are supported.  Discrete sensors like on/off will be added soon.

For generating a metric stream, simply execute MetricWriter.exe after changing Config.json, a sample of which is below:

{
    "TsdbHostName": "localhost", //the DNS name of the TSDB HOST
    "TsdbPortNumber": "4242",    //TSDB port number; the default is 4242;
    "MetricName": "LivingRoom.Temperature", //any meaningful name
    "StartDate": "01/01/2013", //mandatory
    "EndDate": "01/2/2013",    //if missing, current date will be used
    "SamplingIntervalMinutes": "5", //minutes
    "MetricLow": "65",              //low end of the metric
    "MetricHigh": "85",             //high end of the metric
    "Tags": { "app": "test" }  //comma separated list of name:value pairs
}

The project is located at: https://github.com/hanuk/tsdbwriter.


See how CEP engines, stream processing engines, flow based programming engines and other popular rule-based technologies perform against seven IoT-specific criteria.

Topics:
iot ,c# ,opentsdb

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}