IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36477 for trunk/ippMonitor


Ignore:
Timestamp:
Feb 5, 2014, 2:11:44 PM (12 years ago)
Author:
bills
Message:

We are on the way to deprecating the 'update' version of czartool. Fix the counts of runs and faults in update state;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/czartool/czartool/Gpc1Db.pm

    r33814 r36477  
    139139    my $stateCol =  $table.".state";
    140140
     141    my $extraState = "";
     142    if ($state eq 'new') {
     143        $extraState = " OR $stateCol = 'update' ";
     144    }
     145
    141146    my $query =  $self->{_db}->prepare(<<SQL);
    142147    SELECT COUNT(DISTINCT $id)
     
    144149        JOIN $joinTable USING ($id)
    145150        WHERE label LIKE '$label'
    146         AND (($faultCol != 0 AND $stateCol = '$state') OR $stateCol = 'failed_revert')
     151        AND ($faultCol != 0 AND ($stateCol = '$state' $extraState))
    147152SQL
    148153    $query->execute;
     
    208213    my $query = undef;
    209214
     215    my $joinTable = undef;
     216    my $id = undef;
     217    if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;}
     218
     219    # XXX: the "update" page is now obsolete. The standard processing page should now show
     220    # counts in new and update state
    210221    if ($state eq "update") {
    211 
    212222        if ($stage eq "dist") {return 0;}
    213         my $joinTable = undef;
    214         my $id = undef;
    215         if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;}
    216223
    217224        if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") {
     
    227234        else {
    228235       
     236        }
     237
     238    }
     239    # 'new' stuff really includes 'update' stuff, at least for LAP. This is a hack, but there you go   
     240    elsif ($state eq "new") {
     241
     242        if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") {
     243            # get count of runs in new state and update state that have components left to update
     244            $query = $self->{_db}->prepare(<<SQL);
     245            SELECT COUNT(DISTINCT $id) 
     246                FROM $table LEFT JOIN $joinTable
     247                USING($id)
     248                WHERE label LIKE '$label'
     249                AND (state = 'new' OR (state = 'update' AND data_state = 'update'))
     250SQL
     251        } else {
    229252            $query = $self->{_db}->prepare(<<SQL);
    230253            SELECT COUNT(state)
    231                 FROM $table JOIN $joinTable
    232                 USING($id)
     254                FROM $table
    233255                WHERE label LIKE '$label'
    234                 AND state = 'update';
     256                AND state = 'new';
    235257SQL
    236258        }
    237 
    238     }
    239     # 'new' stuff really includes 'update' stuff, at least for LAP. This is a hack, but there you go   
    240     elsif ($state eq "new") {
    241 
    242         $query = $self->{_db}->prepare(<<SQL);
    243         SELECT COUNT(state) 
    244             FROM $table
    245             WHERE label LIKE '$label'
    246             AND (state = 'new' OR state = 'update')
    247 SQL
    248259    }
    249260    else {
     
    256267SQL
    257268    }
     269
     270    # print $query->{Statement} . "\n";
    258271
    259272    $query->execute;
Note: See TracChangeset for help on using the changeset viewer.