Changeset 9895


Ignore:
Timestamp:
08/26/10 14:33:11 (14 years ago)
Author:
Daniela Dorner
Message:
implemented status 'crashed' for list of runs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/datacenter/db/mcinfo.php

    r9617 r9895  
    2424                    if ($element==-1)
    2525                        $query0 .=  $key . " as '" . $alias[$key] . "' " . ", ";
    26                 /*
    27                  //--------------------------------------------------
    28                  //$query0 .= " TIMEDIFF(fRunStop, fRunStart), ";
    29                  // Only available in MySQL>4.1.1
    30                  $query0 .= "SUM(if(TIME_TO_SEC(fRunStop)-TIME_TO_SEC(fRunStart)<0, " .
    31                  "TIME_TO_SEC(fRunStop)-TIME_TO_SEC(fRunStart)+24*60*60, " .
    32                  "TIME_TO_SEC(fRunStop)-TIME_TO_SEC(fRunStart)))/3600 as '" . $alias["SUM(fRunTime)/3600"] . "', ";
    33                  //--------------------------------------------------
    34                  $query0 .= " SUM(fNumEvents) as '" . $alias["SUM(fNumEvents)"] . "', ";
    35                  $query0 .= " Min(fZenithDistance) as '" . $alias["Min(fZenithDistance)"] . "', ";
    36                  $query0 .= " Max(fZenithDistance) as '" . $alias["Max(fZenithDistance)"] . "', ";
    37                  */
    3826            }
    3927
     
    8068                        $query0 .= " ISNULL(" . $key . "Status.fStopTime) AND ";
    8169                        $query0 .= " ISNULL(" . $key . "Status.fReturnCode), 'not done', ";
     70
    8271                        $query0 .= " IF (NOT ISNULL(" . $key . "Status.fStartTime) ";
    8372                        $query0 .= " AND ISNULL(" . $key . "Status.fStopTime) ";
    84                         $query0 .= " AND ISNULL(" . $key . "Status.fReturnCode), ";
    85                         $query0 .= " CONCAT('running (since ', " . $key . "Status.fStartTime, ')'), ";
     73                        $query0 .= " AND ISNULL(" . $key . "Status.fReturnCode) ";
     74                        $query0 .= " AND DATE_SUB(Now(),INTERVAL " . $timelimits[$key] . " HOUR) > " . $key . "Status.fStartTime, ";
     75                        $query0 .= " CONCAT('maybe crashed (started at ', " . $key . "Status.fStartTime, ')'), ";
     76
     77                        $query0 .= " IF (NOT ISNULL(" . $key . "Status.fStartTime) ";
     78                        $query0 .= " AND ISNULL(" . $key . "Status.fStopTime) ";
     79                        $query0 .= " AND ISNULL(" . $key . "Status.fReturnCode) ";
     80                        $query0 .= " AND DATE_SUB(Now(),INTERVAL " . $timelimits[$key] . " HOUR) < " . $key . "Status.fStartTime, ";
     81                        $query0 .= " CONCAT('running (started at ', " . $key . "Status.fStartTime, ')'), ";
     82
    8683                        $query0 .= " IF (NOT ISNULL(" . $key . "Status.fReturnCode), ";
    8784                        $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ', ', " . $key . "Status.fStopTime, ')'), ";
    8885                        $query0 .= " CONCAT('done (', " . $key . "Status.fStopTime, ";
    89                         $query0 .= " ', ', TIMEDIFF(" . $key . "Status.fStopTime, " . $key . "Status.fStartTime), ')')))) ";
    90 
    91                         //$query0 .= ", CONCAT( 'halo', " . $key . "Status.fStartTime)";
     86                        $query0 .= " ', ', TIMEDIFF(" . $key . "Status.fStopTime, " . $key . "Status.fStartTime), ')'))))) ";
     87
    9288                        $query0 .= " AS '" . $alias[$key] . "' ";
    93                         //echo "ereg: " . $key . "<br>";
    9489                    }
    9590                    else
Note: See TracChangeset for help on using the changeset viewer.