[rrd-users] Re: 95th percentile

Philip Molter philip at datafoundry.net
Wed Mar 14 20:12:24 MET 2001


On Wed, Mar 14, 2001 at 10:44:21AM -0800, Mike Bernhardt wrote:
: 
: So it sounds like your script generates text output then? That would still
: be useful. I do remember seeing a post here that included a link to
: someone's graph, which included 95th percentile info including approximate
: cost of the usage. Does anyone else remember it? I can't find it in the
: archives.

Well, the idea is that once you calculate the 95th percentile value,
you can use it for anything.  You could print it out into a text
report.  You could draw a line on your graph using HRULE.  You
could put it in a GPRINT statement.

I mean, if all you need is the 95th percentile value, just take
his chunk of code below and copy it in.  Then use the value in that
variable for whatever you need.

: > $stat = Statistics::Descriptive::Full->new();
: > ($start,$step,$ds,$data) = RRDs::fetch .....;
: > foreach (@$data) {
: > 	#
: > 	# Substitute zero for missing samples
: > 	if ($_->[0] eq "" || $_->[1] eq "") {
: >             $sam = 0;
: >             $drop++;
: >         } else {
: >             $sam = ($_->[0] * 8) + ($_->[1] * 8);
: >         }
: > 	$stat->add_data($sam);
: > }
: > $perc = $stat->percentile(95);	

So all you need to do is do whatever work you need with the value
in $perc.  If you're looking for an explanation of how to calculate
bandwidth costs, I think you might be reading the wrong list.

* Philip Molter
* DataFoundry.net
* http://www.datafoundry.net/
* philip at datafoundry.net

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list