Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A high performance data logging and graphing system for time series data.

License

NotificationsYou must be signed in to change notification settings

rrd4j/rrd4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitter chatBuild StatusJavadocs

RRD4J is a high performance data logging and graphing system for time series data, implementingRRDTool'sfunctionality 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 andGRAPH.RRD4J's API is made for those who are familiar withRRDTool's concepts and logic, but prefer towork with pure Java (no native functions or libraries, no Runtime.exec(), RRDTool does not have to be present). We help out ourusershere.

Latest Version (requires Java 8+)

RRD4J 3.9 (released 2023-08-14) -Download -Changelog

Building (optional)

RRD4J is built using Maven. The generated site is availablehere. Automated builds are uploadedtoSonatype's repository.

Tests needs a running mongo instance to succeds. It could be started with:

docker run --rm  -p 27017:27017 mongo:latest

Using with Maven

Add this dependency to your project's POM file:

<dependency>    <groupId>org.rrd4j</groupId>    <artifactId>rrd4j</artifactId>    <version>3.9</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 addsTOTAL,FIRST
  • Supports almost all RRDTool RPN functions (wiki/seeRPNFuncs)
  • Multiple backends, e.g. use MongoDB as data store

Usage Example

importjava.awt.Color;importorg.rrd4j.core.*;importorg.rrd4j.graph.*;importstaticorg.rrd4j.ConsolFun.*;StringrrdPath ="my.rrd";// first, define the RRDRrdDefrrdDef =newRrdDef(rrdPath,300);rrdDef.addArchive(AVERAGE,0.5,1,600);// 1 step, 600 rowsrrdDef.addArchive(AVERAGE,0.5,6,700);// 6 steps, 700 rowsrrdDef.addArchive(MAX,0.5,1,600);// then, create a RrdDb from the definition and start adding datatry (RrdDbrrdDb =RrdDb.getBuilder().setRrdDef(rrdDef).build()) {Samplesample =rrdDb.createSample();while (...) {doubleinbytes = ...doubleoutbytes = ...sample.setValue("inbytes",inbytes);sample.setValue("outbytes",outbytes);sample.update();    }}// then create a graph definitionRrdGraphDefgDef =newRrdGraphDef();gDef.setWidth(500);gDef.setHeight(300);gDef.setFilename("inbytes.png");gDef.setTitle("My Title");gDef.setVerticalLabel("bytes");gDef.datasource("inbytes-average",rrdPath,"inbytes",AVERAGE);gDef.line("inbytes-average",Color.BLUE,"Bytes In");gDef.hrule(2568,Color.GREEN,"hrule");gDef.setImageFormat("png");// then actually draw the graphRrdGraphgraph =newRrdGraph(gDef);// will create the graph in the path specified

Go through the source ofDemo for more examples. The packageorg.rrd4j.demo contains other demo code.

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 therrd4clj project Clojure now has a RRD API (using RRD4J). Check out theirexamples.

Contributing

If you are interested in contributing to RRD4J, start by posting pull requests to issues that are important to you. Subscribe to thediscussiongroup 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 theJRDS project)

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

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

License

Licensed under theApache License, Version 2.0.

About

A high performance data logging and graphing system for time series data.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors20

Languages


[8]ページ先頭

©2009-2025 Movatter.jp