Domanda

I would like to measure CPU and Memory usages for a server during continuous integration, And I would represent them into several graphs. I use Round Robin Database files (*.rrd) to do it in java with RRD4J library.

I don't know how to define Round Robin Archives... I have tried this kind of RRA:

rrdDefCPU.addDatasource("CPU", DsType.COUNTER, 150, 0, 100);
rrdDefCPU.addArchive("RRA:AVERAGE:0.5:8:300"); 

Or

rrdDefCPU.addDatasource("CPU", DsType.COUNTER, 600, 0, 100);
rrdDefCPU.addArchive("RRA:AVERAGE:0.5:1:600"); 

In both cases, I record one measure per second, but I still 2 points on the graph for a period of 5 minutes. I want a graph with more of values ​on the same period.

È stato utile?

Soluzione

If you are not seeing more detail in your 5 minute interval, then I guess your step size is 5 minutes and you got it from copying the demo code. Please show your RrdDef constructor in your question.

RrdDef rrdDef = new RrdDef(rrdPath, startTime, 300); // step size 300s

Also, you probably want a GAUGE for cpu/memory usage, not a COUNTER which only goes up. If you use COUNTER by mistake, you get spiky output because RRD interprets a down move as an overflow and adds a very large amount to that observation.

In your code, you are varying the Heartbeat size, which combines with Xff to determine what size gap is tolerated in the input. If you have continuous data, you won’t see any effect from changing HB.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top