[Ganglia-developers] let Grid and Cluster Load graphs at the web 2.0 interface lock like at the old interface

2011-04-19 Thread Markus Köberl
Attached is a patch to let the Grid and Cluster Load graphs lock like at the 
old interface.

Add possibility to define a custom data source in the json template with DS 
which will get used instead of the default 'sum'. To handle situations where 
the data source is not available in all rrds define the context.

For example the number of Nodes:
data source 'num' only available in the summary rrds of 'cpu_num'
definition in the json template looks like:
{ metric: cpu_num, color: 00FF00, label: Nodes, line_width: 2, 
type: line, DS: num, context: 
{ cluster: true, meta: true } }
The metric will get ignored at the host context but not at the meta and 
cluster context.


Markus
-- 
Markus Köberl
Graz University of Technology
Signal Processing and Speech Communication Laboratory
E-mail: markus.koeb...@tugraz.at
Index: graph.d/load_report.json
===
--- graph.d/load_report.json	(revision 2574)
+++ graph.d/load_report.json	(working copy)
@@ -5,6 +5,8 @@
vertical_label : Loads/Procs,
series : [
   { metric: load_one, color: BB, label: 1-min, type: stack },
+  { metric: cpu_num, color: 00FF00, label: Nodes, line_width: 2, type: line, DS: num, context: { cluster: true, meta: true } },
+  { metric: cpu_num, color: FF, label: CPUs, line_width: 2, type: line },
   { metric: proc_run, color: 2030F4, label: Procs, line_width: 2, type: line }
]
 }
Index: functions.php
===
--- functions.php	(revision 2574)
+++ functions.php	(working copy)
@@ -870,7 +870,10 @@

   // Loop through all the graph items
   foreach( $graph_config[ 'series' ] as $index = $item ) {
-
+ // ignore item if context is not defined in json template
+ if ( $item[ 'context' ] and $item[ 'context' ][ $context ] == false )
+ continue;
+
  $rrd_dir = $conf['rrds'] . / . $item['clustername'] . / . $item['hostname'];

  $metric = sanitize( $item[ 'metric' ] );
@@ -884,8 +887,14 @@
   $unique_id = a . $index;

$label = str_pad( sanitize( $item[ 'label' ] ), $max_label_length );
-   $series .=  DEF:'$unique_id'='$metric_file':'sum':AVERAGE ;
-
+
+   // use custom DS defined in json template (default = 'sum')
+   $DS = sanitize( $item[ 'DS' ] );
+   if($DS!='')
+   $series .=  DEF:'$unique_id'='$metric_file':'$DS':AVERAGE ;
+   else
+   $series .=  DEF:'$unique_id'='$metric_file':'sum':AVERAGE ;
+
// By default graph is a line graph
isset( $item['type']) ? $item_type = $item['type'] : $item_type = line;
--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] Web 2.0 UI code freeze

2011-04-18 Thread Markus Köberl
On Wednesday 06 April 2011, Vladimir Vuksan wrote:
 I spoke to Bernard and we are considering doing a code freeze of the Web
 2.0 UI. I'd like to release it by the end of month so that people can start
 using it.

 Thoughts ?

Excellent work!


I did some small modifications:
- remove config option $conf['show_cores'] (There is no code which will use 
it)
- link to the graph_all_periods.php at the grid overview (like at the cluster 
overview) 
- at graph_all_periods.php link the graphs to graph.php (like at the grid 
overview)




monitor-web-2.0$ svn diff
Index: conf_default.php.in
===
--- conf_default.php.in (revision 2570)
+++ conf_default.php.in (working copy)
@@ -121,11 +121,6 @@
 $conf['cpu_num_color']  = FF;
 $conf['num_nodes_color'] = 00FF00;
 
-#
-# Display number of cores in LOAD report graph
-#
-$conf['show_cores'] = false;
-
 # Other colors
 $conf['jobstart_color'] = ff3300;
 
Index: templates/default/meta_view.tpl
===
--- templates/default/meta_view.tpl (revision 2570)
+++ templates/default/meta_view.tpl (working copy)
@@ -45,21 +45,21 @@
 
 {if isset($source.self_summary_graphs)}
   TD ALIGN=RIGHT VALIGN=TOP
-A HREF=./graph.php?{$source.graph_url}amp;g=load_reportamp;z=large
+A HREF=./graph_all_periods.php?
{$source.graph_url}amp;g=load_reportamp;z=large
   IMG SRC=./graph.php?
{$source.graph_url}amp;g=load_reportamp;z=medium
ALT={$source.name} LOAD BORDER=0
 /ABR
-A HREF=./graph.php?{$source.graph_url}amp;g=cpu_reportamp;z=large
+A HREF=./graph_all_periods.php?
{$source.graph_url}amp;g=cpu_reportamp;z=large
   IMG SRC=./graph.php?
{$source.graph_url}amp;g=cpu_reportamp;z=medium
ALT={$source.name} CPU BORDER=0
 /A
   /TD
   TD VALIGN=TOP
-A HREF=./graph.php?{$source.graph_url}amp;g=mem_reportamp;z=large
+A HREF=./graph_all_periods.php?
{$source.graph_url}amp;g=mem_reportamp;z=large
   IMG SRC=./graph.php?
{$source.graph_url}amp;g=mem_reportamp;z=medium
ALT={$source.name} MEM BORDER=0
 /ABR
-A HREF=./graph.php?
{$source.graph_url}amp;g=network_reportamp;z=large
+A HREF=./graph_all_periods.php?
{$source.graph_url}amp;g=network_reportamp;z=large
   IMG SRC=./graph.php?
{$source.graph_url}amp;g=network_reportamp;z=medium
ALT={$source.name} NETWORK BORDER=0
 /A
Index: graph_all_periods.php
===
--- graph_all_periods.php   (revision 2570)
+++ graph_all_periods.php   (working copy)
@@ -78,7 +78,7 @@
   print 'div class=img_view' .
   'a href=./graph.php?r=' . $key . $query_string .'csv=1img alt=Export 
to CSV height=16 width=16 src=img/csv.png/a ' .
   'a href=./graph.php?r=' . $key . $query_string .'json=1img 
alt=Export to JSON height=16 width=16 src=img/js.png/a' .
-  'br /img alt=Last ' . $key . ' src=graph.php?r=' . $key . 'z=' . 
$largesize . $query_string . '/div';
+  'br /a href=./graph.php?r=' . $key . 'z=' . $xlargesize . 
$query_string . 'img alt=Last ' . $key . ' src=graph.php?r=' . 
$key . 'z=' . $largesize . $query_string . '/a/div';
 
 }
 // The div below needs to be added to clear float left since in aggregate 
view things



Markus
-- 
Markus Köberl
Graz University of Technology
Signal Processing and Speech Communication Laboratory
E-mail: markus.koeb...@tugraz.at

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers