- Timestamp:
- Oct 27, 2019, 9:47:12 PM (7 years ago)
- Location:
- branches/ccl_branches/ipp-20190806/ippMonitor
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
raw/czartool_labels.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ccl_branches/ipp-20190806/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor (added) merged: 40862,40877-40879,40882-40883,40936
- Property svn:mergeinfo changed
-
branches/ccl_branches/ipp-20190806/ippMonitor/raw/czartool_labels.php
r40853 r40974 399 399 $qry2->fetchInto($summit); 400 400 401 401 402 $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'"; 402 403 $qry2 = $projectdb->query($sql); … … 407 408 $qry2->fetchInto($dropped); 408 409 410 411 #Query with 30 minutes delay to check during the night if any exposures are missing. 412 $datehour = gmdate("Y-m-d H:i:s"); 413 $sql = "SELECT COUNT(*) FROM summitExp left join pzDownloadExp using (summit_id) WHERE dateobs > '$date' AND dateobs <= date_sub('$datehour', interval 30 minute) AND exp_type = '$expType[0]' and (state != 'drop' or state is null) and fault != 1042"; 414 $qry2 = $projectdb->query($sql); 415 $qry2->fetchInto($summitdelay); 416 417 $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND summitExp.dateobs <= date_sub('$datehour', interval 30 minute) AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'"; 418 $qry2 = $projectdb->query($sql); 419 $qry2->fetchInto($mhpccdelay); 420 409 421 echo "<tr>"; 410 422 411 if ($summit[0] == $mhpcc[0]) $error = 0; 423 $DLdiff = $summit[0] - $mhpcc[0]; 424 if ($DLdiff == 0) $error = 0; 412 425 else $error = 1; 426 427 $delayDLdiff = $summitdelay[0] - $mhpccdelay[0]; 428 if ($delayDLdiff == 0) $errordelay = 0; 429 else $errordelay = 1; 413 430 414 431 echo "<td>$expType[0]</td>"; 415 432 echo "<td>$summit[0]</td>"; 416 createFormattedTableCell("", "", $mhpcc[0], $error, 0); 433 #createFormattedTableCell("", "", $mhpcc[0], $error, 0); 434 if ($delayDLdiff==0) { 435 createFormattedTableCell("", "", $mhpcc[0], $error, 0); 436 } else { 437 $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">$mhpcc[0] ($delayDLdiff)</font>"; 438 echo "<td>$DLStatus</td>"; 439 } 440 417 441 echo "<td>$dropped[0]</td>"; 418 442 … … 440 464 } 441 465 $qry->fetchInto($refExpID); 466 if ($refExpID[0] = 'NULL') { 467 $refExpID[0] = 0; 468 } 442 469 443 470 #Find the number of chunks … … 482 509 createTableColumnHeader("Chunk"); 483 510 createTableColumnHeader("Nobs_1stvisit"); 484 createTableColumnHeader("Nobs_4visits ");511 createTableColumnHeader("Nobs_4visits(bad cam)"); 485 512 createTableColumnHeader("Ndiffs_published"); 486 513 createTableColumnHeader("Completion"); … … 492 519 $Nfirstvisits = 0; 493 520 $Nfourvisits = 0; 521 $badcam = 0; 494 522 495 523 $chunkname = $row[0]; … … 533 561 } 534 562 563 #also query for bad quality camRun exposures 564 $query4 = "SELECT count(*) "; 565 $query4 .= " FROM rawExp"; 566 $query4 .= " JOIN chipRun USING (exp_id)"; 567 $query4 .= " JOIN camRun USING (chip_id)"; 568 $query4 .= " JOIN camProcessedExp USING (cam_id)"; 569 $query4 .= " WHERE dateobs LIKE '$date%'"; 570 $query4 .= " AND exp_id > $refExpID[0]"; 571 $query4 .= " AND exp_type = 'OBJECT'"; 572 $query4 .= " AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%'"; 573 $query4 .= " AND (camProcessedExp.quality > 0)"; 574 $qry4 = $projectdb->query($query4); 575 $qry4->fetchInto($badcam); 576 577 578 535 579 echo "<tr>"; 536 580 537 581 echo "<td>$chunkname</td>"; 538 582 echo "<td>$Nfirstvisits</td>"; 539 echo "<td>$Nfourvisits</td>"; 583 if ($badcam[0]==0) { 584 echo "<td>$Nfourvisits</td>"; 585 } else { 586 $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">$Nfourvisits ($badcam[0])</font>"; 587 echo "<td>$DLStatus</td>"; 588 } 540 589 echo "<td>$Ndiffs</td>"; 541 590 echo "<td>$complete</td>"; … … 944 993 foreach ($servers as &$server) { 945 994 946 getServerStatus($db, $server, $alive, $running);995 getServerStatus($db,$proj, $server, $alive, $running); 947 996 948 997 echo "<tr>\n"; … … 1036 1085 # 1037 1086 ########################################################################### 1038 function getServerStatus($db, $server, &$alive, &$running) {1039 1040 $sql = "SELECT alive, running FROM s ervers WHERE server LIKE '$server' ORDER BY timestamp DESC LIMIT 1";1087 function getServerStatus($db,$proj, $server, &$alive, &$running) { 1088 1089 $sql = "SELECT alive, running FROM science_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1"; 1041 1090 if($debug){echo "$sql<br>";} 1042 1091
Note:
See TracChangeset
for help on using the changeset viewer.
