Skip to contents

Reads the metadata in the RRD and adjusts the parameters accordingly in order to expose all RRAs in their entirety.

Usage

read_rrd(filename)

Arguments

filename

File name

Value

Returns a named list of data.frames. Each data frame corresponds to an RRA (see read_rra()). The list has names constructed as "consolidation function" + "step" - e.g. "AVERAGE15".

See also

Other rrd functions: describe_rrd(), read_rra()

Examples

rrd_cpu_0 <- system.file("extdata/cpu-0.rrd", package = "rrd")

describe_rrd(rrd_cpu_0)
#> An RRD file with 10 RRA arrays and step size 60
#> [1] AVERAGE_60 (43200 rows)
#> [2] AVERAGE_300 (25920 rows)
#> [3] MIN_300 (25920 rows)
#> [4] MAX_300 (25920 rows)
#> [5] AVERAGE_3600 (8760 rows)
#> [6] MIN_3600 (8760 rows)
#> [7] MAX_3600 (8760 rows)
#> [8] AVERAGE_86400 (1825 rows)
#> [9] MIN_86400 (1825 rows)
#> [10] MAX_86400 (1825 rows)

cpu <- read_rrd(rrd_cpu_0)
names(cpu)
#>  [1] "AVERAGE60"    "AVERAGE300"   "MIN300"       "MAX300"       "AVERAGE3600" 
#>  [6] "MIN3600"      "MAX3600"      "AVERAGE86400" "MIN86400"     "MAX86400"    
head(cpu[[1]])
#> # A tibble: 6 × 9
#>   timestamp              user     sys  nice  idle  wait   irq softirq   stolen
#>   <dttm>                <dbl>   <dbl> <dbl> <dbl> <dbl> <dbl>   <dbl>    <dbl>
#> 1 2018-04-02 12:24:00 0.0104  0.00811     0 0.981     0     0       0 0.000137
#> 2 2018-04-02 12:25:00 0.0126  0.00630     0 0.979     0     0       0 0.00192 
#> 3 2018-04-02 12:26:00 0.0159  0.00808     0 0.976     0     0       0 0       
#> 4 2018-04-02 12:27:00 0.00853 0.00647     0 0.985     0     0       0 0       
#> 5 2018-04-02 12:28:00 0.0122  0.00999     0 0.978     0     0       0 0       
#> 6 2018-04-02 12:29:00 0.0106  0.00604     0 0.983     0     0       0 0       
tail(cpu[[1]])
#> # A tibble: 6 × 9
#>   timestamp              user      sys  nice  idle    wait   irq softirq  stolen
#>   <dttm>                <dbl>    <dbl> <dbl> <dbl>   <dbl> <dbl>   <dbl>   <dbl>
#> 1 2018-05-02 12:17:00 0.00545 0.00144      0 0.992 1.44e-3     0       0 0      
#> 2 2018-05-02 12:18:00 0.00602 0.00201      0 0.991 5.69e-4     0       0 0      
#> 3 2018-05-02 12:19:00 0.00889 0.000569     0 0.991 0           0       0 0      
#> 4 2018-05-02 12:20:00 0.00715 0            0 0.991 0           0       0 1.44e-3
#> 5 2018-05-02 12:21:00 0.00602 0.00144      0 0.992 0           0       0 5.68e-4
#> 6 2018-05-02 12:22:00 0.00171 0.000569     0 0.998 0           0       0 0      

tail(
  cpu$AVERAGE60$sys
)
#> [1] 0.0014390667 0.0020080000 0.0005689333 0.0000000000 0.0014390667
#> [6] 0.0005689333