Changeset 535 for trunk/web2


Ignore:
Timestamp:
07/10/08 15:54:35 (16 years ago)
Author:
ramonb
Message:
  • add tooltips & runningtime
Location:
trunk/web2/addons/job_monarch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web2/addons/job_monarch/jobstore.php

    r534 r535  
    5252function getList()
    5353{
    54         global $jobs;
     54        global $jobs, $hearbeat;
    5555
    56         //print_r( $jobs );
    5756        $job_count      = count( $jobs );
    5857
     
    6766        foreach( $jobs as $jobid => $jobattrs )
    6867        {
    69                 if( $reported != $heartbeat )
    70                 { // Old job: skip
    71                         continue;
    72                 }
     68                //if( $jobattrs['reported'] != $heartbeat )
     69                //{
     70                //      continue;
     71                //}
    7372
    7473                $jr['jid']              = strval( $jobid );
     
    7978                $jr['requested_time']   = makeTime( timeToEpoch( $jobattrs['requested_time'] ) );
    8079
    81                 if( $jobattrs[status] == 'R' )
     80                if( $jr['status'] == 'R' )
    8281                {
    8382                        $nodes          = count( $jobattrs[nodes] );
     
    8887                }
    8988
    90                 //unset( $jr['nodes'] );
    91                 //unset( $jr['poll_interval'] );
    92                 //unset( $jr['reported'] );
     89                $jr['ppn']              = strval( $jobattrs[ppn] ? $jobattrs[ppn] : 1 );
     90                $jr['nodect']           = strval( $nodes );
    9391
    94                 $jr['ppn']              = strval( $jobattrs[ppn] ? $jobattrs[ppn] : 1 );
    95                 $jr['cpu']              = strval( $nodes * (int) $ppn );
    96 
    97 
    98                 if( $jobattrs[status] == 'R' )
     92                if( $jr['status'] == 'R' )
    9993                {
    10094                        $jr['nodes']    = implode( ",", $jobattrs['nodes'] );
     95                }
     96                else
     97                {
     98                        $jr['nodes']    = "";
    10199                }
    102100
    103101                $jr['queued_timestamp'] = makeDate( $jobattrs['queued_timestamp'] );
    104102                $jr['start_timestamp']  = ($jobattrs['start_timestamp'] ? makeDate( $jobattrs['start_timestamp'] ) : "");
     103
     104                if( $jr['status'] == 'R' )
     105                {
     106                        $runningtime            = (int) $jobattrs['reported'] - (int) $jobattrs['start_timestamp'];
     107                        $jr['runningtime']      = makeTime( $runningtime );
     108                }
     109                else
     110                {
     111                        $jr['runningtime']      = "";
     112                }
    105113
    106114                $jobresults[]           = $jr;
  • trunk/web2/addons/job_monarch/js/jobgrid.js

    r534 r535  
    33var JobListingEditorGrid;
    44var JobListingWindow;
     5var JobProxy;
    56
    67Ext.onReady(function(){
     
    3031        //{name: 'requested_memory', type: 'string', mapping: 'requested_memory'},
    3132        {name: 'ppn', type: 'int', mapping: 'ppn'},
    32         {name: 'cpu', type: 'int', mapping: 'cpu'},
     33        {name: 'nodect', type: 'int', mapping: 'nodect'},
    3334        {name: 'nodes', type: 'string', mapping: 'nodes'},
    3435        {name: 'queued_timestamp', type: 'string', mapping: 'queued_timestamp'},
    35         {name: 'start_timestamp', type: 'string', mapping: 'start_timestamp'}
     36        {name: 'start_timestamp', type: 'string', mapping: 'start_timestamp'},
     37        {name: 'runningtime', type: 'string', mapping: 'runningtime'}
    3638      ]),
    3739      sortInfo:{field: 'jid', direction: "ASC"}
     
    4143    [{
    4244        header: '#',
     45        tooltip: 'Job id',
    4346        readOnly: true,
    4447        dataIndex: 'jid',
     
    4750      },{
    4851        header: 'S',
     52        tooltip: 'Job status',
    4953        readOnly: true,
    5054        dataIndex: 'status',
     
    5357      },{
    5458        header: 'User',
     59        tooltip: 'Owner of job',
    5560        readOnly: true,
    5661        dataIndex: 'owner',
     
    5964      },{
    6065        header: 'Queue',
     66        tooltip: 'In which queue does this job reside',
    6167        readOnly: true,
    6268        dataIndex: 'queue',
     
    6571      },{
    6672        header: 'Name',
     73        tooltip: 'Name of job',
    6774        readOnly: true,
    6875        dataIndex: 'name',
     
    7178      },{
    7279        header: 'Requested Time',
     80        tooltip: 'Amount of requested time (wallclock)',
    7381        readOnly: true,
    7482        dataIndex: 'requested_time',
     
    7785      },{
    7886        header: 'Requested Memory',
     87        tooltip: 'Amount of requested memory',
    7988        readOnly: true,
    8089        dataIndex: 'requested_memory',
     
    8291        hidden: true
    8392      },{
    84         header: 'PPN',
     93        header: 'P',
     94        tooltip: 'Number of processors per node (PPN)',
    8595        readOnly: true,
    8696        dataIndex: 'ppn',
     
    8898        hidden: false
    8999      },{
    90         header: 'CPU',
     100        header: 'N',
     101        tooltip: 'Number of nodes (hosts)',
    91102        readOnly: true,
    92         dataIndex: 'ppn',
     103        dataIndex: 'nodect',
    93104        width: 25,
    94105        hidden: false
     
    101112      },{
    102113        header: 'Queued',
     114        tooltip: 'At what time did this job enter the queue',
    103115        readOnly: true,
    104116        dataIndex: 'queued_timestamp',
     
    107119      },{
    108120        header: 'Started',
     121        tooltip: 'At what time did this job enter the running status',
    109122        readOnly: true,
    110123        dataIndex: 'start_timestamp',
     124        width: 140,
     125        hidden: false
     126      },{
     127        header: 'Runningtime',
     128        tooltip: 'How long has this job been in the running status',
     129        readOnly: true,
     130        dataIndex: 'runningtime',
    111131        width: 140,
    112132        hidden: false
     
    11731193      title: 'Cluster Jobs Overview',
    11741194      closable:true,
    1175       width:700,
    1176       height:350,
     1195      width:900,
     1196      height:500,
    11771197      plain:true,
    11781198      layout: 'fit',
     
    11811201
    11821202  //debug(); 
     1203  //JobListingEditorGrid.store.url='jobstore.php?c=GINA Cluster';
    11831204  JobsDataStore.load();
    1184   //JobListingEditorGrid.render();
    11851205  JobListingWindow.show();
    11861206 
Note: See TracChangeset for help on using the changeset viewer.