95th Percentile: A different approach

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

bradley
Posts: 38
Joined: Fri Dec 02, 2005 7:02 am
Location: United Kingdom
Contact:

95th Percentile: A different approach

Post by bradley »

Cacti currently supports drawing a horizontal line across the entire graph which represents the 95th percentile, however, I was wondering if it would be possible to plot each day's/week's 95th percentile on a graph?

For example, week A has a 95th percentile of X, while week B has a 95th percentile of Y,
Could X and Y then be graphed? (and each subsequent weeks 95th percentile too?)

I believe this method of graphing the 95th percentile would provide for better trend analysis
and allow for better prediction of future bandwidth usage.

--
Regards
Bradley Kite
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

While I agree with you. It would cause performance issues because of the amount of data being retreived and calculated.

You can view time frames on the graphs and Nth Percentile will use that date range.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

With rrdtool 1.2.x, there's a new option for calculating Nth Percentiles. Would this be an option? This may require an extension to the Graph Items Table; I'd like to dig into that (and some more new options, e.g. VDEF) if there's a need for this
Reinhard
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You might also be able to create a data input method that stores in it's own RRD file the 95th percentile average over time. Then, you could plot that along with your normal interface graph as a red line or something.

Lvm,

Don't give up on the VDEF function though.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um... Vdef... Let me know what you find.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
moonman
Cacti User
Posts: 101
Joined: Sat Sep 06, 2003 10:25 am

Post by moonman »

I start to play with VDEF code in the past and its very easy to add it to cacti and it give nice result.
the code is somthing like duplicating the cdef code and change some function/opertors in the /include files.
the only problem I see is to add cdef to vdef and vice versa because today when you add cdef to cdef you add the cdef string not the cdef name in the new cdef string, but with vdef you must use the cdef name

Nitzan
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I've done the VDEF thingy now. Here's kinda changelog for things that got touched

Code: Select all

new: lib/vdef.php
new: vdef.php
changed: include/config_arrays.php: vdef structures
        $menu management: added VDEFs
        $user_auth_realm_filenames
        $hash_type_codes
        $hash_type_names
        $user_auth_realms
        $graph_item_types
changed: cacti.sql: table vdef and vdef_items
changed: lib/functions.php: function draw_navigation_text $nav
        new function get_hash_vdef
        changed comment of function get_hash_version
changed: include/config.form.php: $fields_vdef_edit
        "vdef_id" => array(
changed: graph_templates_items.php: $save["vdef_id"]
        VDEF-LEGEND (unvollständig)
changed: rra.php: function rrdtool_function_graph include vdef.php
        query $graph_items
        and more

Alter TABLE `graph_templates_item` ADD `vdef_id` mediumint(8) unsigned NOT NULL default '0' AFTER `cdef_id`
Unfortunately, that's not a "minor" change, especially because of the change of the table graph_templates_item. I've played around a bit and just got my first graph working, but more testing would have to be performed. Before doing this, please let me know if I'm on the right way. So I've attached some screenshots
Reinhard
Attachments
New "VDEF" dropdown for graph items
New "VDEF" dropdown for graph items
graph_template_item.png (33.98 KiB) Viewed 26672 times
the 95 Percentile VDEF
<br />mimic made like CDEF stuff
the 95 Percentile VDEF
mimic made like CDEF stuff
95percentile-vdef.png (18.47 KiB) Viewed 26672 times
Graph Management extended with new VDEF Option (like CDEF)
Graph Management extended with new VDEF Option (like CDEF)
graph_management.png (17.83 KiB) Viewed 26672 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

And here's my first Graph
Outbound GPRINTs are all made of VDEFs (see e.g. Total). 95 Percentile not yet tested with LINEx (former HRULE), but will do
Reinhard
Attachments
First Graph using VDEFs
<br />OUTBOUND GPRINTs all made out of VDEFs
First Graph using VDEFs
OUTBOUND GPRINTs all made out of VDEFs
first_graph.png (55.1 KiB) Viewed 26671 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Nice,

Sent to raX for comment!

Larry
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I will do. But before, more testing has to be performed (have had some "side effects" aka problems).
And I want to check for HRULE 95 Percent Replacement using VDEFs (with 95 being a variable that can be changed using a new VDEF definition). I already did the percentile thingy from cli, but this led to different results compared to the cacti 95 percentile. I will have to investigate further to explain the difference. When done, I will post the findings to raX.
Another nice tweak would be the horizontal time shift? Comparing actual data with those of last day|week|month? But consolidation may have some effects. So this has to wait a bit (there were already requests for this on the forum, but not that much).
Reinhard
Attachments
Same Graph as before, but added 95 Percentiles as GPRINTs
Same Graph as before, but added 95 Percentiles as GPRINTs
second-graph.png (54.63 KiB) Viewed 26640 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Finally done and sent to raX for comment.
Will support all VDEF Operators (MIN, MAX, AVG, LAST, FIRST, PERCENT and LSL* stuff). Will work with CDEFs. PERCENT in combination with HRULE will work as a "95th percentile" replacement (of course, you may define another percentage, e.g. 90% or 80% ...). If actual cacti-style "95th percentile" is used with HRULE, this will override the VDEF.
Supports "virtual" datasources like "CURRENT_DATA_SOURCE", "ALL_DATA_SOURCES_NODUPS" and "SIMILAR_DATASOURCES_NODUPS".
Exporting and Importing is supported as well.
Database modification is implemented like those for cacti version upgrades.
Modification of Graph Items Screen is made rrdtool-version-dependant (that is: use rrdtool-1.0.x will result in not seeing the VDEF input field ;-) ).
Time Saver VDEF-LEGEND is not yet implemented (should work like current LEGEND)
Waiting for raX to comment ...
Reinhard
c741397
Posts: 1
Joined: Mon Aug 21, 2006 9:22 pm
Location: Adelaide - Australia

Status of VDEF patches

Post by c741397 »

Just wondering what the status of the VDEF patches are? some of our graphs could benefit from this functionality.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

VDEF will not be included in 0.8.6, but has already been added to 0.9.0, which we don't have a release date for.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Allen K
Posts: 25
Joined: Sat Oct 15, 2005 9:34 pm

pre-release?

Post by Allen K »

Is there a dev version of .9 that I can download and test? I'm really looking forward to seeing how its comming along
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Yes, you can get it out of SVN Trunk directory.

But, it doesn't work, it's under heavy development.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests