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

Discover why Bluetooth mesh is the next evolution of IoT solutions. Download the mesh overview.

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.


Take a deep dive into Bluetooth mesh. Read the tech overview and discover new IoT innovations.

Topics:
iot ,c# ,opentsdb

Published at DZone with permission of Hanu Kommalapati, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}