File: apache_tac_aggregation.inc.php

package info (click to toggle)
jffnms 0.8.3dfsg.1-2.1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,928 kB
  • ctags: 5,050
  • sloc: php: 19,981; sh: 266; makefile: 91; perl: 52
file content (38 lines) | stat: -rw-r--r-- 957 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?
/* This file is part of JFFNMS
 * Copyright (C) <2002-2005> Javier Szyszlican <javier@szysz.com>
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */

function graph_apache_tac_aggregation ($data) {

    $opts_agg = array();
    $str_cdef_tac .= 0;

    foreach ($data["id"] as $id) {
	$interface=$data[$id];

	$opts_agg = array_merge($opts_agg,rrdtool_get_def($interface,array(
				    "tac$id"=>"tac")));

	$str_cdef_tac .=",tac$id,+";
    }

    $cant = count($data["id"]);
    $opts_agg[] = "CDEF:tac=$str_cdef_tac";

    $opts_GRAPH = array(
	"COMMENT:'Number of Servers:".$cant."\\n'",

        "AREA:tac#00CC00:'Hits Per Second   '",
        "GPRINT:tac:MAX:'Max\:%8.0lf %s'",
        "GPRINT:tac:AVERAGE:'Average\:%8.0lf %s'",
        "GPRINT:tac:LAST:'Last\:%8.0lf %s\\n'",
    );

    $opts_header[] = "--vertical-label='Hits / Second'";

    return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH));
}

?>