| read_rra | R Documentation |
Finds the RRA (round robin array) that best matches the consolidation function and the step and imports all values (from all data stores) in that RRA that are between timestamp start and end. Note that start is not included in the result.
Returns a data.frame object having the timestamp and the data stores as columns. The data store names are retrieved from the RRD file and set as the corresponding column names. The timestamps are also used as row names.
read_rra(filename, cf, step, n_steps, start, end = Sys.time())
filename |
File name |
cf |
The consolidation function that is applied to the data you want to fetch. Must be one of |
step |
step |
n_steps |
number of steps to return |
start |
start time |
end |
end time, defaults to the current system time |
The filename, cf (consolidation function) and step arguments uniquely identify an RRA array in the RRD file.
The arguments start and end define the time-slice to be retrieved. Note that start is not included in the result. Refer to the documentation for rrdfetch for more information.
The returned data.frame has the timestamp and the data stores as separate columns. The names of the data sources are extracted from the RRD file and set as column names. The timestamps are also used as row names.
Other rrd functions:
describe_rrd(),
read_rrd()
rrd_cpu_0 <- system.file("extdata/cpu-0.rrd", package = "rrd")
# Note that the default end time is the current time (Sys.time())
# However, since the sample data is historic, specify the end time
start_time <- as.POSIXct("2018-05-01") # timestamp with data in example
end_time <- as.POSIXct("2018-05-02") # timestamp with data in example
# read archive by specifying start time
avg_60 <- read_rra(rrd_cpu_0, cf = "AVERAGE", step = 60L,
start = start_time,
end = end_time)
names(avg_60)
head(avg_60)
tail(avg_60)
# read archive by specifying number of rows to retrieve
avg_60 <- read_rra(rrd_cpu_0, cf = "AVERAGE", step = 60L,
n_steps = 5,
end = end_time)
names(avg_60)
avg_60
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.