GDGraph
am 16.08.2005 04:04:29 von dszostek
Hi,
It appears as if I have too much data in my graph and I don't know how
to solve that problem.
I am using GD Graph to create a bar graph. The graph is graphing data
from a program that runs every five minutes. I want my graph to be
800x400 pixels. At 800x400 pixels, I can graph about 60 hours worth of
data (about 720 lines). If I go much more than that, though, GD outputs
an entirely blank image. But, if I make the image wider (1200x400), I
can get just under 120 hours of data in it.
I want to make weekly and monthly graphs that fit in to 800x400. Does
anyone have any ideas on how to do this? Would a different perl module
be a better idea? Are all modules going to encounter this problem?
Thanks in advance,
Dave
Re: GDGraph
am 16.08.2005 05:45:10 von xhoster
dszostek@gmail.com wrote:
> Hi,
>
> It appears as if I have too much data in my graph and I don't know how
> to solve that problem.
>
> I am using GD Graph to create a bar graph. The graph is graphing data
> from a program that runs every five minutes. I want my graph to be
> 800x400 pixels. At 800x400 pixels, I can graph about 60 hours worth of
> data (about 720 lines). If I go much more than that, though, GD outputs
> an entirely blank image. But, if I make the image wider (1200x400), I
> can get just under 120 hours of data in it.
>
> I want to make weekly and monthly graphs that fit in to 800x400. Does
> anyone have any ideas on how to do this?
Summarize your data into larger chunks than 5 minutes.
> Would a different perl module
> be a better idea?
Some might do the summarization for you when they realize you are trying to
pack more data into an image than fits. I don't know of any that do that
offhand, and I question whether that would actually by better or not.
> Are all modules going to encounter this problem?
I don't think any modules will create a bar graph that is 800 pixels wide
yet has more than 800 bars side-by-side.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
Re: GDGraph
am 16.08.2005 14:58:29 von steve.vanderburg
dszostek@gmail.com (Dave) wrote in
<1124171891.110332.167420@g44g2000cwa.googlegroups.com>:
>I understand what you are saying... how might a program summarize the
>data do you think? I'm at a loss how a summarizer might work and still
>retain the original data (or mostly the original data).
What's important about the original data? Let that guide how you want the
summarizing to work. Do you want hourly averages? Hourly maximums?
Take a look at rrdtool and some excellent perl glue to it - RRDTool::OO. You
can backload your existing data into an rrd, play with different summarizing
functions and graph the whole thing easily.
HTH,
....Steve
--
Steve van der Burg
Technical Analyst, Information Services
London Health Sciences Centre
London, Ontario, Canada
Email: steve.vanderburg@lhsc.on.ca
Re: GDGraph
am 16.08.2005 18:29:38 von dszostek
Hi,
That's an interesting idea. I can't seem to find an example of an rrd
entry. Is there an easy way to import data in to rrd format?
"All" of my data is important... I am trying to be as accurate as
possible. It is clearly a problem to show everything though. An hourly
average on a monthly basis (creating 744 data points) would be a good
maximum though. I could be more specific for smaller time periods.
Is there a tool to import data to rdd format, or do you know where I
could see an example?
Thanks,
Dave
Re: GDGraph
am 16.08.2005 22:02:09 von steve.vanderburg
dszostek@gmail.com (Dave) wrote in
<1124209778.199105.157300@g49g2000cwa.googlegroups.com>:
>Hi,
>
>That's an interesting idea. I can't seem to find an example of an rrd
>entry. Is there an easy way to import data in to rrd format?
>
>"All" of my data is important... I am trying to be as accurate as
>possible. It is clearly a problem to show everything though. An hourly
>average on a monthly basis (creating 744 data points) would be a good
>maximum though. I could be more specific for smaller time periods.
>
>Is there a tool to import data to rdd format, or do you know where I
>could see an example?
Sure. Here's part of a local application that reads data from a couple
of databases, creates an rrd on the fly with it, and then graphs it.
my $trdf = "/var/tmp/$$-stats.rrd";
my $rrd = RRDTool::OO->new(file=>$trdf);
my $step = 900; # 15 minutes
my $rc = $rrd->create(
start => time() - 86400*8,
step => $step,
data_source => { name => 'serverload',
type => 'GAUGE', },
data_source => { name => 'avgload',
type => 'GAUGE', },
archive => { rows => (86400/$step)*7, # 1:1 for a week
},
);
$rrd->update(time => $_->[0], values => { serverload => $_->[1] ||
0,
avgload => $_->[2] || 0
})
foreach make_load_list($thing1,$thing2);
make_load_list() returns an array of references to arrays, each of
which contains three values: a timestamp + two data values.
Graphing looks something like this:
my %ds = (
serverload => {
color => '00CC00',
legend => "$server Load",
},
avgload => {
color => 'FF0000',
legend => "Avg Load across all servers",
},
);
my @draws = map {
(draw => {
type => $_ eq 'serverload' ? "area" : "line",
thickness => 2,
color => $ds{$_}->{color},
dsname => $_,
name => $_,
cfunc => 'MAX',
legend => $ds{$_}->{legend},
})
} keys %ds;
$draws[$#draws]->{legend} .= '\c';
$rrd->graph(
title => $title,
image => "-",
vertical_label => 'load',
start => $gst,
# end => $gp{end},
width => $gp{width},
height => $gp{height},
vrule => { time => $soday, },
@draws,
comment => [ "\\s", "as of $ltime\\c", ],
);
You can learn more about populating the rrd from the rrdtool man page,
and more about graphing from the rrdgraph man page and the RRDTool::OO
man page.
....Steve
--
Steve van der Burg
Technical Analyst, Information Services
London Health Sciences Centre
London, Ontario, Canada
Email: steve.vanderburg@lhsc.on.ca
Re: GDGraph
am 03.09.2005 13:11:18 von dstuart
The RRDtool Page provides fairly extensive documentation, examples, and
some useful tutorials. The RRDtool docs can be found at:
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/doc/index .en.html
-Damien
Dave wrote:
> Hi,
>
> That's an interesting idea. I can't seem to find an example of an rrd
> entry. Is there an easy way to import data in to rrd format?
>
> "All" of my data is important... I am trying to be as accurate as
> possible. It is clearly a problem to show everything though. An hourly
> average on a monthly basis (creating 744 data points) would be a good
> maximum though. I could be more specific for smaller time periods.
>
> Is there a tool to import data to rdd format, or do you know where I
> could see an example?
>
> Thanks,
> Dave
>