Changeset 41170 for branches/eam_branches/ipp-20191011/ippMonitor
- Timestamp:
- Nov 27, 2019, 11:39:38 AM (7 years ago)
- Location:
- branches/eam_branches/ipp-20191011
- Files:
-
- 13 edited
- 5 copied
-
. (modified) (1 prop)
-
ippMonitor (modified) (1 prop)
-
ippMonitor/INSTALL (modified) (2 diffs)
-
ippMonitor/Makefile.in (modified) (6 diffs)
-
ippMonitor/configure.tcsh (modified) (3 diffs)
-
ippMonitor/czartool/czarDbSchema.sql (modified) (1 diff)
-
ippMonitor/czartool/czarpoll.pl (modified) (5 diffs)
-
ippMonitor/czartool/czartool/CzarDb.pm (modified) (1 diff)
-
ippMonitor/czartool/czartool/Pantasks.pm (modified) (7 diffs)
-
ippMonitor/czartool/extra_labels.dat (copied) (copied from trunk/ippMonitor/czartool/extra_labels.dat )
-
ippMonitor/def/failedFullforce.d (copied) (copied from trunk/ippMonitor/def/failedFullforce.d )
-
ippMonitor/def/fullforceInputSkyfile.d (copied) (copied from trunk/ippMonitor/def/fullforceInputSkyfile.d )
-
ippMonitor/def/fullforce_failure.d (modified) (1 diff)
-
ippMonitor/raw/czartool_labels.php (modified) (15 diffs)
-
ippMonitor/raw/ipp.ffs.dat (copied) (copied from trunk/ippMonitor/raw/ipp.ffs.dat )
-
ippMonitor/raw/ipp.ffs.php (copied) (copied from trunk/ippMonitor/raw/ipp.ffs.php )
-
ippMonitor/raw/ipp.php (modified) (1 diff)
-
ippMonitor/raw/site.php.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20191011
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20191011/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor (added) merged: 40936,41125-41126,41132-41135
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20191011/ippMonitor/INSTALL
r40435 r41170 1 #!/bin/sh 1 2 2 3 # below are commands to configure ippMonitor … … 11 12 # testing of those parts of ippMonitor which depend on IPP code without modifyin 12 13 # the operational installation 14 # 2019.11.18 CCL: not sure which parts of ippMonitor depends on IPP codes? If there is not many 15 # , just use trunk version should work fine. 13 16 psconfig ipp-trunk-20180515 14 17 15 # run psconfigure to generate Makefile and raw/site.php 18 # run psconfigure to generate Makefile and raw/site.php 19 # $CZARPLOTDIR and $METRICSPLOTDIR will be generated a link in the same folder as ippMonitor 16 20 psconfigure --htdocs /var/www/localhost/htdocs --site ~/ippconfig/ippmonitor.config 17 21 22 # copy these files and modify them (CCL removed CZARPLOTDIR) 23 cp config.dat.in config.dat 24 18 25 # install the php code: 26 # czartool_plots and ippMetrics will be linked to different path in different hostnames 19 27 make 28 29 # for running czarpool.pl, 30 cp czartool/czarconfig.xml.in czartool/czarconfig.xml 31 # then set gnuplot path for czartool_plots and ippMetrics in ippMonitor dir 32 # <path>/var/www/localhost/htdocs/ippMonitor/czartool_plots</path> 33 # <savelocation>/var/www/localhost/htdocs/ippMonitor/ippMetrics</savelocation> 34 # enter czartool 35 ./czarpool.pl 36 -
branches/eam_branches/ipp-20191011/ippMonitor/Makefile.in
r40844 r41170 1 default: updateVersion php 1 default: updateVersion php mklink 2 2 help: 3 3 @echo "USAGE: make php" 4 4 5 SRC = src 6 DEF = def 7 RAW = raw 8 SCRIPTS = scripts 9 DESTBIN = @BINDIR@ 10 DESTWWW = @HTDOCS@/ippMonitor 5 SRC = src 6 DEF = def 7 RAW = raw 8 SCRIPTS = scripts 9 DESTBIN = @BINDIR@ 10 DESTWWW = @HTDOCS@/ippMonitor 11 CZARPLOTDIR = /export/@HOST2@.0/ipp/czartool_plots 12 METRICSPLOTDIR = /export/@HOST2@.0/ipp/ippMetrics 11 13 12 14 GENERATE = $(SCRIPTS)/generate … … 172 174 $(DESTWWW)/fullforceRun.php \ 173 175 $(DESTWWW)/fullforceSummary.php \ 176 $(DESTWWW)/fullforce_failure.php \ 174 177 $(DESTWWW)/failedFullforce.php \ 175 178 $(DESTWWW)/diffSummary.php \ … … 280 283 $(DESTWWW)/noimage.png 281 284 282 DESTLINK = $(DESTWWW)/index.php 283 284 php: $(RAWSRC) $(DEFSRC) $(PICTURES) $(DESTLINK) $(PROGRAMS) 285 DESTLINK = $(DESTWWW)/index.php 286 CZPLOTSLINK = $(DESTWWW)/czartool_plots 287 METRICSLINK = $(DESTWWW)/ippMetrics 288 289 290 php: $(RAWSRC) $(DEFSRC) $(PICTURES) $(DESTLINK) $(PROGRAMS) 285 291 286 292 # dependancy rules for binary code ######################### … … 288 294 # .PRECIOUS: $(BIN)/%.$(ARCH) 289 295 290 $(DESTLINK): $(DESTWWW)/Login.php 296 $(DESTLINK): $(DESTWWW)/Login.php 291 297 rm -f $@ 292 298 ln -s $(DESTWWW)/Login.php $@ … … 311 317 updateVersion: 312 318 rm -f $(DESTWWW)/version.php 313 314 test: 319 @if [ ! -d $(CZARPLOTDIR) ]; then mkdir -p $(CZARPLOTDIR); fi 320 @if [ ! -d $(METRICSPLOTDIR) ]; then mkdir -p $(METRICSPLOTDIR); fi 321 322 mklink: $(CZPLOTSLINK) $(METRICSLINK) 323 324 $(CZPLOTSLINK): $(CZARPLOTDIR) 325 rm -f $@ 326 ln -s $(CZARPLOTDIR) $@ 327 328 $(METRICSLINK): $(METRICSPLOTDIR) 329 rm -f $@ 330 ln -s $(METRICSPLOTDIR) $@ 331 332 test: 315 333 #DESTWWW := $(DESTWWW)/test 316 334 echo $(DESTWWW) … … 355 373 cp $(SCRIPTS)/$* $(DESTBIN)/$* || exit 356 374 chmod +x $(DESTBIN)/$* || exit 375 376 377 357 378 358 379 # utilities ################################################# -
branches/eam_branches/ipp-20191011/ippMonitor/configure.tcsh
r39498 r41170 134 134 135 135 set hostname = `hostname -f` 136 set hostname2 = `hostname` 136 137 137 138 echo … … 182 183 if (-e Makefile) mv -f Makefile Makefile~ 183 184 cat Makefile.in | sed "s|@HTDOCS@|$htdocs|" > tmp.1 184 cat tmp.1 | sed "s|@BINDIR@|$bindir|" > Makefile 185 rm -f tmp.1 185 cat tmp.1 | sed "s|@HOST2@|$hostname2|" > tmp.2 186 cat tmp.2 | sed "s|@BINDIR@|$bindir|" > Makefile 187 rm -f tmp.2 186 188 187 189 # convert raw/site.php.in to raw/site.php … … 193 195 cat tmp.1 | sed "s|@DBI@|$DBI|" > tmp.2 194 196 cat tmp.2 | sed "s|@HOST@|$hostname|" > tmp.1 195 awk 'BEGIN{t = 0}((t == 0) && ($1 != "@CONFIG.DAT@")){print $0}($1 == "@CONFIG.DAT@"){t = 1}' tmp.1 > raw/site.php 197 cat tmp.1 | sed "s|@HOST2@|$hostname2|" > tmp.2 198 awk 'BEGIN{t = 0}((t == 0) && ($1 != "@CONFIG.DAT@")){print $0}($1 == "@CONFIG.DAT@"){t = 1}' tmp.2 > raw/site.php 196 199 cat config.dat >> raw/site.php 197 awk 'BEGIN{t = 0}(t == 1){print $0}($1 == "@CONFIG.DAT@"){t = 1}' tmp. 1>> raw/site.php200 awk 'BEGIN{t = 0}(t == 1){print $0}($1 == "@CONFIG.DAT@"){t = 1}' tmp.2 >> raw/site.php 198 201 199 202 rm -f tmp.1 tmp.2 -
branches/eam_branches/ipp-20191011/ippMonitor/czartool/czarDbSchema.sql
r40055 r41170 404 404 405 405 -- 406 -- Table structure for table `science_labels` (from current_labels) 407 -- 408 409 DROP TABLE IF EXISTS `science_labels`; 410 SET @saved_cs_client = @@character_set_client; 411 SET character_set_client = utf8; 412 CREATE TABLE `science_labels` ( 413 `server` varchar(128) default NULL, 414 `label` varchar(128) default NULL, 415 `telescope` varchar(128) NOT NULL, 416 `priority` int(11) NOT NULL default '0', 417 KEY `science_labels` (`server`,`label`, `telescope`) 418 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 419 SET character_set_client = @saved_cs_client; 420 421 -- 422 -- Table structure for table `science_nightlyscience` (from nightlyscience) 423 -- 424 425 DROP TABLE IF EXISTS `science_nightlyscience`; 426 SET @saved_cs_client = @@character_set_client; 427 SET character_set_client = utf8; 428 CREATE TABLE `science_nightlyscience` ( 429 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, 430 `status` varchar(128) default 'NONE', 431 `telescope` varchar(128) NOT NULL 432 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 433 SET character_set_client = @saved_cs_client; 434 435 -- 436 -- Table structure for table `science_reverts` (from reverts) 437 -- 438 439 DROP TABLE IF EXISTS `science_reverts`; 440 SET @saved_cs_client = @@character_set_client; 441 SET character_set_client = utf8; 442 CREATE TABLE `science_reverts` ( 443 `stage` varchar(128) default NULL, 444 `telescope` varchar(128) NOT NULL, 445 `reverting` tinyint(4) default NULL 446 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 447 SET character_set_client = @saved_cs_client; 448 449 -- 450 -- Table structure for table `science_server_dates` (from server_dates) 451 -- 452 453 DROP TABLE IF EXISTS `science_server_dates`; 454 SET @saved_cs_client = @@character_set_client; 455 SET character_set_client = utf8; 456 CREATE TABLE `science_server_dates` ( 457 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, 458 `server` varchar(64) default 'NONE', 459 `telescope` varchar(128) NOT NULL, 460 `date` varchar(64) default 'NONE' 461 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 462 SET character_set_client = @saved_cs_client; 463 464 -- 465 -- Table structure for table `science_servers` (from servers) 466 -- 467 468 DROP TABLE IF EXISTS `science_servers`; 469 SET @saved_cs_client = @@character_set_client; 470 SET character_set_client = utf8; 471 CREATE TABLE `science_servers` ( 472 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, 473 `server` varchar(128) default NULL, 474 `telescope` varchar(128) NOT NULL, 475 `alive` tinyint(4) default NULL, 476 `running` tinyint(4) default NULL 477 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 478 SET character_set_client = @saved_cs_client; 479 480 -- 481 -- Table structure for table `live_servers` (from servers) 482 -- 483 484 DROP TABLE IF EXISTS `live_servers`; 485 SET @saved_cs_client = @@character_set_client; 486 SET character_set_client = utf8; 487 CREATE TABLE `live_servers` ( 488 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, 489 `server` varchar(128) default NULL, 490 `telescope` varchar(128) NOT NULL, 491 `alive` tinyint(4) default NULL, 492 `running` tinyint(4) default NULL 493 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 494 SET character_set_client = @saved_cs_client; 495 496 -- 406 497 -- Table structure for table `server_dates` 407 498 -- -
branches/eam_branches/ipp-20191011/ippMonitor/czartool/czarpoll.pl
r40879 r41170 236 236 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running); 237 237 $czarDb->updateServerStatus($server,'gpc2', $alive, $running); 238 } 239 } 240 241 ########################################################################### 242 # 243 # Updates pantasks server status TODO should really get info for all servers at once 244 # 245 ########################################################################### 246 sub updateServerStatusLive { 247 print "* Checking all pantasks servers\n"; 248 249 my $servers = $pantasks->getServerList(); 250 251 my $server = undef; 252 my $alive = undef; 253 my $running = undef; 254 foreach $server (@{$servers}) { 255 $pantasks->getServerStatus($server,'gpc1', \$alive, \$running); 256 $czarDb->updateServerStatusLive($server,'gpc1', $alive, $running); 257 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running); 258 $czarDb->updateServerStatusLive($server,'gpc2', $alive, $running); 238 259 } 239 260 } … … 272 293 my $newDayTime = $config->getMetricsStartTime(); 273 294 my $lastDayDailyTasks = "2010-01-01"; 274 295 my $checkneb = 1; # 1 for nebulous, 0 for localhost test 275 296 # main polling loop 276 297 while (1) { 298 277 299 my $iterationStartTime = time(); 278 300 279 301 #get the time of last czarpoll update 280 302 $polldate = $czarDb->getPollDate(); … … 287 309 if($timediff > 120.) { 288 310 print "There is no recent Czarpoll iteration\n"; 289 print "* Updating database entries*\n";311 print "* Updating database entries*\n"; 290 312 $dbupdate = 1; 291 313 } else { 292 314 print "There is a recent Czarpoll iteration already made ($timediff sec ago)\n"; 293 print "* Skipping database queries and entries*\n";315 print "* Skipping database queries and entries\n"; 294 316 $dbupdate = 0; 295 317 } … … 326 348 #TdB20190703: The ipp113 and ipp117 instances of czarpoll use the same stage DBs in czarDB. 327 349 #Therefore, it makes no sense to run the cleanup+optimising twice 328 #print "* Performing database cleanup\n";329 #$czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval());350 print "* Performing database cleanup\n"; 351 $czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval()); 330 352 #print "* Optimizing the database\n"; 331 353 #$czarDb->optimize(); … … 344 366 345 367 # check nebulous 346 print "* Checking Nebulous\n"; 347 if($dbupdate == 1) {$nebulous->updateClusterSpaceInfo();} 348 $plotter0->plotStorageTimeSeries($czarDb->subtractInterval($begin, "1 WEEK") , $end); 349 $plotter0->plotDiskUsageHistogram(); 350 $plotter0->plotDiskUsageHistogramLarge(); 368 if ($checkneb == 1) { 369 print "* Checking Nebulous\n"; 370 if($dbupdate == 1) {$nebulous->updateClusterSpaceInfo();} 371 $plotter0->plotStorageTimeSeries($czarDb->subtractInterval($begin, "1 WEEK") , $end); 372 $plotter0->plotDiskUsageHistogram(); 373 $plotter0->plotDiskUsageHistogramLarge(); 374 } 375 else { 376 print "* Locahost, so no checking nebulous\n"; 377 } 378 379 # check pantasks status 351 380 if($dbupdate == 1) {updateServerStatus();} 381 if($dbupdate == 1) {updateServerStatusLive();} 352 382 353 383 # check pantasks dates -
branches/eam_branches/ipp-20191011/ippMonitor/czartool/czartool/CzarDb.pm
r40878 r41170 166 166 SQL 167 167 168 $query->execute; 169 } 170 171 ########################################################################### 172 # 173 # Updates server table 174 # 175 ########################################################################### 176 sub updateServerStatusLive { 177 my ($self, $server,$telescope, $alive, $running) = @_; 178 179 my $query = $self->{_db}->prepare(<<SQL); 180 DELETE FROM live_servers where timestamp < CURRENT_TIMESTAMP - INTERVAL 12 hour; 181 SQL 182 $query->execute; 183 184 $query = $self->{_db}->prepare(<<SQL); 185 INSERT INTO live_servers 186 (server,telescope, alive, running) 187 VALUES 188 ('$server','$telescope', $alive, $running); 189 SQL 168 190 $query->execute; 169 191 } -
branches/eam_branches/ipp-20191011/ippMonitor/czartool/czartool/Pantasks.pm
r40840 r41170 7 7 8 8 my @servers = ( 9 # "addstar", 10 # "addstarlap", 11 "ippqub:stdscience_ws", 9 ##### standard pantasks ###### 12 10 "cleanup", 13 # "deepstack",14 # "detrend",15 11 "distribution", 16 12 "pstamp", 17 # "update",18 # "publishing",19 13 "registration", 20 "replication",21 14 "stack", 22 15 "stdscience", 23 "summitcopy" 16 "summitcopy", 17 ##### additional pantasks ###### 18 "addstar", 19 "addstarlap", 20 "deepstack", 21 "detrend", 22 "ippqub:stdscience_ws", 23 "publishing", 24 "replication", 25 "update" 24 26 ); 27 # current home dir of gpc1 and gpc2 28 my $ipphome1 = "/data/ippc64.1/ippitc"; 29 my $ipphome2 = "/data/ippc18.0/home/ippps2"; 25 30 26 31 ########################################################################### … … 90 95 91 96 if ($telescope eq 'gpc1') { 92 $ipphome = "/data/ippc64.1/ippitc";93 } 94 elsif ($telescope eq 'gpc2') { 95 $ipphome = "/data/ippc18.0/home/ippps2";97 $ipphome = $ipphome1; 98 } 99 elsif ($telescope eq 'gpc2') { 100 $ipphome = $ipphome2; 96 101 } 97 102 else { … … 134 139 135 140 if ($telescope eq 'gpc1') { 136 $ipphome = "/data/ippc64.1/ippitc";137 } 138 elsif ($telescope eq 'gpc2') { 139 $ipphome = "/data/ippc18.0/home/ippps2";141 $ipphome = $ipphome1; 142 } 143 elsif ($telescope eq 'gpc2') { 144 $ipphome = $ipphome2; 140 145 } 141 146 else { … … 177 182 178 183 if ($telescope eq 'gpc1') { 179 $ipphome = "/data/ippc64.1/ippitc";180 } 181 elsif ($telescope eq 'gpc2') { 182 $ipphome = "/data/ippc18.0/home/ippps2";184 $ipphome = $ipphome1; 185 } 186 elsif ($telescope eq 'gpc2') { 187 $ipphome = $ipphome2; 183 188 } 184 189 else { … … 209 214 my $ipphome; 210 215 if ($telescope eq 'gpc1') { 211 $ipphome = "/data/ippc64.1/ippitc";212 } 213 elsif ($telescope eq 'gpc2') { 214 $ipphome = "/data/ippc18.0/home/ippps2";216 $ipphome = $ipphome1; 217 } 218 elsif ($telescope eq 'gpc2') { 219 $ipphome = $ipphome2; 215 220 } 216 221 else { … … 239 244 my $ipphome; 240 245 if ($telescope eq 'gpc1') { 241 $ipphome = "/data/ippc64.1/ippitc";242 } 243 elsif ($telescope eq 'gpc2') { 244 $ipphome = "/data/ippc18.0/home/ippps2";246 $ipphome = $ipphome1; 247 } 248 elsif ($telescope eq 'gpc2') { 249 $ipphome = $ipphome2; 245 250 } 246 251 else { … … 279 284 280 285 if ($telescope eq 'gpc1') { 281 $ipphome = "/data/ippc64.1/ippitc";282 } 283 elsif ($telescope eq 'gpc2') { 284 $ipphome = "/data/ippc18.0/home/ippps2";286 $ipphome = $ipphome1; 287 } 288 elsif ($telescope eq 'gpc2') { 289 $ipphome = $ipphome2; 285 290 } 286 291 else { -
branches/eam_branches/ipp-20191011/ippMonitor/def/fullforce_failure.d
r40882 r41170 1 TABLE staticskyRun JOIN staticskyResult USING (sky_id) JOIN staticskyInput USING (sky_id) JOIN stackRun USING (stack_id)2 TITLE Static Sky Failed (Log)3 FILE f ailedStaticsky.php4 MENU ipp. stack.dat1 TABLE fullForceInput JOIN warpRun USING (warp_id) JOIN fullForceRun USING (ff_id) JOIN fullForceResult USING (ff_id) 2 TITLE Full Force Failed 3 FILE fullforce_failure.php 4 MENU ipp.ffs.dat 5 5 6 WHERE staticskyResult.fault != 0 6 ARGS ARG1 fullForceRun.ff_id=$fullForceRun.ff_id 7 ARGS ARG1 basename=$fullForceResult.path_base 7 8 8 ARGS ARG1 staticskyResult.path_base=$staticskyResult.path_base 9 WHERE fullForceResult.fault != 0 10 # field size format name show link to extras 11 FIELD fullForceRun.ff_id, 5, %d, FF ID 12 FIELD fullForceRun.label, 7, %s, Label 13 FIELD fullForceRun.state, 7, %s, State, value, fullforce_failure.php, ARG1 14 FIELD warpRun.tess_id, 5, %s, Tess ID 15 FIELD warpRun.label AS warpRunLabel, 5, %s, warp Label 16 FIELD fullForceRun.data_group, 7, %s, data grp 17 FIELD fullForceRun.dist_group, 7, %s, dist grp 18 FIELD fullForceResult.fault, 7, %d, fault 19 FIELD fullForceResult.quality, 7, %d, quality 20 FIELD fullForceResult.path_base, 7, %s, path_base, none 9 21 10 # field size format name show link to extras 11 FIELD staticskyRun.sky_id, 5, %d, Sky ID 12 FIELD staticskyRun.label, 7, %s, Label 13 FIELD staticskyRun.state, 7, %s, State, value, staticsky_failure.php, ARG1 14 FIELD stackRun.skycell_id, 5, %s, Skycell ID 15 FIELD stackRun.tess_id, 5, %s, Tess ID 16 FIELD count(stackRun.filter), 5, %d, #Filters 17 FIELD stackRun.label, 5, %s, Stack Label 18 FIELD staticskyRun.data_group, 7, %s, data grp 19 FIELD staticskyRun.dist_group, 7, %s, dist grp 20 FIELD staticskyResult.sources, 7, %d, n(sources) 21 FIELD staticskyResult.fault, 7, %d, fault 22 FIELD staticskyResult.quality, 7, %d, quality 23 FIELD staticskyResult.path_base, 5, %s, path_base, none 24 25 GROUP staticskyRun.sky_id 22 MODE summary 23 GROUP fullForceRun.ff_id 26 24 27 25 TAIL PHP insert_log ('LOG.EXP'); 26 -
branches/eam_branches/ipp-20191011/ippMonitor/raw/czartool_labels.php
r40883 r41170 214 214 echo "<td style=height:200px;width:400px;text-align:top;\">"; 215 215 216 #echo "<br>"; 216 ///////////////////////////////////////// 217 // timer begin for status and links 218 ///////////////////////////////////////// 219 $time = microtime(); 220 $time = explode(' ', $time); 221 $time = $time[1] + $time[0]; 222 $start = $time; 217 223 218 224 // status table at top 219 225 $nsStatus = getNightlyScienceStatus($czardb, $proj); 220 226 $plotTypeLink = ($plotType == "linear") ? "log" : "linear"; 221 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; 227 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . 228 "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; 229 222 230 echo "<br>"; 223 231 echo $table; 224 225 createTableTitle("Status and links", 3); 232 createTableTitle("Status and links", 2); 226 233 echo "<tr>\n"; 227 echo "<tr><td>Time of last update</td><td>$lastUpdateTime</td></tr>"; 228 echo "<tr><td>ippMonitor SVN version</td><td>"; include 'version.php'; echo "</td></tr>"; 229 echo "<tr><td>Current nightly science status</td><td>$nsStatus</td></tr>"; 230 echo "<tr><td>Postage stamp server status</td><td><a href=\"http://pstamp.ipp.ifa.hawaii.edu/status.php\"><font color=\"blue\">here</font></a></td></tr>"; 231 echo "<tr><td>Documentation</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\"><font color=\"blue\">here</font></a></td></tr>"; 232 echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&hc=6&c=IPP%2520Production\"><font color=\"blue\">here</font></a> <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?m=cpu_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\"><font color=\"blue\">cpu_report</font></a> <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?m=mem_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\"><font color=\"blue\">mem_report</font></a></td></tr>"; 233 echo "<tr><td>IPP metrics</td><td><a href=\"https://ps1wiki.ifa.hawaii.edu/data/metrics/index.html\"><font color=\"blue\">here</font></a></td></tr>"; 234 echo "<tr><td>Czar log pages</td><td><a href=\"https://confluence.ipp.ifa.hawaii.edu/pages/viewrecentblogposts.action?key=IPPCZAR\"><font color=\"blue\">here</font></a></td></tr>"; 235 echo "<tr><td>Exposure summary</td><td><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\"><font color=\"blue\">here</font></a></td></tr>"; 236 echo "<tr><td>Confluence</td><td><a href=\"https://confluence.ipp.ifa.hawaii.edu/display/IPPCZAR/IPP-Czaring+Home\"><font color=\"blue\">here</font></a></td></tr>"; 237 echo "<tr><td>JIRA</td><td><a href=\"https://jira.ipp.ifa.hawaii.edu/secure/Dashboard.jspa\"><font color=\"blue\">here</font></a></td></tr>"; 234 echo "<tr><td>Time of last update</td> 235 <td>$lastUpdateTime</td></tr>"; 236 echo "<tr><td>ippMonitor SVN version</td> 237 <td>"; include 'version.php'; echo "</td></tr>"; 238 echo "<tr><td>Current nightly science status</td> 239 <td>$nsStatus</td></tr>"; 240 echo "<tr><td>Postage stamp server status</td> 241 <td><a href=\"http://pstamp.ipp.ifa.hawaii.edu/status.php\" target=new><font color=\"blue\">here</font></a></td></tr>"; 242 echo "<tr><td>Documentation</td> 243 <td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\" target=new><font color=\"blue\">here</font></a></td></tr>"; 244 echo "<tr><td>Cluster load</td> 245 <td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&hc=6&c=IPP%2520Production\"> 246 <font color=\"blue\">here</font></a> 247 <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?m=cpu_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\"> 248 <font color=\"blue\">cpu_report</font></a> 249 <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?m=mem_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\"> 250 <font color=\"blue\">mem_report</font></a></td></tr>"; 251 echo "<tr><td>IPP metrics</td> 252 <td><a href=\"https://ps1wiki.ifa.hawaii.edu/data/metrics/index.html\"><font color=\"blue\" target=new>here</font></a></td></tr>"; 253 echo "<tr><td>Czar log pages</td> 254 <td><a href=\"https://confluence.ipp.ifa.hawaii.edu/pages/viewrecentblogposts.action?key=IPPCZAR\" target=new><font color=\"blue\">here</font></a></td></tr>"; 255 echo "<tr><td>Exposure summary</td> 256 <td><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\"><font color=\"blue\">here</font></a></td></tr>"; 257 echo "<tr><td>Confluence</td> 258 <td><a href=\"https://confluence.ipp.ifa.hawaii.edu/display/IPPCZAR/IPP-Czaring+Home\" target=new><font color=\"blue\">here</font></a></td></tr>"; 259 echo "<tr><td>JIRA</td> 260 <td><a href=\"https://jira.ipp.ifa.hawaii.edu/secure/Dashboard.jspa\" target=new><font color=\"blue\">here</font></a></td></tr>"; 261 echo "<tr><td>data store</td> 262 <td><a href=\"https://svn.ifa.hawaii.edu/\" target=new><font color=\"blue\">here</font></a></td></tr>"; 238 263 239 264 $plotTypeLink = ($plotType == "linear") ? "log" : "linear"; 240 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; 241 242 echo "</table>\n"; 243 244 echo "<br>"; 245 246 createLabelsTable($pass, 247 $proj, 248 $czardb, 249 $selectedMode, 250 $labels, 251 $distLabelsExist, 252 $pubLabelsExist, 253 $stages, 254 "new", 255 $selectedLabel, 256 $selectedStage, 257 $plotType); 258 259 if ($selectedMode == "update") {echo "<br>"; createPStampDataTable();} 260 echo "<br>"; 261 262 # XXX EAM : 2017.09.17 : debugging slowness 263 createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType); echo "<br>"; 264 createSummitDataTable($projectdb); echo "<br>"; // this is slow because of the join between summitExp and rawExp 265 createChunkDataTable($projectdb); echo "<br>"; 266 createDatesTable($czardb, $proj); echo "<br>"; 267 268 echo $table; 269 echo "<tr>"; 270 createTableTitle("Database status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2); 271 272 echo "<tr>"; 273 createTableColumnHeader("Database"); 274 createTableColumnHeader("Status (sec behind master)"); 275 showDatabaseStatus($HOST_GPC1, $USER_GPC1, $PASSWORD_GPC1, $DBNAME_GPC1); 276 showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1); 277 showReplicationsStatus($REPL_HOST_GPC1_SECONDARY, $REPL_USER_GPC1_SECONDARY, $REPL_PASSWORD_GPC1_SECONDARY, $REPL_DBNAME_GPC1_SECONDARY); 278 279 echo "<tr>"; 280 281 showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $DBNAME_NEBULOUS); 282 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS); 283 showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY); 284 showReplicationsStatus($REPL_HOST_DATASTORE_SECONDARY, $REPL_USER_DATASTORE_SECONDARY, $REPL_PASSWORD_DATASTORE_SECONDARY, $REPL_DBNAME_DATASTORE_SECONDARY); 285 286 # some mysql replication slaves to add when they are returned to service 287 # showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP); 288 # showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP); 289 echo "</table>"; 290 291 echo $table; 292 echo "<tr>"; 293 createTableTitle("Critical machine status", 2); 294 295 echo "<tr>"; 296 createTableColumnHeader("Hostname"); 297 createTableColumnHeader("Status"); 298 showPingStatus($HOST_GATEWAY, $DBNAME_GATEWAY); 299 showPingStatus($HOST_GATEWAY_SECONDARY, $DBNAME_GATEWAY_SECONDARY); 300 301 # showPingStatus($HOST_APACHE1, $DBNAME_APACHE1); 302 showPingStatus($HOST_APACHE2, $DBNAME_APACHE2); 303 showPingStatus($HOST_APACHE3, $DBNAME_APACHE3); 304 showPingStatus($HOST_APACHE4, $DBNAME_APACHE4); 305 showPingStatus($HOST_APACHE5, $DBNAME_APACHE5); 306 showPingStatus($HOST_APACHE6, $DBNAME_APACHE6); 307 showPingStatus($HOST_APACHE7, $DBNAME_APACHE7); 308 showPingStatus($HOST_PROXY, $DBNAME_PROXY); 309 showPingStatus($HOST_SVN, $DBNAME_SVN); 310 showPingStatus($HOST_CONFLUENCE, $DBNAME_CONFLUENCE); 311 312 echo "</table>"; 313 314 echo "</table>"; 265 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode . 266 "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; 267 268 // timer finished 269 echo "<tr><th colspan=4>"; 270 $time = microtime(); 271 $time = explode(' ', $time); 272 $time = $time[1] + $time[0]; 273 $finish = $time; 274 $total_time = round(($finish - $start), 3); 275 echo "loading in $total_time seconds."; 276 echo "</th></tr>"; 277 echo "</table><br>"; 278 279 createLabelsTable($pass, $proj, $czardb, $selectedMode, $labels, 280 $distLabelsExist, $pubLabelsExist, $stages, "new", $selectedLabel, 281 $selectedStage, $plotType); 282 if ($selectedMode == "update") {echo "<br>"; createPStampDataTable();} 283 284 # XXX EAM : 2017.09.17 : debugging slowness 285 # CCL : 2019.11.09 : debugging slowness 286 //createSummitDataTable($projectdb); // this is slow because of the join between summitExp and rawExp, but not the major one 287 createSummitDataTable2($projectdb); // this is slow because of the join between summitExp and rawExp, but not the major one 288 289 createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType); 290 // this was the major slowness part due to large table in czardb 291 292 createChunkDataTable($projectdb); // this is another part for slowness during nightly processing 293 294 createDatesTable($czardb, $proj); 295 296 ///////////////////////////////////////// 297 // timer begin for Database status 298 ///////////////////////////////////////// 299 $time = microtime(); 300 $time = explode(' ', $time); 301 $time = $time[1] + $time[0]; 302 $start = $time; 303 304 // status table at top 305 echo $table; 306 echo "<tr>"; 307 createTableTitle("Database status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2); 308 309 echo "<tr>"; 310 createTableColumnHeader("Database"); 311 createTableColumnHeader("Status (sec behind master)"); 312 showDatabaseStatus($HOST_GPC1, $USER_GPC1, $PASSWORD_GPC1, $DBNAME_GPC1); 313 showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1); 314 showReplicationsStatus($REPL_HOST_GPC1_SECONDARY, $REPL_USER_GPC1_SECONDARY, $REPL_PASSWORD_GPC1_SECONDARY, $REPL_DBNAME_GPC1_SECONDARY); 315 316 echo "<tr>"; 317 showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $DBNAME_NEBULOUS); 318 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS); 319 showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY); 320 showReplicationsStatus($REPL_HOST_DATASTORE_SECONDARY, $REPL_USER_DATASTORE_SECONDARY, $REPL_PASSWORD_DATASTORE_SECONDARY, $REPL_DBNAME_DATASTORE_SECONDARY); 321 322 // some mysql replication slaves to add when they are returned to service 323 // showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP); 324 // showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP); 325 326 // timer finished 327 echo "<tr><th colspan=2>"; 328 $time = microtime(); 329 $time = explode(' ', $time); 330 $time = $time[1] + $time[0]; 331 $finish = $time; 332 $total_time = round(($finish - $start), 3); 333 echo "loading in $total_time seconds."; 334 echo "</th></tr>"; 335 echo "</table><br>"; 336 337 ///////////////////////////////////////// 338 // timer begin for critical machines 339 ///////////////////////////////////////// 340 $time = microtime(); 341 $time = explode(' ', $time); 342 $time = $time[1] + $time[0]; 343 $start = $time; 344 345 // status table at top 346 $PingStatus = "<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">DOWN</font>"; 347 echo $table; 348 echo "<tr>"; 349 createTableTitle("Critical machine status", 3); 350 351 echo "<tr>"; 352 createTableColumnHeader("Hostname"); 353 createTableColumnHeader("Status"); 354 createTableColumnHeader("Loading time"); 355 showPingStatus($HOST_GATEWAY, $DBNAME_GATEWAY); 356 showPingStatus($HOST_GATEWAY_SECONDARY, $DBNAME_GATEWAY_SECONDARY); 357 showPingStatus($HOST_APACHE1, $DBNAME_APACHE1); 358 showPingStatus($HOST_APACHE2, $DBNAME_APACHE2); 359 showPingStatus($HOST_APACHE3, $DBNAME_APACHE3); 360 showPingStatus($HOST_APACHE4, $DBNAME_APACHE4); 361 showPingStatus($HOST_APACHE5, $DBNAME_APACHE5); 362 showPingStatus($HOST_APACHE6, $DBNAME_APACHE6); 363 showPingStatus($HOST_APACHE7, $DBNAME_APACHE7); 364 showPingStatus($HOST_APACHE8, $DBNAME_APACHE8); 365 // echo "<td>ippc70 (apache node) <td> $PingStatus <td> 0 seconds "; // comment out if ippc70 is back 366 showPingStatus($HOST_PROXY, $DBNAME_PROXY); 367 showPingStatus($HOST_SVN, $DBNAME_SVN); 368 showPingStatus($HOST_CONFLUENCE, $DBNAME_CONFLUENCE); 369 370 // timer finished 371 echo "<tr><th colspan=3>"; 372 $time = microtime(); 373 $time = explode(' ', $time); 374 $time = $time[1] + $time[0]; 375 $finish = $time; 376 $total_time = round(($finish - $start), 3); 377 echo "loading in $total_time seconds."; 378 echo "</th></tr>"; 379 echo "</table><br>"; 380 381 315 382 menu_end(); 316 383 384 385 ############################################################################# 386 ############################# Functions Below ############################# 387 ############################################################################# 317 388 318 389 ########################################################################### … … 361 432 } 362 433 363 ###########################################################################364 #365 # Creates a table of summitExp against rawExp366 #367 ###########################################################################368 function createSummitDataTable($projectdb) {369 370 $date = date("Y-m-d");371 $sql = "SELECT DISTINCT exp_type FROM summitExp WHERE dateobs > '$date'";372 373 $qry = $projectdb->query($sql);374 if (dberror($qry)) {375 echo "<b>error reading newExp table</b><br>\n";376 echo "<br><small><b> table query : $sql </b></small><br>\n";377 menu_end();378 }379 380 // set up the table381 global $table;382 echo $table;383 echo "<tr>";384 createTableTitle("Status of last night's data", 4);385 echo "<tr>";386 createTableColumnHeader("Exposure type");387 createTableColumnHeader("At summit");388 createTableColumnHeader("Registered at MHPCC");389 createTableColumnHeader("At summit (Dropped)");390 391 $msg = "No science images taken since $date";392 393 // list the results394 while ($qry->fetchInto($expType)) {395 396 $sql = "SELECT COUNT(*) FROM summitExp left join pzDownloadExp using (summit_id) WHERE dateobs > '$date' AND exp_type = '$expType[0]' and (state != 'drop' or state is null) and fault != 1042";397 # $sql = "SELECT COUNT(*) FROM summitExp WHERE dateobs > '$date' AND exp_type = '$expType[0]'";398 $qry2 = $projectdb->query($sql);399 $qry2->fetchInto($summit);400 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]'";403 $qry2 = $projectdb->query($sql);404 $qry2->fetchInto($mhpcc);405 406 $sql = "SELECT COUNT(*) FROM summitExp join pzDownloadExp using (summit_id) WHERE dateobs > '$date' AND exp_type = '$expType[0]' and state = 'drop'";407 $qry2 = $projectdb->query($sql);408 $qry2->fetchInto($dropped);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 421 echo "<tr>";422 423 $DLdiff = $summit[0] - $mhpcc[0];424 if ($DLdiff == 0) $error = 0;425 else $error = 1;426 427 $delayDLdiff = $summitdelay[0] - $mhpccdelay[0];428 if ($delayDLdiff == 0) $errordelay = 0;429 else $errordelay = 1;430 431 echo "<td>$expType[0]</td>";432 echo "<td>$summit[0]</td>";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 441 echo "<td>$dropped[0]</td>";442 443 echo "</tr>";444 }445 446 echo "</table>\n";447 448 }449 434 450 435 ########################################################################### … … 455 440 function createChunkDataTable($projectdb) { 456 441 442 // timer start 443 $time = microtime(); 444 $time = explode(' ', $time); 445 $time = $time[1] + $time[0]; 446 $start = $time; 447 448 // function begin 457 449 #First find the reference exposure ID to speed up the subsequent queries 458 450 $date = gmdate("Y-m-d"); … … 464 456 } 465 457 $qry->fetchInto($refExpID); 466 467 #Find the number of chunks 468 $query = "SELECT groupchunk.chunk,groupchunk.Nquad_firstvisit,group4.Nquad_fourvisits FROM"; 469 $query .= " ("; 470 $query .= " SELECT dateobs,comment,substr(comment, 1, position(' ' in comment)) AS chunk,count(distinct(comment)) AS Nquad_firstvisit"; 471 $query .= " FROM rawExp"; 472 $query .= " WHERE dateobs LIKE '$date%' AND exp_id > $refExpID[0]"; 473 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING'"; 474 $query .= " AND comment LIKE '%visit 1%'"; 475 $query .= " GROUP BY chunk"; 476 $query .= " ) AS groupchunk"; 477 $query .= " LEFT JOIN"; 478 $query .= " ("; 479 $query .= " SELECT groupobj.chunk,count(*) AS Nquad_fourvisits FROM "; 480 $query .= " (SELECT substr(comment, 1, position(' ' in comment)) AS chunk,count(distinct(comment)) AS Nvisits"; 481 $query .= " FROM rawExp"; 482 $query .= " WHERE dateobs LIKE '$date%' AND exp_id > $refExpID[0] AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%')"; 483 $query .= " AND obs_mode NOT LIKE 'ENGINEERING' AND comment LIKE '%visit%'"; 484 $query .= " GROUP BY object, filter, chunk"; 485 $query .= " ) AS groupobj"; 486 $query .= " WHERE groupobj.Nvisits = 4 "; 487 $query .= " GROUP BY groupobj.chunk"; 488 $query .= " ) AS group4"; 489 $query .= " on groupchunk.chunk=group4.chunk ORDER BY dateobs"; 490 491 #$sql = "SELECT DISTINCT substr(comment, 1, position(' ' in comment)) FROM rawExp WHERE dateobs LIKE '$date%' AND exp_id > $refExpID AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND comment LIKE '%visit 1%'"; 458 if ($refExpID[0] = 'NULL') { 459 $refExpID[0] = 0; 460 } 461 462 #do a query of raw/chip/cam/warp counts for this night, split by chunk. 463 #we need to do a subquery to find the total number of skycells in warpSkyfile, as well as the number of those with a bad quality 464 $query = "SELECT suba.chunk,suba.Nvis1,suba.Nvis2,suba.Nvis3,suba.Nvis4,suba.Ncamgood,suba.Ncambad,subb.Nwarpgood,subb.Nwarpbad FROM "; 465 $query .= " (SELECT substr(comment, 1, position(' ' in comment)) AS chunk,count(if(rawExp.comment LIKE '%visit 1%',1,NULL)) AS Nvis1,"; 466 $query .= " count(if(rawExp.comment LIKE '%visit 2%',1,NULL)) AS Nvis2,count(if(rawExp.comment LIKE '%visit 3%',1,NULL)) AS Nvis3,"; 467 $query .= " count(if(rawExp.comment LIKE '%visit 4%',1,NULL)) AS Nvis4, count(if(camProcessedExp.sigma_ra <= 5 AND camProcessedExp.sigma_dec <= 5 AND camProcessedExp.quality = 0,1,NULL)) AS Ncamgood,"; 468 $query .= " count(if(camProcessedExp.sigma_ra > 5 OR camProcessedExp.sigma_dec > 5 OR camProcessedExp.quality > 0,1,NULL)) AS Ncambad"; 469 $query .= " FROM rawExp LEFT JOIN chipRun USING (exp_id) LEFT JOIN camRun USING (chip_id) JOIN camProcessedExp USING (cam_id) LEFT JOIN fakeRun USING (cam_id) LEFT JOIN warpRun USING (fake_id)"; 470 $query .= " WHERE dateobs like '$date%' AND exp_id > $refExpID[0] AND exp_type = 'OBJECT' AND rawExp.comment like '%visit%'"; 471 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 472 $query .= " GROUP BY chunk ORDER BY dateobs) as suba "; 473 $query .= "LEFT JOIN"; 474 $query .= " (SELECT subc.chunk, count(if(subc.Nwarpskycellbad < subc.Nwarpskycell,1,NULL)) AS Nwarpgood, count(if(subc.Nwarpskycellbad = subc.Nwarpskycell,1,NULL)) AS Nwarpbad"; 475 $query .= " FROM "; 476 $query .= " (SELECT substr(comment, 1, position(' ' in comment)) AS chunk,count(warpSkyfile.quality) AS Nwarpskycell,count(if(warpSkyfile.quality > 0,1,NULL)) AS Nwarpskycellbad"; 477 $query .= " FROM rawExp LEFT JOIN chipRun USING (exp_id) LEFT JOIN camRun USING (chip_id) LEFT JOIN fakeRun USING (cam_id) LEFT JOIN warpRun USING (fake_id) JOIN warpSkyfile USING (warp_id)"; 478 $query .= " WHERE dateobs like '$date%' AND exp_id > $refExpID[0] AND exp_type = 'OBJECT' AND rawExp.comment like '%visit%'"; 479 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 480 $query .= " GROUP BY exp_name) as subc"; 481 $query .= " GROUP BY chunk) AS subb "; 482 $query .= "ON suba.chunk=subb.chunk"; 492 483 493 484 $qry = $projectdb->query($query); 494 485 if (dberror($qry)) { 495 echo "<b>error reading rawExptable</b><br>\n";486 echo "<b>error querying SQL table</b><br>\n"; 496 487 echo "<br><small><b> table query : $query </b></small><br>\n"; 497 488 menu_end(); … … 502 493 echo $table; 503 494 echo "<tr>"; 504 createTableTitle("Status of last night's chunks", 5);495 createTableTitle("Status of last night's chunks", 10); 505 496 echo "<tr>"; 506 497 createTableColumnHeader("Chunk"); 507 createTableColumnHeader("Nobs_1stvisit"); 508 createTableColumnHeader("Nobs_4visits(bad cam)"); 509 createTableColumnHeader("Ndiffs_published"); 498 createTableColumnHeader("Nobs"); 499 createTableColumnHeader("Ncam"); 500 createTableColumnHeader("Nwrp"); 501 createTableColumnHeader("wrp_pub"); 502 createTableColumnHeader("Nwwd"); 503 createTableColumnHeader("wwd_pub"); 504 createTableColumnHeader("Nwsd"); 505 createTableColumnHeader("wsd_pub"); 510 506 createTableColumnHeader("Completion"); 511 507 … … 514 510 // list the results 515 511 while ($qry->fetchInto($row)) { 516 $Nfirstvisits = 0; 517 $Nfourvisits = 0; 518 $badcam = 0; 512 $Nvis1 = 0; 513 $Nvis2 = 0; 514 $Nvis3 = 0; 515 $Nvis4 = 0; 516 $Ncamgood = 0; 517 $Ncambad = 0; 518 $Nwarpgood = 0; 519 $Nwarpbad = 0; 520 $NexpWWdiff = 0; 521 $Npubwarps = 0; 519 522 520 523 $chunkname = $row[0]; 521 if($row[1] > 0) $Nfirstvisits = $row[1]; 522 if($row[2] > 0) $Nfourvisits = $row[2]; 523 524 $query2 = " SELECT warp_id FROM "; 525 $query2 .= " warpRun 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)"; 526 $query2 .= " WHERE rawExp.dateobs LIKE '$date%' AND exp_id > $refExpID[0] AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%')"; 527 $query2 .= " AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%'"; 524 if($row[1] > 0) $Nvis1 = $row[1]; 525 if($row[2] > 0) $Nvis2 = $row[2]; 526 if($row[3] > 0) $Nvis3 = $row[3]; 527 if($row[4] > 0) $Nvis4 = $row[4]; 528 if($row[5] > 0) $Ncamgood = $row[5]; 529 if($row[6] > 0) $Ncambad = $row[6]; 530 if($row[7] > 0) $Nwarpgood = $row[7]; 531 if($row[8] > 0) $Nwarpbad = $row[8]; 532 533 #set flags if present 534 if($Ncambad >= 1) $badcamflag = 1; 535 if($Nwarpbad >= 1) $badwarpflag = 1; 536 537 $query1 = "SELECT suba.chunk, SUM(IF(suba.Nvisits = 2,1,NULL)) as totvis2, SUM(IF(suba.Nvisits = 3 OR suba.Nvisits = 4,2,NULL)) as totvis34 FROM"; 538 $query1 .= " (SELECT substr(comment, 1, position(' ' in comment)) AS chunk,count(distinct(comment)) AS Nvisits FROM"; 539 $query1 .= " rawExp LEFT JOIN chipRun USING (exp_id) LEFT JOIN camRun USING (chip_id) WHERE dateobs like '$date%'"; 540 $query1 .= " AND exp_id > $refExpID[0] AND exp_type = 'OBJECT' AND rawExp.comment like '%visit%' AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL'"; 541 $query1 .= " AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%' group by object) as suba group by chunk;"; 542 $qry1 = $projectdb->query($query1); 543 while ($qry1->fetchInto($row)) {$NexpWWdiff = $row[1] + $row[2];} 544 545 #find the unique diff_ids for each chunk, to be matched to the diffRun catalog 546 $query2 = " SELECT diff_id,warp1,stack1,warp2,stack2 FROM "; 547 $query2 .= " diffInputSkyfile JOIN warpRun ON (warp1=warp_id OR warp2=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)"; 548 $query2 .= " WHERE rawExp.dateobs LIKE '$date%' AND exp_id > $refExpID[0] AND exp_type = 'OBJECT' AND rawExp.comment like '%visit%' AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%')"; 549 $query2 .= " AND obs_mode NOT LIKE 'ENGINEERING' AND obs_mode NOT LIKE 'MANUAL' AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%' GROUP By diff_id"; 528 550 $qry2 = $projectdb->query($query2); 529 551 530 $Ndiffs = 0; 552 $NWWdiffgood = 0; 553 $NWWdiffbad = 0; 554 $NWWdiffpub = 0; 555 556 $NWSdiffgood = 0; 557 $NWSdiffbad = 0; 558 $NWSdiffpub = 0; 559 $wrpcnt = array(); 560 531 561 while ($qry2->fetchInto($row2)) { 532 $query3 = " SELECT diff_id FROM "; 533 $query3 .= " diffRun JOIN diffInputSkyfile USING (diff_id) JOIN publishRun ON (diff_id = stage_id) JOIN warpRun ON (warp1=warp_id)"; 534 $query3 .= " WHERE stack2 IS NULL AND publishRun.state LIKE 'full' AND warp_id='$row2[0]' GROUP BY diff_id"; 535 $qry3 = $projectdb->query($query3); 536 while ($qry3->fetchInto($row3)) { 537 if ($row3[0] !=0) $Ndiffs ++; 538 } 539 540 $query3 = " SELECT diff_id FROM "; 541 $query3 .= " diffRun JOIN diffInputSkyfile USING (diff_id) JOIN publishRun ON (diff_id = stage_id) JOIN warpRun ON (warp2=warp_id)"; 542 $query3 .= " WHERE stack2 IS NULL AND publishRun.state LIKE 'full' AND warp_id='$row2[0]' GROUP BY diff_id"; 543 $qry3 = $projectdb->query($query3); 544 while ($qry3->fetchInto($row3)) { 545 if ($row3[0] !=0) $Ndiffs ++; 546 } 562 #distinguish between WW and WS diffs based on stack2 563 if ($row2[4] == 0) { 564 #find the total number of skycell and the number of skycell with a bad quality flag as well as the full publish state 565 $query3 = " SELECT count(diffSkyfile.quality) AS Ndiff,count(if(diffSkyfile.quality > 0,1,NULL)) AS Ndiffbad,count(if(publishRun.state LIKE 'full',1,NULL)) AS Npub FROM "; 566 $query3 .= " diffRun JOIN diffSkyfile USING (diff_id) LEFT JOIN publishRun ON (diffRun.diff_id = stage_id)"; 567 $query3 .= " WHERE diff_id='$row2[0]' GROUP BY diffRun.diff_id"; 568 $qry3 = $projectdb->query($query3); 569 570 while ($qry3->fetchInto($row3)) { 571 #if all skycells have bad quality, this is a bad diff. If all the skycells are in a full state in publishRun, it is fully published 572 if ($row3[1]<$row3[0]) $NWWdiffgood ++; 573 if ($row3[1]==$row3[0]) $NWWdiffbad ++; 574 if ($row3[2]==$row3[0]) $NWWdiffpub ++; 575 576 #if this wwdiff is published, record its corresponding warp_ids to see how many unique ones there are 577 if ($row3[2]==$row3[0]) $wrpcnt{$row2[1]}++; # record the presence of warp1 578 if ($row3[2]==$row3[0]) $wrpcnt{$row2[3]}++; # record the presence of warp2 579 } 580 } 581 582 if ($row2[4] > 0) { 583 #find the total number of skycell and the number of skycell with a bad quality flag as well as the full publish state 584 $query3 = " SELECT count(diffSkyfile.quality) AS Ndiff,count(if(diffSkyfile.quality > 0,1,NULL)) AS Ndiffbad,count(if(publishRun.state LIKE 'full',1,NULL)) AS Npub FROM "; 585 $query3 .= " diffRun JOIN diffSkyfile USING (diff_id) LEFT JOIN publishRun ON (diffRun.diff_id = stage_id)"; 586 $query3 .= " WHERE diff_id='$row2[0]' GROUP BY diffRun.diff_id"; 587 $qry3 = $projectdb->query($query3); 588 589 while ($qry3->fetchInto($row3)) { 590 #if all skycells have bad quality, this is a bad diff. If all the skycells are in a full state in publishRun, it is fully published 591 if ($row3[1]<$row3[0]) $NWSdiffgood ++; 592 if ($row3[1]==$row3[0]) $NWSdiffbad ++; 593 if ($row3[2]==$row3[0]) $NWSdiffpub ++; 594 } 595 } 547 596 } 548 549 if ($Ndiffs != ($Nfirstvisits*4)) $complete = "chunk not done"; 550 if ($Ndiffs == ($Nfirstvisits*4)) $complete = "chunk done"; 551 552 if ($Nfirstvisits != $Nfourvisits) { 553 $Ndiffs .= "/? "; 597 #pull out the unique warp_ids 598 $Npubwarps = count($wrpcnt); 599 600 #check for bad diffs 601 if(($NWWdiffbad >= 1) or ($NWSdiffbad >= 1)) $baddiffflag = 1; 602 603 if ($Nvis1 != $Nvis4) { 604 if ($NWWdiffpub != $NexpWWdiff) $complete = "chunk incomplete, not done"; 605 if ($NWWdiffpub == $NexpWWdiff) $complete = "chunk incomplete, done"; 554 606 } 555 if ($Nfirstvisits == $Nfourvisits) { 556 $Ndiffs .= "/"; 557 $Ndiffs .= $Nfirstvisits*4; 607 if ($Nvis1 == $Nvis4) { 608 if ($NWWdiffpub != $NexpWWdiff) $complete = "chunk complete, not done"; 609 if ($NWWdiffpub == $NexpWWdiff) $complete = "chunk complete, done"; 610 558 611 } 559 612 560 #also query for bad quality camRun exposures561 $query4 = "SELECT count(*) ";562 $query4 .= " FROM rawExp";563 $query4 .= " JOIN chipRun USING (exp_id)";564 $query4 .= " JOIN camRun USING (chip_id)";565 $query4 .= " JOIN camProcessedExp USING (cam_id)";566 $query4 .= " WHERE dateobs LIKE '$date%'";567 $query4 .= " AND exp_id > $refExpID[0]";568 $query4 .= " AND exp_type = 'OBJECT'";569 $query4 .= " AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%'";570 $query4 .= " AND (camProcessedExp.quality > 0)";571 $qry4 = $projectdb->query($query4);572 $qry4->fetchInto($badcam);573 574 575 576 613 echo "<tr>"; 577 614 578 615 echo "<td>$chunkname</td>"; 579 echo "<td>$N firstvisits</td>";580 if ($badcam[0]==0) {581 echo "<td>$Nfourvisits</td>";582 } else {583 $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">$Nfourvisits ($badcam[0])</font>";584 echo "<td>$DLStatus</td>";585 }586 echo "<td>$N diffs</td>";616 echo "<td>$Nvis1/$Nvis2/$Nvis3/$Nvis4</td>"; 617 echo "<td>$Ncamgood/$Ncambad</td>"; 618 echo "<td>$Nwarpgood/$Nwarpbad</td>"; 619 echo "<td>$Npubwarps</td>"; 620 echo "<td>$NWWdiffgood/$NWWdiffbad</td>"; 621 echo "<td>$NWWdiffpub</td>"; 622 echo "<td>$NWSdiffgood/$NWSdiffbad</td>"; 623 echo "<td>$NWSdiffpub</td>"; 587 624 echo "<td>$complete</td>"; 588 625 589 626 echo "</tr>"; 590 627 } 591 echo "</table>\n"; 628 629 630 // timer finished 631 echo "<tr><th colspan=10>"; 632 $time = microtime(); 633 $time = explode(' ', $time); 634 $time = $time[1] + $time[0]; 635 $finish = $time; 636 $total_time = round(($finish - $start), 3); 637 echo "loading in $total_time seconds."; 638 $start= $finish; 639 echo "</th></tr>"; 640 echo "</table></br>"; 592 641 593 642 } … … 631 680 $selectedLabel, $selectedStage, $plotType) { 632 681 682 // timer start 683 $time = microtime(); 684 $time = explode(' ', $time); 685 $time = $time[1] + $time[0]; 686 $start = $time; 687 688 // function begin 633 689 $isUpdate = ($selectedMode == "update"); 634 690 global $headerColor; … … 754 810 755 811 echo "</tr>\n"; 756 echo "</table>\n"; 812 813 // timer finished 814 echo "<tr><th colspan=11>"; 815 $time = microtime(); 816 $time = explode(' ', $time); 817 $time = $time[1] + $time[0]; 818 $finish = $time; 819 $total_time = round(($finish - $start), 3); 820 echo "loading in $total_time seconds."; 821 $start= $finish; 822 echo "</th></tr>"; 823 echo "</table><br>"; 757 824 } 758 825 … … 902 969 function createDatesTable($db, $proj) { 903 970 971 // timer start 972 $time = microtime(); 973 $time = explode(' ', $time); 974 $time = $time[1] + $time[0]; 975 $start = $time; 976 977 // function begin 904 978 global $table; 905 979 echo $table; … … 914 988 createServerDateRow($db, $proj, "registration"); 915 989 916 echo "</table>\n"; 990 // timer finished 991 echo "<tr><th colspan=11>"; 992 $time = microtime(); 993 $time = explode(' ', $time); 994 $time = $time[1] + $time[0]; 995 $finish = $time; 996 $total_time = round(($finish - $start), 3); 997 echo "loading in $total_time seconds."; 998 $start= $finish; 999 echo "</th></tr>"; 1000 echo "</table><br>"; 1001 917 1002 } 918 1003 … … 956 1041 function createServersTable($pass, $proj, $selectedMode, $db, $servers, $selectedLabel, $selectedStage, $plotType) { 957 1042 1043 // timer start 1044 $time = microtime(); 1045 $time = explode(' ', $time); 1046 $time = $time[1] + $time[0]; 1047 $start = $time; 1048 1049 // function begin 958 1050 // set up table columns 959 1051 global $table; … … 1042 1134 } 1043 1135 1044 echo "</table>\n"; 1136 // timer finished 1137 echo "<tr><th colspan=5>"; 1138 $time = microtime(); 1139 $time = explode(' ', $time); 1140 $time = $time[1] + $time[0]; 1141 $finish = $time; 1142 $total_time = round(($finish - $start), 3); 1143 echo "loading in $total_time seconds."; 1144 $start= $finish; 1145 echo "</th></tr>"; 1146 echo "</table><br>\n"; 1045 1147 } 1046 1148 … … 1084 1186 function getServerStatus($db,$proj, $server, &$alive, &$running) { 1085 1187 1086 $sql = "SELECT alive, running FROM science_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1"; 1188 # $sql = "SELECT alive, running FROM science_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1"; 1189 $sql = "SELECT alive, running FROM live_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1"; 1087 1190 if($debug){echo "$sql<br>";} 1088 1191 … … 1203 1306 ########################################################################### 1204 1307 function showPingStatus($Host, $DatabaseName) { 1308 // timer start 1309 $time = microtime(); 1310 $time = explode(' ', $time); 1311 $time = $time[1] + $time[0]; 1312 $start = $time; 1313 1314 // function begin 1205 1315 exec("ping -c 1 $Host", $res, $rval); 1206 1316 if ($rval == 0){ … … 1209 1319 $PingStatus = "<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">DOWN</font>"; 1210 1320 } 1211 echo "<tr><td>$DatabaseName</td><td>$PingStatus</td></tr>"; 1212 } 1213 1321 echo "<tr><td>$DatabaseName</td>"; 1322 1323 echo "</td><td>$PingStatus</td>"; 1324 // timer finished 1325 echo "<td>"; 1326 $time = microtime(); 1327 $time = explode(' ', $time); 1328 $time = $time[1] + $time[0]; 1329 $finish = $time; 1330 $total_time = round(($finish - $start), 3); 1331 echo "$total_time seconds"; 1332 $start= $finish; 1333 echo "</td></tr>"; 1334 } 1335 1336 1337 ########################################################################### 1338 # 1339 # Creates a table of summitExp against rawExp 1340 # 1341 ########################################################################### 1342 function createSummitDataTable($projectdb) { 1343 1344 // timer start 1345 $time = microtime(); 1346 $time = explode(' ', $time); 1347 $time = $time[1] + $time[0]; 1348 $start = $time; 1349 1350 // function begin 1351 $date = date("Y-m-d"); 1352 $sql = "SELECT DISTINCT exp_type FROM summitExp WHERE dateobs > '$date'"; 1353 1354 $qry = $projectdb->query($sql); 1355 if (dberror($qry)) { 1356 echo "<b>error reading newExp table</b><br>\n"; 1357 echo "<br><small><b> table query : $sql </b></small><br>\n"; 1358 menu_end(); 1359 } 1360 1361 // set up the table 1362 global $table; 1363 echo $table; 1364 echo "<tr>"; 1365 createTableTitle("Data status > $date", 4); 1366 echo "<tr>"; 1367 createTableColumnHeader("Exposure type"); 1368 createTableColumnHeader("At summit"); 1369 createTableColumnHeader("Registered at MHPCC"); 1370 createTableColumnHeader("Summit (Drop/Null)"); 1371 1372 $msg = "No science images taken since $date"; 1373 1374 // list the results 1375 while ($qry->fetchInto($expType)) { 1376 1377 $sql = "SELECT COUNT(*) FROM summitExp LEFT JOIN pzDownloadExp USING (summit_id) 1378 WHERE dateobs > '$date' AND exp_type = '$expType[0]'"; 1379 // AND state != 'drop' AND state is not null AND fault != 1042"; 1380 $qry2 = $projectdb->query($sql); 1381 $qry2->fetchInto($summit); 1382 1383 $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name 1384 WHERE summitExp.dateobs > '$date' AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'"; 1385 $qry2 = $projectdb->query($sql); 1386 $qry2->fetchInto($mhpcc); 1387 1388 $sql = "SELECT COUNT(*) FROM summitExp LEFT JOIN pzDownloadExp USING (summit_id) 1389 WHERE dateobs > '$date' AND exp_type = '$expType[0]' AND (state = 'drop' OR state is null)"; 1390 $qry2 = $projectdb->query($sql); 1391 $qry2->fetchInto($dropped); 1392 1393 1394 #Query with 30 minutes delay to check during the night if any exposures are missing. 1395 $datehour = gmdate("Y-m-d H:i:s"); 1396 $sql = "SELECT COUNT(*) FROM summitExp LEFT JOIN pzDownloadExp USING (summit_id) 1397 WHERE dateobs > '$date' AND dateobs <= date_sub('$datehour', interval 30 minute) 1398 AND exp_type = '$expType[0]' AND (state != 'drop' OR state is null) and fault != 1042"; 1399 1400 $qry2 = $projectdb->query($sql); 1401 $qry2->fetchInto($summitdelay); 1402 1403 $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name 1404 WHERE summitExp.dateobs > '$date' AND summitExp.dateobs <= date_sub('$datehour', interval 30 minute) 1405 AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'"; 1406 $qry2 = $projectdb->query($sql); 1407 $qry2->fetchInto($mhpccdelay); 1408 1409 echo "<tr>"; 1410 1411 $DLdiff = $summit[0] - $mhpcc[0]; 1412 if ($DLdiff == 0) $error = 0; 1413 else $error = 1; 1414 1415 $delayDLdiff = $summitdelay[0] - $mhpccdelay[0]; 1416 if ($delayDLdiff == 0) $errordelay = 0; 1417 else $errordelay = 1; 1418 1419 echo "<td>$expType[0]</td>"; 1420 echo "<td>$summit[0]</td>"; 1421 if ($delayDLdiff==0) { 1422 createFormattedTableCell("", "", $mhpcc[0], $error, 0); 1423 } else { 1424 $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">$mhpcc[0] ($delayDLdiff)</font>"; 1425 echo "<td>$DLStatus</td>"; 1426 } 1427 1428 echo "<td>$dropped[0]</td>"; 1429 1430 echo "</tr>"; 1431 } 1432 1433 // timer finished 1434 echo "<tr><th colspan=4>"; 1435 $time = microtime(); 1436 $time = explode(' ', $time); 1437 $time = $time[1] + $time[0]; 1438 $finish = $time; 1439 $total_time = round(($finish - $start), 3); 1440 echo "loading in $total_time seconds."; 1441 $start= $finish; 1442 echo "</th></tr>"; 1443 echo "</table><br>"; 1444 } 1445 1446 1447 function createSummitDataTable2($projectdb) { 1448 1449 // timer start 1450 $time = microtime(); 1451 $time = explode(' ', $time); 1452 $time = $time[1] + $time[0]; 1453 $start = $time; 1454 1455 // function begin 1456 $date = date("Y-m-d"); 1457 // set up the table 1458 global $table; 1459 global $columnHeaderColor; 1460 echo $table; 1461 echo "<tr>"; 1462 createTableTitle("Data status > $date", 4); 1463 echo "<tr>"; 1464 createTableColumnHeader("Exp_type at summit"); 1465 createTableColumnHeader("Status at summit"); 1466 createTableColumnHeader("Status at mhpcc"); 1467 createTableColumnHeader("Number"); 1468 $sql = "SELECT summitExp.exp_type,pzDownloadExp.state,rawExp.state,COUNT(*) FROM summitExp 1469 LEFT JOIN pzDownloadExp USING (summit_id) LEFT JOIN rawExp on summitExp.exp_name = rawExp.exp_name 1470 WHERE summitExp.dateobs > '$date' group by summitExp.exp_type,pzDownloadExp.state,rawExp.state"; 1471 $qry = $projectdb->query($sql); 1472 while ($qry->fetchInto($tmp)) { 1473 if ($tmp[1] == NULL) { 1474 echo "<tr><td>$tmp[0]<td> null <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$tmp[3]"; 1475 } 1476 else { 1477 if ($tmp[1] == 'run') { 1478 echo "<tr><td>$tmp[0]<td> loading <td> null <td bgcolor=$columnHeaderColor> <font color=\"red\">$tmp[3]"; 1479 } 1480 else { 1481 if ($tmp[2] == NULL) { 1482 echo "<tr><td>$tmp[0] <td> $tmp[1] <td> loading <td bgcolor=$columnHeaderColor> <font color=\"blue\">$tmp[3]"; 1483 } 1484 else { 1485 echo "<tr><td>$tmp[0]<td> $tmp[1] <td> downloaded <td> $tmp[3]"; 1486 } 1487 } 1488 } 1489 } 1490 1491 // timer finished 1492 echo "<tr><th colspan=4>"; 1493 $time = microtime(); 1494 $time = explode(' ', $time); 1495 $time = $time[1] + $time[0]; 1496 $finish = $time; 1497 $total_time = round(($finish - $start), 3); 1498 echo "loading in $total_time seconds."; 1499 $start= $finish; 1500 echo "</th></tr>"; 1501 echo "</table><br>"; 1502 } 1214 1503 ?> 1215 1504 -
branches/eam_branches/ipp-20191011/ippMonitor/raw/ipp.php
r40842 r41170 351 351 // loop over the lines in the file and generate lines in the menu 352 352 while ($line = fgetcsv ($file, 1024, "|")) { 353 if (ereg ('^[:blank:]*#', $line[0])) continue; 353 if (preg_match ("/#/", $line[0])) continue; 354 // if (ereg ('^[:blank:]*#', $line[0])) continue; 354 355 if (count($line) < 2) continue; 355 356 -
branches/eam_branches/ipp-20191011/ippMonitor/raw/site.php.in
r40432 r41170 13 13 $DBI = "@DBI@"; 14 14 15 // location of plots produced by czarpoll.pl 16 $CZARPLOTDIR = "./czartool_plots"; 17 $METRICSPLOTDIR = "./ippMetrics"; 18 15 19 // insert config.dat here. this contains a number of system-specific things like 16 20 // the names of database machines and users
Note:
See TracChangeset
for help on using the changeset viewer.
