IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30465 for trunk/tools/psstatus


Ignore:
Timestamp:
Feb 2, 2011, 3:27:26 PM (15 years ago)
Author:
bills
Message:

add dependent count

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/psstatus

    r30464 r30465  
    5757    IFNULL(completedJobs,0) AS 'Completed Jobs',
    5858    IFNULL(runningJobs, 0) AS 'Pending Jobs',
    59     IFNULL(faultedJobs, 0) AS 'Faulted Jobs'
     59    IFNULL(faultedJobs, 0) AS 'Faulted Jobs',
     60    IFNULL(depcount, 0) AS 'Image updates'
    6061    -- timestamp AS 'last state change (UTC)'
    6162FROM (
     
    7273        OR pstampRequest.state = 'run.wait'
    7374) as unfinishedReq
    74 JOIN (
     75LEFT JOIN (
    7576    SELECT req_id,
    7677        count(job_id)          AS jobcount,
     
    8283) as rowCounts
    8384ON unfinishedReq.req_id = rowCounts.req_id
     85
     86LEFT JOIN (
     87    SELECT req_id,
     88        count(distinct dep_id) AS depcount
     89FROM pstampRequest
     90    JOIN pstampJob USING(req_id)
     91    JOIN pstampDependent USING(dep_id)
     92    WHERE (pstampRequest.state = 'run' or pstampRequest.state = 'new'
     93            OR pstampRequest.state = 'run.wait')
     94        AND dep_id > 0
     95        AND pstampDependent.state = 'full'
     96    GROUP BY req_id
     97) as depCounts
     98ON unfinishedReq.req_id = depCounts.req_id
     99
    84100LEFT JOIN (
    85101    SELECT req_id,
     
    93109) as runningJobs
    94110ON unfinishedReq.req_id = runningJobs.req_id
     111
    95112LEFT JOIN (
    96113    SELECT req_id,
     
    178195LEFT JOIN (
    179196    SELECT req_id,
     197        count(distinct dep_id) AS depcount
     198FROM pstampRequest JOIN pstampJob USING(req_id)
     199    WHERE pstampRequest.state = 'stop'
     200        AND date_add(timestamp, interval 1 day) >=utc_timestamp()
     201        AND dep_id > 0
     202    GROUP BY req_id
     203) as depCounts
     204ON finishedReq.req_id = depCounts.req_id
     205
     206LEFT JOIN (
     207    SELECT req_id,
    180208        count(job_id) AS success
    181209    FROM pstampRequest JOIN pstampJob USING(req_id)
     
    216244
    217245{
    218 #    print STDERR "$sql\n";
     246    print STDERR "$sql\n" if $verbose;
    219247    my @args = ( "--table", "--user=$dbuser",  "--host=$dbserver", "--password=$dbpassword", $dbname);
    220248
Note: See TracChangeset for help on using the changeset viewer.