Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9271011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:30:43+00:00 2026-06-18T15:30:43+00:00

How do you show mean values in custom graphs, rather than total values? Previously

  • 0

How do you show mean values in custom graphs, rather than total values?

Previously I’ve had success generating cluster summary graphs by creating custom .php files, as described here:

http://sourceforge.net/apps/trac/ganglia/wiki/Custom_graphs

However, up to this point, I’ve wanted to show total actions per second for a given metric. But now, I have some timing data where I want to show the mean (average) metric value for all cluster nodes. How is this done? With my current implementation, the generated graphs show the total time value for all nodes, which is not helpful.

Here is the .php:

<?php

/* Pass in by reference! */
function graph_jmx_times_report ( &$rrdtool_graph ) { 

    global $context,
           $hostname,
           $graph_var,
           $range,
           $rrd_dir,
           $size,
           $strip_domainname;

    if ($strip_domainname) {
       $hostname = strip_domainname($hostname);
    }   

    $jmx = $graph_var;
    $title = $jmx.' Processing Time';
    if ($context != 'host') {
       $rrdtool_graph['title'] = $title;
    } else {
       $rrdtool_graph['title'] = "$hostname $title last $range";
    }   
    $rrdtool_graph['lower-limit']    = '0';
    $rrdtool_graph['vertical-label'] = 'milliseconds';
        $rrdtool_graph['extras']         = '--rigid --base 1024';
    $rrdtool_graph['height'] += ($size == 'medium') ? 89 : 0;

        $series = "DEF:'tot_time'='${rrd_dir}/jmx_tomcat_proc_time_ms.rrd':'sum':AVERAGE"
                ."DEF:'fc_time'='${rrd_dir}/jmx_tomcat_freqcap_lookup_time_75.rrd':'sum':AVERAGE "
                ."DEF:'ro_time'='${rrd_dir}/jmx_tomcat_readonly_lookup_time_75.rrd':'sum':AVERAGE "
                ."DEF:'rt_time'='${rrd_dir}/jmx_tomcat_realtime_lookup_time_75.rrd':'sum':AVERAGE "
                ."AREA:'tot_time'#CFF1FC:'' "
                ."LINE2:'fc_time'#F19A2A:'Freq Cap 75' "
                ."LINE2:'ro_time'#66CC33:'Read-only 75' "
                ."LINE2:'rt_time'#CC99CC:'Realtime 75' "
                ."LINE2:'tot_time'#20ABD9:'Processing Time' "
        ;

    $rrdtool_graph['series'] = $series;

    return $rrdtool_graph;

}

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:30:44+00:00Added an answer on June 18, 2026 at 3:30 pm

    The summary RRDs Ganglia uses have a num data source in addition to the sum data source. The num value indicates the number of hosts the sum was calculated from and is available only in summary RRDs.

    You can use the RRDtool CDEF instruction to calculate the average over all hosts by dividing sum by num.

    Here’s an example:

    if ($context != 'host') { // cluster or grid summary graph context
        $series = 
         "'DEF:fc_time_sum=${rrd_dir}/jmx_tomcat_freqcap_lookup_time_75.rrd:sum:AVERAGE' " 
        ."'DEF:fc_time_num=${rrd_dir}/jmx_tomcat_freqcap_lookup_time_75.rrd:num:AVERAGE' " 
        ."'CDEF:avg_fc_time=fc_time_sum,fc_time_num,/' " 
        ."'LINE2:avg_fc_time#0000FF:Average Freq Cap 75' ";
    } else { // single host graph context
        //here you can't use the num data source
    }
    

    This averaging is also shown in the sample_report.php file included with ganglia-web.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I force Doxygen to show full include path? What do I mean:
I am working on a custom control where I am using Rectangle to show
By raw values, I mean the application level values provided by UI controls, such
I mean if someone enters <a>gvfdg</a> it should not show up a link. I've
Here a couple of examples in a pseudocode to show what I mean. This
I'm using Validation Rules to show custom messages, and INotifyDataError for the business rules.
I was wondering if somebody could show me an example of how to use
guys please post me an example for threading in MFC....it should show the progress
Show me another way to write so it finds the first A: $(UL.tab LI
show grants for charm@'localhost'; ---------------------+ | Grants for charm@localhost | +-----------------------------------------------------------------------------------------------------------------+ | GRANT USAGE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.