Changeset 803 for branches/0.4/web
- Timestamp:
- 04/06/13 23:46:35 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/web/addons/job_monarch/graph.php
r802 r803 453 453 } 454 454 455 $series .= "DEF:'load_one${def_nr}'='${rrd_dir}/load_one.rrd':'sum':AVERAGE " 456 ."DEF:'proc_run${def_nr}'='${rrd_dir}/proc_run.rrd':'sum':AVERAGE " 457 ."DEF:'cpu_num${def_nr}'='${rrd_dir}/cpu_num.rrd':'sum':AVERAGE "; 455 $series .= "DEF:'load_load${def_nr}'='${rrd_dir}/load_one.rrd':'sum':AVERAGE " 456 ."DEF:'load_procs${def_nr}'='${rrd_dir}/proc_run.rrd':'sum':AVERAGE " 457 ."DEF:'load_cpus${def_nr}'='${rrd_dir}/cpu_num.rrd':'sum':AVERAGE "; 458 459 $report_names = array( "load", "procs", "cpus" ); 460 461 if( $conf['graphreport_stats'] ) 462 { 463 foreach( $report_names as $r ) 464 { 465 $series .= "CDEF:load_${r}${def_nr}_nonans=load_${r}${def_nr},UN,0,load_${r}${def_nr},IF "; 466 } 467 } 468 469 $def_nr++; 470 } 471 472 if( $conf['graphreport_stats'] ) 473 { 474 $s_last = $def_nr - 1; 475 476 foreach( $report_names as $r ) 477 { 478 $cdef_sum = "CDEF:load_${r}=load_${r}0_nonans"; 479 480 if( $s_last > 1 ) 481 { 482 foreach (range(1, ($s_last)) as $print_nr ) 483 { 484 $user_sum .= ",load_${r}{$print_nr}_nonans,+"; 485 } 486 } 487 $cdef_sum .= " "; 488 489 $series .= $cdef_sum; 490 } 491 492 $conf['load_load_color'] = $conf['load_one_color']; 493 $conf['load_procs_color'] = $conf['proc_run_color']; 494 $conf['load_cpus_color'] = $conf['cpu_num_color']; 495 496 foreach( $report_names as $r ) 497 { 498 $legend_str = ucfirst( $r ); 499 500 if( $r == 'load' ) 501 { 502 $graph_str = "AREA"; 503 } 504 else 505 { 506 $graph_str = "LINE2"; 507 } 508 foreach (range(0, ($s_last)) as $print_nr ) 509 { 510 $series .= "${graph_str}:'load_${r}${print_nr}'#".$conf['load_'.${r}.'_color'].":'${legend_str}\g' "; 511 $legend_str = ''; 512 } 513 514 $series .= "VDEF:'${r}_last'=load_${r},LAST "; 515 $series .= "VDEF:'${r}_min'=load_${r},MINIMUM "; 516 $series .= "VDEF:'${r}_avg'=load_${r},AVERAGE "; 517 $series .= "VDEF:'${r}_max'=load_${r},MAXIMUM "; 518 519 $spacefill = ''; 520 521 $spacesize = 6-strlen($r); // max length 'swapped' = 7 522 foreach ( range( 0, $spacesize ) as $whatever ) 523 { 524 $spacefill .= ' '; 525 } 526 $series .= "GPRINT:'${r}_last':'${spacefill}Now\:%6.1lf%s' " 527 . "GPRINT:'${r}_min':'${space1}Min\:%6.1lf%s${eol1}' " 528 . "GPRINT:'${r}_avg':'${space2}Avg\:%6.1lf%s' " 529 . "GPRINT:'${r}_max':'${space1}Max\:%6.1lf%s\\l' "; 530 } 531 } 532 else 533 { 458 534 $series .="AREA:'load_one${def_nr}'#".$conf['load_one_color']."${load_str} "; 459 535 $series .="LINE2:'cpu_num${def_nr}'#".$conf['cpu_num_color']."${cpu_str} "; 460 536 $series .="LINE2:'proc_run${def_nr}'#".$conf['proc_run_color']."${run_str} "; 461 462 $def_nr++; 463 } 464 537 } 465 538 } 466 539 else if ($graph == "network_report")
Note: See TracChangeset
for help on using the changeset viewer.