Changeset 42902
- Timestamp:
- Jun 24, 2025, 4:30:05 PM (13 months ago)
- Location:
- trunk/ippMonitor
- Files:
-
- 2 edited
-
def/stackInputSkyfile.d (modified) (1 diff)
-
raw/czartool_labels.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/def/stackInputSkyfile.d
r40882 r42902 1 TABLE stackInputSkyfile JOIN stackRun USING (stack_id) JOIN warpRun USING (warp_id) JOIN warpSkyfile USING (warp_id ) JOIN fakeRun USING (fake_id) JOIN camRun USING (cam_id) JOIN camProcessedExp USING (cam_id) JOIN chipRun USING (chip_id) JOIN rawExp USING (exp_id)1 TABLE stackInputSkyfile JOIN stackRun USING (stack_id) JOIN warpRun USING (warp_id) JOIN warpSkyfile USING (warp_id, skycell_id) JOIN fakeRun USING (fake_id) JOIN camRun USING (cam_id) JOIN camProcessedExp USING (cam_id) JOIN chipRun USING (chip_id) JOIN rawExp USING (exp_id) 2 2 TITLE Stack Input Exposures 3 3 FILE stackInputSkyfile.php -
trunk/ippMonitor/raw/czartool_labels.php
r42858 r42902 1412 1412 } else { 1413 1413 if ($qry->fetchInto($row)) { 1414 list($host, $total, $available, $used, $writable, $readable, $ratio) = $row; 1415 $storageInfo = "<td>$ratio% of $total</td>"; 1414 list($host, $total, $available, $used, $writable, $readable, $ratioStr) = $row; 1415 $ratio = floatval($ratioStr); // convert to number 1416 1417 // Determine color 1418 if ($ratio < 80) { 1419 $color = 'lightgreen'; 1420 } elseif ($ratio <= 90) { 1421 $color = 'yellow'; 1422 } else { 1423 $color = 'pink'; 1424 } 1425 1426 $storageInfo = "<td style=\"background-color: $color;\">$ratioStr% of $total</td>"; 1416 1427 } else { 1417 1428 $storageInfo = "<td>No host storage data</td>"; … … 1421 1432 $dbRepl = DB::connect("mysql://$replUser:$replPassword@$replHost"); 1422 1433 if (PEAR::isError($dbRepl)) { 1423 echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: red; color: white;\">MySQL DB connection error - check configuration</td></tr>";1434 echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: pink;\">MySQL DB connection error - check configuration</td></tr>"; 1424 1435 return -1; // Don't stop the rest of the script 1425 1436 } … … 1428 1439 $res = $dbRepl->query('SHOW SLAVE STATUS'); 1429 1440 if (PEAR::isError($res)) { 1430 echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: red; color: white;\">MySQL query error - invalid user or privileges</td></tr>";1441 echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: pink;\">MySQL query error - invalid user or privileges</td></tr>"; 1431 1442 $dbRepl->disconnect(); 1432 1443 return -1; … … 1434 1445 1435 1446 if (!$res->fetchInto($row)) { 1436 echo "<tr><td>$replDatabaseName</td>$storageInfo<td >No replication data available</td></tr>";1447 echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: pink;\">No replication data available</td></tr>"; 1437 1448 $dbRepl->disconnect(); 1438 1449 return 0; … … 1449 1460 $replStatus = ($errorStatusInMySql == 0) 1450 1461 ? "OK ($sec_behind sec behind)" 1451 : "<span style=\" background-color: yellow; color: red;\">PROBLEM</span>";1462 : "<span style=\"color: red;\"><strong>PROBLEM</strong></span>"; 1452 1463 1453 1464 echo "<tr><td>$replDatabaseName</td>$storageInfo"; 1454 1465 1466 echo "<td>$replStatus</td></tr>"; 1467 1455 1468 if ($errorStatusInMySql != 0) { 1456 echo "<tr><td colspan=\"5\">Connect to <strong>$replDatabaseName</strong>, run <code>SHOW SLAVE STATUS</code>, and resolve the issue. "; 1457 echo "See <a href=\"https://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html\" target=\"_blank\">MySQL Docs</a>.</td></tr>"; 1458 } 1459 1460 echo "<td>$replStatus</td>"; 1469 echo "<tr><td colspan=\"5\" style=\"background-color: pink;\"><center>Connect to $hostPrefix replication database, run 'SHOW SLAVE STATUS', and fix the problem. "; 1470 echo "See <a href=\"https://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html\" target=\"_blank\"><font color=\"blue\">MySQL Docs</a></font></center></td></tr>"; 1471 } 1461 1472 1462 1473 $dbRepl->disconnect(); … … 1490 1501 } else { 1491 1502 if ($qry->fetchInto($row)) { 1492 list($host, $total, $available, $used, $writable, $readable, $ratio) = $row; 1493 $storageInfo = "<td>$ratio% of $total </td>"; 1503 list($host, $total, $available, $used, $writable, $readable, $ratioStr) = $row; 1504 $ratio = floatval($ratioStr); // convert to number 1505 1506 // Determine color 1507 if ($ratio < 80) { 1508 $color = 'lightgreen'; 1509 } elseif ($ratio <= 90) { 1510 $color = 'yellow'; 1511 } else { 1512 $color = 'pink'; 1513 } 1514 1515 $storageInfo = "<td style=\"background-color: $color;\">$ratioStr% of $total</td>"; 1494 1516 } else { 1495 1517 $storageInfo = "<td>No host storage data</td>"; … … 1596 1618 if ($debug) {echo "$sql<br>";} 1597 1619 1620 1598 1621 $qry = $projectdb->query($sql); 1599 1622 while ($qry->fetchInto($tmp)) { 1600 1623 list($expType, $downloadState, $rawState, $count, $summit_exp, $pz_exp, $raw_exp) = $tmp; 1624 if ($proj == "gpc1") { 1625 $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/summit/ds/gpc1/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>"; 1626 } else { 1627 $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/conductorb/ds/gpc2/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>"; 1628 } 1601 1629 if ($downloadState == NULL) { 1602 echo "<tr><td> $ expType ($summit_exp)<td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";1630 echo "<tr><td> $summit_exp_link $expType <td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count"; 1603 1631 } else { 1604 1632 if ($downloadState == 'run') { 1605 echo "<tr><td> $ expType ($summit_exp) <td> summit_copy ($pz_exp) <td> saving ($pz_exp)<td bgcolor=$columnHeaderColor> <font color=\"red\">$count";1633 echo "<tr><td> $summit_exp_link $expType <td> $pz_exp copying <td> $pz_exp saving <td bgcolor=$columnHeaderColor> <font color=\"red\">$count"; 1606 1634 } else { 1607 1635 if ($rawState == NULL) { 1608 echo "<tr><td> $ expType ($summit_exp) <td> $downloadState ($pz_exp) <td> registering ($pz_exp)<td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";1609 } else { 1610 echo "<tr><td> $ expType ($summit_exp) <td> $downloadState ($pz_exp) <td> $rawState ($raw_exp)<td> $count";1636 echo "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $pz_exp registering <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count"; 1637 } else { 1638 echo "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $raw_exp $rawState <td> $count"; 1611 1639 } 1612 1640 } … … 1629 1657 AND summitExp.exp_name LIKE '$expnamem1' ORDER BY summitExp.dateobs desc) as sub 1630 1658 GROUP BY sum_type, pzstate, rawstate"; 1631 // $sql = "1632 // SELECT summitExp.exp_type, pzDownloadExp.state, rawExp.state, COUNT(*)1633 // FROM summitExp1634 // LEFT JOIN pzDownloadExp USING (summit_id)1635 // LEFT JOIN rawExp ON summitExp.exp_name = rawExp.exp_name1636 // WHERE summitExp.summit_id >= (1637 // SELECT COALESCE(MIN(summit_id), 0)1638 // FROM summitExp1639 // WHERE exp_name LIKE '$expnamem5'1640 // )1641 // AND summitExp.exp_name LIKE '$expnamem1'1642 // GROUP BY summitExp.exp_type, pzDownloadExp.state, rawExp.state";1643 1659 if ($debug) {echo "$sql<br>";} 1644 1660 … … 1646 1662 while ($qry->fetchInto($tmp)) { 1647 1663 list($expType, $downloadState, $rawState, $count, $summit_exp, $pz_exp, $raw_exp) = $tmp; 1664 if ($proj == "gpc1") { 1665 $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/summit/ds/gpc1/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>"; 1666 } else { 1667 $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/conductorb/ds/gpc2/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>"; 1668 } 1648 1669 if ($downloadState == NULL) { 1649 echo "<tr><td> $ expType ($summit_exp)<td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";1670 echo "<tr><td> $summit_exp_link $expType <td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count"; 1650 1671 } else { 1651 1672 if ($downloadState == 'run') { 1652 echo "<tr><td> $ expType ($summit_exp) <td> summit_copy ($pz_exp) <td> saving ($pz_exp)<td bgcolor=$columnHeaderColor> <font color=\"red\">$count";1673 echo "<tr><td> $summit_exp_link $expType <td> $pz_exp copying <td> $pz_exp saving <td bgcolor=$columnHeaderColor> <font color=\"red\">$count"; 1653 1674 } else { 1654 1675 if ($rawState == NULL) { 1655 echo "<tr><td> $ expType ($summit_exp) <td> $downloadState ($pz_exp) <td>registering <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";1656 } else { 1657 echo "<tr><td> $ expType ($summit_exp) <td> $downloadState ($pz_exp) <td> $rawState ($raw_exp)<td> $count";1676 echo "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $pz_exp registering <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count"; 1677 } else { 1678 echo "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $raw_exp $rawState <td> $count"; 1658 1679 } 1659 1680 } 1660 1681 } 1661 1682 } 1662 //while ($qry->fetchInto($tmp)) {1663 // list($expType, $downloadState, $rawState, $count) = $tmp;1664 // if ($downloadState == NULL) {1665 // echo "<tr><td> $expType <td> null <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";1666 // } else {1667 // if ($downloadState == 'run') {1668 // echo "<tr><td> $expType <td> loading <td> null <td bgcolor=$columnHeaderColor> <font color=\"red\">$count";1669 // } else {1670 // if ($rawState == NULL) {1671 // echo "<tr><td> $expType <td> $downloadState <td> loading <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";1672 // } else {1673 // echo "<tr><td> $expType <td> $downloadState <td> download ($rawState) <td> $count";1674 // }1675 // }1676 // }1677 //}1678 1683 1679 1684 echo "<tr><th colspan=4>";
Note:
See TracChangeset
for help on using the changeset viewer.
