From 4b96dd01a3283a5dbcd6e859e8713102dc685937 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 18 Jun 2012 18:48:19 +0200 Subject: [PATCH] add more profiling points --- planetlab/slices/slice.php | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/planetlab/slices/slice.php b/planetlab/slices/slice.php index af265b6..3b27b11 100644 --- a/planetlab/slices/slice.php +++ b/planetlab/slices/slice.php @@ -55,7 +55,7 @@ if (empty($slices)) { $slice=$slices[0]; -if ($profiling) plc_debug_prof('1: slice',count($slices)); +if ($profiling) plc_debug_prof('01: slice',count($slices)); // pull all node info to vars $name= $slice['name']; $expires = date( "d/m/Y", $slice['expires'] ); @@ -68,7 +68,7 @@ $peer_id= $slice['peer_id']; $peers=new Peers ($api); $local_peer = ! $peer_id; -if ($profiling) plc_debug_prof('2: peers',count($peers)); +if ($profiling) plc_debug_prof('02: peers',count($peers)); // gets site info $sites= $api->GetSites( array( $site_id ) ); @@ -76,7 +76,7 @@ $site=$sites[0]; $site_name= $site['name']; $max_slices = $site['max_slices']; -if ($profiling) plc_debug_prof('3: sites',count($sites)); +if ($profiling) plc_debug_prof('03: sites',count($sites)); //////////////////////////////////////// building blocks for the renew area // Constants global $DAY; $DAY = 24*60*60; @@ -280,7 +280,7 @@ $potential_persons= $person_columns); $count=count($persons); -if ($profiling) plc_debug_prof('4: persons',count($persons)); +if ($profiling) plc_debug_prof('04: persons',count($persons)); $toggle= new PlekitToggle ('my-slice-persons',"$count users", array('bubble'=> @@ -548,7 +548,7 @@ foreach ($all_nodes as $node) { $potential_nodes[]=$node; } } -if ($profiling) plc_debug_prof('5: nodes',count($slice_nodes)); +if ($profiling) plc_debug_prof('05: nodes',count($slice_nodes)); //////////////////// // outline the number of reservable nodes $nodes_message=count_english($slice_nodes,"node"); @@ -628,6 +628,7 @@ EOF; $toggle_nodes->end(); } +if ($profiling) plc_debug_prof('06: leases',0); //////////////////// node configuration panel if ($first_time_configuration) @@ -666,12 +667,15 @@ print("
"); print(""); +if ($profiling) plc_debug_prof('07: before configuration_panel',0); $ConfigureColumns->configuration_panel_html(true); +if ($profiling) plc_debug_prof('08: before javascript_init',0); $ConfigureColumns->javascript_init(); $toggle_nodes->end(); +if ($profiling) plc_debug_prof('09: layout',0); $all_sites=$api->GetSites(NULL, array('site_id','login_base')); $site_hash=array(); @@ -685,8 +689,7 @@ $interface_hash=array(); foreach ($interfaces as $interface) $interface_hash[$interface['node_id']]=$interface; - - +if ($profiling) plc_debug_prof('10: interfaces',count($interfaces)); //////////////////// nodes currently in $toggle_nodes=new PlekitToggle('my-slice-nodes-current', @@ -732,7 +735,7 @@ $table->start(); if ($slice_nodes) foreach ($slice_nodes as $node) { $table->row_start(); -$table->cell($node['node_id'], array('display'=>'none')); + $table->cell($node['node_id'], array('display'=>'none')); $table->cell(l_node_obj($node)); $peers->cell($table,$node['peer_id']); @@ -773,6 +776,8 @@ if ($privileges) { $table->end(); $toggle_nodes->end(); +if ($profiling) plc_debug_prof('11: nodes in',count($slice_nodes)); + //////////////////// nodes to add if ($privileges) { $new_potential_nodes = array(); @@ -822,7 +827,7 @@ $notes [] = "For information about the different columns please see the node if ($potential_nodes) foreach ($potential_nodes as $node) { $table->row_start(); -$table->cell($node['node_id'], array('display'=>'none')); + $table->cell($node['node_id'], array('display'=>'none')); $table->cell(l_node_obj($node)); $peers->cell($table,$node['peer_id']); @@ -858,6 +863,8 @@ $table->cell($node['node_id'], array('display'=>'none')); $toggle->end(); +if ($profiling) plc_debug_prof('12: nodes to add',count($potential_nodes)); + //////////////////////////////////////// retrieve all slice tags $tags=$api->GetSliceTags (array('slice_id'=>$slice_id)); //////////////////////////////////////////////////////////// tab:initscripts @@ -896,7 +903,7 @@ The slice-specific setting has precedence on a shared initscript. $shared_initscripts=$api->GetInitScripts(array('-SORT'=>'name'),array('name')); //$shared_initscripts=$api->GetInitScripts(); -if ($profiling) plc_debug_prof('6 initscripts',count($initscripts)); +if ($profiling) plc_debug_prof('13: initscripts',count($initscripts)); // xxx expose this even on foreign slices for now if ($local_peer) { $initscript=''; @@ -988,7 +995,7 @@ $tag_value_threshold=24; // xxx expose this even on foreign slices for now //if ( $local_peer ) { - if ($profiling) plc_debug_prof('7 slice tags',count($tags)); + if ($profiling) plc_debug_prof('14: slice tags',count($tags)); function get_tagname ($tag) { return $tag['tagname'];} $tagnames = array_map ("get_tagname",$tags); @@ -1033,7 +1040,7 @@ $tag_value_threshold=24; $nodegroup_name="n/a"; if ($tag['nodegroup_id']) { $nodegroups=$api->GetNodeGroups(array('nodegroup_id'=>$tag['nodegroup_id'])); - if ($profiling) plc_debug_prof('8 nodegroup for slice tag',$nodegroup); + if ($profiling) plc_debug_prof('15: nodegroup for slice tag',$nodegroup); if ($nodegroup) { $nodegroup = $nodegroups[0]; $nodegroup_name = $nodegroup['groupname']; @@ -1061,7 +1068,7 @@ $tag_value_threshold=24; return array("display"=>$tag['tagname'],"value"=>$tag['tag_type_id']); } $all_tags= $api->GetTagTypes( array ("category"=>"*slice*","-SORT"=>"+tagname"), array("tagname","tag_type_id")); - if ($profiling) plc_debug_prof('9 tagtypes',count($all_tags)); + if ($profiling) plc_debug_prof('16: tagtypes',count($all_tags)); $selector_tag=array_map("tag_selector",$all_tags); function node_selector($node) { @@ -1073,7 +1080,7 @@ $tag_value_threshold=24; return array("display"=>$ng["groupname"],"value"=>$ng['nodegroup_id']); } $all_nodegroups = $api->GetNodeGroups( array("groupname"=>"*"), array("groupname","nodegroup_id")); - if ($profiling) plc_debug_prof('10 nodegroups',count($all_nodegroups)); + if ($profiling) plc_debug_prof('17: nodegroups',count($all_nodegroups)); $selector_nodegroup=array_map("nodegroup_selector",$all_nodegroups); $table->cell($form->select_html("tag_type_id",$selector_tag,array('label'=>"Choose Tag"))); -- 2.43.0