RRD

Scale Counter Graph

RRD

About

RRDtool is a data logging and graphing system for metrics (performance data).

RRDtool refers to Round Robin Database tool. RRDtool works with Round Robin Databases (RRDs). It stores and retrieves data from them.

RRDtool originated from MRTG (Multi Router Traffic Grapher). MRTG started as a tiny little script for graphing the use of a university's connection to the Internet.

RRDtool lets you:

  • create a database,
  • store data in it,
  • retrieve that data
  • create graphs in PNG format

Management

Installation

Create an RRD database

rrdtool create test.rrd             \
            --start 920804400      \
            DS:speed:COUNTER:600:U:U   \
            --step=300                 \
            RRA:AVERAGE:0.5:1:24       \
            RRA:AVERAGE:0.5:6:10

where:

  • test.rrd is the round robin database
  • –start define the start date with the epoch format. 920804400 means 920804400 seconds since 1 January 1970 which is 7th of March, 1999 at noon. The time stamp value is translated into local time and it will therefore look different for different time zones.
  • DS define one data source (DS) named “speed” that represents a counter.
  • –steps define a read every five minutes (300s). This is the default.
  • RRA define a round robin archives (s):
    • one averages the data every time it is read (e.g., there's nothing to average) and keeps 24 samples (24 times 5 minutes is 2 hours).
    • the other averages 6 values (half hour) and contains 10 such averages (e.g. 5 hours).

Update / Insert

Data to insert:

Time Data
12:05 12345
12:10 12357
12:15 12363

Syntax:

rrdtool update test.rrd 920804700:12345
rrdtool update test.rrd 920805000:12357
rrdtool update test.rrd 920805300:12363
# or with the batch mode
rrdtool update test.rrd 920804700:12345 920805000:12357 920805300:12363

where:

Get

rrdtool fetch test.rrd AVERAGE --start 920804700 --end 920805300
920805000: 4.0000000000e-02
 920805300: 2.0000000000e-02
 920805600: nan  # Not A Number It can be also NAN, U or UNKN

Graph

rrdtool graph speed.png                                 \
         --start 920804400 --end 920808000               \
         DEF:myspeed=test.rrd:speed:AVERAGE              \
         LINE2:myspeed#FF0000

where:

  • speed.png is the output file
  • –start and -end are the time range
  • DEF is a variable definition statement named myspeed that is equals to the RRA speed out of database test.rrd.
  • LINE define a line drawn with 2 pixels high, represents the variable myspeed, colored in #FF0000 red (hexadecimal rgb-representation)

Library

Port

Rrd4j is a port of RRD in Java

Documentation / Reference





Discover More
Scale Counter Graph
Counter - Collector

Metrics collector query and collects metrics in order to be able to send them to a metrics server Log Collector In a instrumented application, reporter are a client piece of code which: process...
Scale Counter Graph
Metrics Server

This page is software that can store and visualize counter (metrics. The collectors that sends data to a metrics server are: Metrics Collector Log Collector Instrumentation Reporter The...
Time Serie - Database

Time Serie Database. Tags allow users to add 1 to n additional dimensions to their metrics in the form of key value pairs. Relational databases can be used to store and analyze time series data,...
Scale Counter Graph
Time Serie - Graphite (Storage and Visualization)

Graphite is a metrics server software. It does two things: * Store metrics (numeric time-series data) * Render graphs of this data on demand The inherent scheme of organization in graphite is tree-like...



Share this page:
Follow us:
Task Runner