Changeset 836


Ignore:
Timestamp:
04/24/13 15:50:30 (8 years ago)
Author:
ramonb
Message:

libtoga.php:

  • calculate parsetime

templates/footer.tpl:

  • made parsetime optional

index.php:

  • don't show parsetime for archive: not applicable

overview.php:

  • assign parsetime
  • closes #161
Location:
branches/1.0/web/addons/job_monarch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/web/addons/job_monarch/index.php

    r821 r836  
    435435function makeFooter()
    436436{
    437     global $dwoo, $version, $parsetime, $monarchversion;
     437    global $dwoo, $version, $parsetime, $monarchversion, $view;
    438438
    439439    $tpl = new Dwoo_Template_File("templates/footer.tpl");
     
    454454    }
    455455
    456     $tpl_data->assign("parsetime", sprintf("%.4f", $parsetime) . "s");
     456    if( isset( $parsetime ) && ($view !== "search" ) )
     457    {
     458        $tpl_data->assign("showparsetime", "yes" );
     459        $tpl_data->assign("parsetime", sprintf("%.4f", $parsetime) . "s");
     460    }
    457461
    458462    $dwoo->output($tpl, $tpl_data);
  • branches/1.0/web/addons/job_monarch/libtoga.php

    r820 r836  
    564564    function DataGatherer( $cluster )
    565565    {
    566         $this->cluster    = $cluster;
    567         $this->httpvars = $httpvars;
     566        $this->cluster   = $cluster;
     567        $this->httpvars  = $httpvars;
     568        $this->parsetime = 0;
    568569    }
    569570
     
    574575        $this->xmlhandler     = new TorqueXMLHandler( $this->cluster );
    575576
     577        $start = gettimeofday();
     578
    576579        xml_parser_set_option( $this->parser, XML_OPTION_CASE_FOLDING, 0 );
    577580        xml_set_element_handler( $this->parser, array( &$this->xmlhandler, 'startElement' ), array( &$this->xmlhandler, 'stopElement' ) );
     
    583586        $handler = &$this->xmlhandler;
    584587        $handler->finishUp();
     588
     589        $end = gettimeofday();
     590
     591        $this->parsetime = ($end['sec'] + $end['usec']/1e6) - ($start['sec'] + $start['usec']/1e6);
    585592    }
    586593
  • branches/1.0/web/addons/job_monarch/overview.php

    r828 r836  
    5050$data_gatherer->parseXML( $myxml_data );
    5151
     52$parsetime = $data_gatherer->parsetime;
    5253$heartbeat = $data_gatherer->getHeartbeat();
    5354$jobs      = $data_gatherer->getJobs();
  • branches/1.0/web/addons/job_monarch/templates/footer.tpl

    r753 r836  
    77Ganglia web version {$webfrontendversion}<BR>
    88
     9{if "$showparsetime" == "yes"}
    910Downloading and parsing ganglia's XML tree took {$parsetime}.<BR>
     11{/if}
    1012Images created with <A HREF="http://www.rrdtool.org/">RRDTool</A>.<BR>
    1113</FONT>
Note: See TracChangeset for help on using the changeset viewer.