node-rrdtool
Usage
var rrdtool = ; var start = rrdtool - 10;var db = rrdtool; db;db;db;db;db;db;db;db;db;db; db;
API
rrdtool
.create(file, opts, args)
Creates a new database.
file
: Filename where to save the dbopts
step
: Seconds between each updatestart
: Unix timestamp of the first data pointforce
: Overwrite file if it exists
args
: Array of Data Sources and Round Robin Archives
.open(file)
Loads an existing database.
file
: Filename of the db
.now()
Returns the current unix timestamp
DB
.update([ts, ]values[, cb])
Insert data into the database.
ts
: Unix timestamp of the datavalues
: Object with one entry per data source to insert intocb
: Callback to call when the data is inserted(err)
.fetch(cf, start, stop[, res], cb)
Fetch a span of data from the database.
cf
: Consolidation function (AVERAGE
,MIN
,MAX
,LAST
)start
: Unix timestamp from where to startstop
: Unix timestamp of which to stop atres
: Resolution of the data, specified in secondscb
: Callback to call when the data is ready(err, data)