Ignore:
Timestamp:
01/26/09 16:03:50 (15 years ago)
Author:
ramonb
Message:

job_monarch/css/styles.css:

  • changed padding for rrds

job_monarch/js/jobgrid.js:

  • parse more rrds args

job_monarch/jobstore.php:

  • also supply jobrange, start and load
Location:
trunk/web2/addons/job_monarch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/web2/addons/job_monarch/css/styles.css

    r570 r571  
    3939{
    4040   float: left;
    41    margin: 4px;
     41   margin: 2px;
    4242   margin-right: 0;
    43    padding: 5px;
     43   padding: 2px;
    4444}
  • trunk/web2/addons/job_monarch/jobstore.php

    r569 r571  
    3535}
    3636
    37 global $c, $clustername, $cluster;
     37global $c, $clustername, $cluster, $metrics;
    3838
    3939// Grid Paging stuff
     
    422422function getNodes()
    423423{
    424         global $jobs, $jobids, $clustername;
     424        global $jobs, $jobids, $clustername, $metrics;
    425425
    426426        $display_nodes  = array();
     
    438438                                if( !in_array( $jobnode, $display_nodes) )
    439439                                {
    440                                         $display_nodes[]        = $jobnode;
     440                                        $display_nodes[$jobid]  = $jobnode;
    441441                                }
    442442                        }
    443443                }
    444444        }
    445         //print_r( $display_nodes );
     445
    446446        $node_results   = array();
    447447        $result_count   = count( $display_nodes );
    448         foreach( $display_nodes as $dnode )
    449         {
    450 
     448        foreach( $display_nodes as $jobid => $host )
     449        {
    451450                $nr             = array();
    452451                $nr['c']        = $clustername;
    453                 $nr['h']        = $dnode;
     452                $nr['h']        = $host ;
    454453                $nr['x']        = '5';
    455454                $nr['v']        = '0';
     455
     456                $cpus           = $metrics[$host]["cpu_num"]["VAL"];
     457
     458                if ( !$cpus )
     459                {
     460                        $cpus           = 1;
     461                }
     462
     463                $load_one       = $metrics[$host]["load_one"]["VAL"];
     464                $load           = ((float) $load_one) / $cpus;
     465                $load_color     = load_color($load);
     466
     467                $nr['l']        = $load_color;
     468
     469                $job_runtime    = (int) $jobs[$jobid]['reported'] - (int) $jobs[$jobid]['start_timestamp'];
     470                $job_window     = intval($job_runtime * 1.2);
     471
     472                $nr['jr']       = -$job_window;
     473                $nr['js']       = (int) $jobs[$jobid]['start_timestamp'];
    456474
    457475                $node_results[] = $nr;
  • trunk/web2/addons/job_monarch/js/jobgrid.js

    r570 r571  
    595595        {name: 'c', type: 'string', mapping: 'c'},
    596596        {name: 'h', type: 'string', mapping: 'h'},
     597        {name: 'x', type: 'string', mapping: 'x'},
    597598        {name: 'v', type: 'string', mapping: 'v'},
    598         {name: 'x', type: 'string', mapping: 'x'}
     599        {name: 'l', type: 'string', mapping: 'l'},
     600        {name: 'jr', type: 'string', mapping: 'jr'},
     601        {name: 'js', type: 'string', mapping: 'js'}
    599602      ]),
    600603      listeners: {
     
    634637        tpl: new Ext.XTemplate(
    635638            '<tpl for=".">',
    636             '<div class="rrd-float"><img src="../../graph.php?z=small&h={h}&x={x}&v={v}&c={c}" border="0"></div>',
     639            '<div class="rrd-float"><img src="../../graph.php?z=small&c={c}&h={h}&l={l}&v={v}&x={x}&r=job&jr={jr}&js={js}" border="0"></div>',
    637640            '</tpl>'
    638641        )
     
    641644    var images = new Ext.Panel({
    642645        id:'images',
    643         title:'My Images',
     646        //title:'My Images',
    644647        region:'center',
    645648        bodyStyle: 'background: transparent',
    646         margins: '5 5 5 0',
     649        //margins: '2 2 2 0',
    647650        layout:'fit',
    648651        items: GraphView
     
    655658                        height      : 300,
    656659                        closeAction :'hide',
     660                        title:  'Node graph details',
    657661                        layout: 'fit',
    658662                        tbar:   new Ext.form.ComboBox({
     
    668672                                        selectOnFocus:true,
    669673                                        xtype: 'combo',
    670                                         width:190
     674                                        width:190,
     675                                        listeners: {
     676                                                select: function(combo, record, index){
     677                                                        var metric = record.data.name;
     678                                                        // doe iets
     679                                                }
     680                                        }
     681                                       
    671682                                }),
    672683                        items:  [ images ]
Note: See TracChangeset for help on using the changeset viewer.