0.6.0 • Published 10 years ago

dash-client v0.6.0

Weekly downloads
8
License
Apache License 2....
Repository
github
Last release
10 years ago

Dash Client

This Dash Client can be used to add data to a Dash Server.

It can be used as

Simple run

//Setup runner
var Runner = new require('dash-client').Runner;
var runner = new Runner({ url : 'http://your-dash-url'});

//Add tasks
runner.addTask('context', 'entity', function(lastTimestamp, cb) {
  console.log("The last data in dash for the context", context ,"and entity", entity, "is: ", lastTimestamp);
  
  //Call the callback with an Array of the data that should be added to Dash (conform to the dash specified format)
  cb([{
    key : 'OVER',
    value : 9000,
    timestamp : new Date().getTime()
  }]);
});

//Start
runner.start();

Cron

You can add the cron option to the start function to make the Runner execute as a cron and use the intervals.

var myTask = function(lastTimestamp, cb) {
	...
};

//Add a task with an interval of 5 minutes
runner.addTask('context', 'entity', myTask, { interval : 300});

//Start the runner as cron
runner.start({cron : true});
0.6.0

10 years ago

0.5.0

10 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago