Giter Club home page Giter Club logo

rrd4j's Introduction

rrd4j

RRD4J is a high performance data logging and graphing system for time series data, implementing RRDTool's functionality in Java. It follows much of the same logic and uses the same data sources, archive types and definitions as RRDTool does.

RRD4J supports all standard operations on Round Robin Database (RRD) files: CREATE, UPDATE, FETCH, LAST, DUMP, EXPORT and GRAPH. RRD4J's API is made for those who are familiar with RRDTool's concepts and logic, but prefer to work with pure Java (no native functions or libraries, no Runtime.exec(), RRDTool does not have to be present). We help out our users here.

Latest Version (requires Java 6+)

RRD4J 2.2 (released 2013-04-11) - Download - Changelog

Building (optional)

RRD4J is built using Maven. The generated site is available here. Automated builds are uploaded to Sonatype's repository.

Using with Maven

Add this dependency to your project's POM file:

<dependency>
	<groupId>org.rrd4j</groupId>
	<artifactId>rrd4j</artifactId>
	<version>2.2</version>
</dependency>

Why RRD4J?

  • Portable files, RRDTool files are not
  • Simple API
  • Supports the same data source types as RRDTool (COUNTER, ABSOLUTE, DERIVE, GAUGE)
  • Supports the same consolidation functions as RRDTool (AVERAGE, MIN, MAX, LAST) and adds TOTAL, FIRST
  • Supports almost all RRDTool RPN functions (wiki/see RPNFuncs)
  • Multiple backends, e.g. use MongoDB as data store

Usage Example

import org.rrd4j.code.*;
import static org.rrd4j.DsType.*;
import static org.rrd4j.ConsolFun.*;
...
// first, define the RRD
RrdDef rrdDef = new RrdDef(rrdPath, 300);
rrdDef.addArchive(AVERAGE, 0.5, 1, 600); // 1 step, 600 rows
rrdDef.addArchive(AVERAGE, 0.5, 6, 700); // 6 steps, 700 rows
rrdDef.addArchive(MAX, 0.5, 1, 600);

// then, create a RrdDb from the definition and start adding data
RrdDb rrdDb = new RrdDb(rrdDef);
Sample sample = rrdDb.createSample();
while (...) {
    sample.setTime(t);
    sample.setValue("inbytes", ...);
    sample.setValue("outbytes", ...);
    sample.update();
}
rrdDb.close();

// then create a graph definition
RrdGraphDef gDef = new RrdGraphDef();
gDef.setWidth(500);
gDef.setHeight(300);
gDef.setFilename(imgPath);
gDef.setStartTime(start);
gDef.setEndTime(end);
gDef.setTitle("My Title");
gDef.setVerticalLabel("bytes");

gDef.datasource("bytes", "myrrdpath", "inbytes", AVERAGE);
gDef.hrule(2568, Color.GREEN, "hrule");
gDef.setImageFormat("png");

// then actually draw the graph
RrdGraph graph = new RrdGraph(gDef); // will create the graph in the path specified

Go through the source of Demo for more examples.

Supported Backends

Next to memory and file storage, RRD4J supports the following backends (using byte array storage):

  • MongoDB - a scalable, high-performance, open source, document-oriented database.
  • Oracle Berkeley DB Java Edition - an open source, embeddable database providing developers with fast, reliable, local persistence with zero administration.

Clojure

Thanks to the rrd4clj project Clojure now has a RRD API (using RRD4J). Check out their examples.

Contributing

If you are interested in contributing to RRD4J, start by posting pull requests to issues that are important to you. Subscribe to the discussion group and introduce yourself.

If you can't contribute, please let us know about your RRD4J use case. Always good to hear your stories!

Graph Examples (from the JRDS project)

http://jrds.fr/_media/myssqlops.png

http://jrds.fr/_media/screenshots/meminforam.png

License

Licensed under the Apache License, Version 2.0.

rrd4j's People

Contributors

analytically avatar fbacchella avatar ssbx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.