- Timestamp:
- 08/26/10 14:33:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/datacenter/db/mcinfo.php
r9617 r9895 24 24 if ($element==-1) 25 25 $query0 .= $key . " as '" . $alias[$key] . "' " . ", "; 26 /*27 //--------------------------------------------------28 //$query0 .= " TIMEDIFF(fRunStop, fRunStart), ";29 // Only available in MySQL>4.1.130 $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 */38 26 } 39 27 … … 80 68 $query0 .= " ISNULL(" . $key . "Status.fStopTime) AND "; 81 69 $query0 .= " ISNULL(" . $key . "Status.fReturnCode), 'not done', "; 70 82 71 $query0 .= " IF (NOT ISNULL(" . $key . "Status.fStartTime) "; 83 72 $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 86 83 $query0 .= " IF (NOT ISNULL(" . $key . "Status.fReturnCode), "; 87 84 $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ', ', " . $key . "Status.fStopTime, ')'), "; 88 85 $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 92 88 $query0 .= " AS '" . $alias[$key] . "' "; 93 //echo "ereg: " . $key . "<br>";94 89 } 95 90 else
Note:
See TracChangeset
for help on using the changeset viewer.