0

EDIT: To make things clear: I have an integer called $blocks or something, which increases everyday. I want to make a graph with RRDtool, that shows the "increased" amount for everyday. So if my $blocks would be 1 on day 1, and 3 on day 2, and 5 on day 3, the graph should say "1, 2, 2". How do I set that RRD-databse up?


Original Question: I want to make a graph of the activity of my minecraft server. I log all block changes into a mysql table and I wrote a script that gives me the number of rows in that table.

for example, if I run my program on day one, it says "500.000 blocks changed", on the second day 900.000, which means that from yesterday, 400.000 blocks have changed.

I now want to make a graph that shows 500.000 for day one, and 400.000 for day 2, and so.

I tried using the COUNTER datasource to no avail. How do I setup my RRD database so that I can just update it every day with the block changes since day one, and it just shows the addition to each previous day?

I hope i made it clear what I need to happen.

mfnalex
  • 221
  • 1
  • 2
  • 8
  • 2
    This question should probably better be asked in Database Administrators. – dr_ Jul 18 '17 at 10:40
  • Well, actually it has nothing to do with the database. I just need the rrdtool to save an incrementing integer, and print a graph showing how much the value became bigger on what day. – mfnalex Jul 18 '17 at 10:45
  • To help people focus on the RRD aspect, you might consider saying: "I have a value in `$blocks` that increases every day. How do I set up...." – Jeff Schaller Jul 18 '17 at 11:16
  • @JeffSchaller: Yes, that is probably more appropiate, I will change it – mfnalex Jul 18 '17 at 16:20
  • what have you tried so far (please show actual commands or script fragment with sample data)? are you using `rrdtool` directly, or via a tool like `munin` or `cricket`? – cas Jul 19 '17 at 02:23

1 Answers1

0

I think it would go something like this. rrdtool create minecraft.rrd --step=86400 DS:blocks:COUNTER:172800:U:U RRA:AVERAGE:0.5:1:730

That would basically setup one data source named 'blocks' which expects a value every 86400 seconds, and leaves a gap if a result isn't provided in 172800 seconds. It will keep all data points for two years. You could add another RRA if you want to keep more data longer.

user3629081
  • 115
  • 5