starting server

docker run -p 8000:8000 -it jptmoore/nibbledb --enable-tls

adding data

Values are floats which can optionally be tagged with extra information. If no timestamp is provided it will be automatically generated as an epoch in millisecond precision.
curl -k --request POST --data '[{"value": 1}, {"value": 2}, {"value": 3}, {"value": 4}, {"value": 5}]' https://localhost:8000/ts/foo
curl -k --request POST --data '[{"value": 10}, {"value": 20}, {"value": 30}, {"value": 40}, {"value": 50}]' https://localhost:8000/ts/bar
curl -k --request POST --data '[{"colour":"red", "value": 1}, {"colour":"blue", "value": 2}, {"colour":"green", "value": 3}, {"colour":"red", "value": 4}, {"colour":"red", "value": 5}]' https://localhost:8000/ts/baz
curl -k --request POST --data '[{"timestamp":1, "value": 100}, {"timestamp":2, "value": 200}, {"timestamp":3, "value": 300}, {"timestamp":4, "value": 400}, {"timestamp":5, "value": 500}]' https://localhost:8000/ts/boz

retrieving data

A typical request to obtain the last n values
curl -k https://localhost:8000/ts/foo/last/3
Finding the combined length of two time series
curl -k https://localhost:8000/ts/foo,bar/length
A range query from a specific point in time
curl -k https://localhost:8000/ts/boz/since/4
A query which filters the result based on matching tagged values and then applies an aggregation function
curl -k https://localhost:8000/ts/baz/last/5/filter/colour/equals/red/count
A query across a time range
curl -k https://localhost:8000/ts/boz/range/3/5
Statistical analysis across different time series
curl -k https://localhost:8000/ts/foo,bar,baz,boz/last/5/sd
Other functions that can be used in above example are: sum,max,min,mean,median,count.

deleting data

The delete API supports range querying across multiple time series with support for filtering
curl -k --request DELETE https://localhost:8000/ts/baz/since/0/filter/colour/contains/re
curl -k https://localhost:8000/ts/baz/since/0

General info

To obtain the current list of time series available
curl -k https://localhost:8000/info/ts/names
To get stats on current time series
curl -k https://localhost:8000/info/ts/stats

performance data

Finding the number of values of a time series held in memory
curl -k https://localhost:8000/ts/foo/memory/length
Finding the number of values of a time series held on disk
curl -k https://localhost:8000/ts/foo/disk/length
Finding the length of an index
curl -k https://localhost:8000/ts/foo/index/length


Flushing the memory of all time series to disk
curl -k https://localhost:8000/ctl/ts/sync
curl -k https://localhost:8000/ts/foo,bar,baz,boz/memory/length