Database Reference
In-Depth Information
Aggregation
Data for particular time windows are aggregated using any of a number of pre-specified
functions such as average, sum, or minimum.
Interpolation
The time scale of the final results regularized at the end by interpolating as desired to
particular standard intervals. This also ensures that all the data returned have samples at
all of the same points.
Rate conversion
The last step is the optional conversion from counts to rates.
Each of these steps can be controlled via parameters in the URLs of the REST request that
you need to send to the time series daemon (TSD) that is part of Open TSDB.
Working on a Higher Level
While you can use the REST interface directly to access data from Open TSDB, there are
packages in a variety of languages that hide most of the details. Packages are available in R,
Go, and Ruby for accessing data and more languages for pushing data into Open TSDB. A
complete list of packages known to the Open TSDB developers can be found in the Open
TSDB documentation in Appendix A .
As an example of how easy this can make access to Open TSDB data, here is a snippet of
code in R that gets data from a set of metrics and plots them
result <- tsd_get(metric, start, tags = c(site = "*" ),
downsample = "10m-avg" )
library(zoo)
z <- with(result, zoo(value, timestamp))
filtered <- rollapply(z, width = 7 , FUN = median)
plot(merge(z, filtered))
This snippet is taken from the README for the github project . The first line reads the data,
grouping by site and downsampling to 10-minute intervals using an arithmetic average. The
second line converts to a time series data type and computes a rolling median version of the
data. The last line plots the data.
Search WWH ::




Custom Search