Changeset 42180 for trunk/ippMonitor
- Timestamp:
- Apr 27, 2022, 12:20:56 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/raw/czartool_labels.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/raw/czartool_labels.php
r42040 r42180 285 285 // nebulous dbs 286 286 showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $LABEL_NEBULOUS); 287 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_LABEL_NEBULOUS);287 //showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_LABEL_NEBULOUS); 288 288 showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_LABEL_NEBULOUS_SECONDARY); 289 289 showReplicationsStatus($REPL_HOST_NEBULOUS_TERTIARY, $REPL_USER_NEBULOUS_TERTIARY, $REPL_PASSWORD_NEBULOUS_TERTIARY, $REPL_LABEL_NEBULOUS_TERTIARY); … … 364 364 # gnuplots 365 365 # time series plot 366 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";367 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=log\"><br><br>";366 # echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>"; 367 # echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=log\"><br><br>"; 368 368 # rate series plot 369 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>"; 369 # echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>"; 370 #for dev version 371 # google chart 372 # time series plot 373 echo Gettimeseries($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage); 374 # rate series plot 375 echo Getrate($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage); 370 376 } else { 371 377 # google chart … … 375 381 echo Getrate($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage); 376 382 } 383 377 384 378 385 # data quality timeseries … … 1720 1727 1721 1728 $sql = "select format(used/total*100,1), usable from cluster_space order by timestamp desc limit 1;"; 1729 1722 1730 if ($debug) {echo "$sql<br>";} 1723 1731 $qry = $db->query($sql); … … 1830 1838 1831 1839 #also find the median zeropoint 1832 foreach($DQarray as $row) {1833 $zpt[] = $row[3];1834 }1835 1836 sort($zpt);1837 $count = sizeof($zpt); // cache the count1838 $index = floor($count/2); // cache the index1839 $zpt_med = $zpt[$index];1840 # foreach($DQarray as $row) { 1841 # $zpt[] = $row[3]; 1842 # } 1843 1844 # sort($zpt); 1845 # $count = sizeof($zpt); // cache the count 1846 # $index = floor($count/2); // cache the index 1847 # $zpt_med = $zpt[$index]; 1840 1848 1841 1849 #echo "<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>"; … … 1927 1935 echo " data.addColumn('datetime', 'Time');"; 1928 1936 echo " data.addColumn('number', 'zeropoint');"; 1937 echo " data.addColumn({'type': 'string', 'role': 'style'});"; 1929 1938 echo " data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});"; 1930 1939 echo " data.addColumn({id:'i0', type:'number', role:'interval'});"; 1940 echo " data.addColumn({id:'i0','type': 'string', 'role': 'style'});"; 1931 1941 echo " data.addColumn({id:'i0', type:'number', role:'interval'});"; 1942 echo " data.addColumn({id:'i0','type': 'string', 'role': 'style'});"; 1932 1943 echo " data.addRows(["; 1933 1944 foreach($DQarray as $row) { … … 1940 1951 $zp_low = $zp-$zp_stdev; 1941 1952 $zp_high = $zp+$zp_stdev; 1953 $col_string = '#0000ff'; 1954 $zpt_off = 0.; 1942 1955 1943 1956 $tt_string1 = sprintf('time: %s\n zeropoint: %s\n filter: %s\n exp_time: %s\n comment: %s', $timestamp, $zp,$row[5],$row[6],$row[7]); 1944 1957 # new Date(Year, Month, Day, Hours, Minutes, Seconds, Milliseconds) 1945 echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zp,'$ tt_string1', $zp_low, $zp_high],";1958 echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zp,'$col_string','$tt_string1', $zp_low,'$col_string', $zp_high,'$col_string'],"; 1946 1959 } 1947 1960 … … 1958 1971 echo " alignment: 'center',"; 1959 1972 echo " },"; 1960 echo " lineWidth: 2, ";1961 1973 echo " series: {"; 1962 echo " 0: { color: '#0000ff' , lineWidth: 3}, ";1974 echo " 0: { color: '#0000ff'}, "; 1963 1975 echo " },"; 1964 echo " intervals: { 'style':'line'}, ";1976 echo " intervals: { color: 'grey','style':'points', pointSize: 1 }, "; 1965 1977 echo " hAxis: { "; 1966 1978 echo " title: 'Date/Time (HST)',"; … … 1974 1986 echo " fontSize: 12,"; 1975 1987 echo " };"; 1976 echo " var chart = new google.visualization. LineChart(document.getElementById('dqzp_div'));";1988 echo " var chart = new google.visualization.ScatterChart(document.getElementById('dqzp_div'));"; 1977 1989 echo " chart.draw(data, options);"; 1978 1990 echo " }"; … … 1997 2009 echo " data.addColumn('datetime', 'Time');"; 1998 2010 echo " data.addColumn('number', 'zeropoint');"; 2011 echo " data.addColumn({'type': 'string', 'role': 'style'});"; 1999 2012 echo " data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});"; 2000 2013 echo " data.addColumn({id:'i0', type:'number', role:'interval'});"; 2001 echo " data.addColumn({id:'i 0', type:'number', role:'interval'});";2014 echo " data.addColumn({id:'i1', type:'number', role:'interval'});"; 2002 2015 echo " data.addRows(["; 2003 2016 foreach($DQarray as $row) { … … 2008 2021 $zp = $row[3]; 2009 2022 $zp_stdev = $row[4]; 2010 $zp_low = $zp-$zp_stdev; 2011 $zp_high = $zp+$zp_stdev; 2023 $zp_low = $zp_stdev; 2024 $zp_high = $zp_stdev; 2025 $col_string = '#0000ff'; 2026 $zpt_off = 0.; 2027 2028 #if(substr($row[5],0,1) == 'g') {$col_string = 'blue'; $zpt_off = $zp - 24.563;} 2029 #if(substr($row[5],0,1) == 'r') {$col_string = 'red'; $zpt_off = $zp - 24.740;} 2030 #if(substr($row[5],0,1) == 'i') {$col_string = '#6a3d9a'; $zpt_off = $zp - 24.611;} 2031 #if(substr($row[5],0,1) == 'z') {$col_string = 'green'; $zpt_off = $zp - 24.250;} 2032 #if(substr($row[5],0,1) == 'y') {$col_string = 'cyan'; $zpt_off = $zp - 23.320;} 2033 #if(substr($row[5],0,1) == 'w') {$col_string = 'grey'; $zpt_off = $zp - 26.300;} 2034 2035 #define new zeropoints 2036 if(substr($row[5],0,1) == 'g') {$col_string = 'blue'; $zpt_off = $zp - 25.013;} 2037 if(substr($row[5],0,1) == 'r') {$col_string = 'red'; $zpt_off = $zp - 24.840;} 2038 if(substr($row[5],0,1) == 'i') {$col_string = '#6a3d9a'; $zpt_off = $zp - 24.711;} 2039 if(substr($row[5],0,1) == 'z') {$col_string = 'green'; $zpt_off = $zp - 24.30;} 2040 if(substr($row[5],0,1) == 'y') {$col_string = 'cyan'; $zpt_off = $zp - 23.57;} 2041 if(substr($row[5],0,1) == 'w') {$col_string = 'grey'; $zpt_off = $zp - 26.000;} 2012 2042 2013 2043 $tt_string1 = sprintf('time: %s\n zeropoint: %s\n filter: %s\n exp_time: %s\n comment: %s', $timestamp, $zp,$row[5],$row[6],$row[7]); 2014 2044 # new Date(Year, Month, Day, Hours, Minutes, Seconds, Milliseconds) 2015 echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zp ,'$tt_string1', $zp_low, $zp_high],";2045 echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zpt_off,'$col_string','$tt_string1', $zp_low, $zp_high],"; 2016 2046 } 2017 2047 … … 2028 2058 echo " alignment: 'center',"; 2029 2059 echo " },"; 2030 echo " lineWidth: 2, ";2060 echo " pointSize: 3, "; 2031 2061 echo " series: {"; 2032 echo " 0: { color: '#0000ff' , lineWidth: 3}, ";2062 echo " 0: { color: '#0000ff'}, "; 2033 2063 echo " },"; 2034 echo " intervals: { 'style':'line'}, ";2064 echo " intervals: { color: 'grey','style':'points', pointSize: 1 }, "; 2035 2065 echo " hAxis: { "; 2036 2066 echo " title: 'Date/Time (HST)',"; … … 2039 2069 echo " },"; 2040 2070 echo " vAxis: { "; 2041 echo " title: 'Zeropoint (mag)',";2042 echo " viewWindow: { min: $zpt_med-0.2, max: $zpt_med+0.2}, ";2071 echo " title: 'Zeropoint offset (mag)',"; 2072 echo " viewWindow: { min: -0.5, max: 0.5 }, "; 2043 2073 echo " },"; 2044 2074 echo " chartArea: {left:80, top:50, right:20, bottom:50},"; 2045 2075 echo " fontSize: 12,"; 2046 2076 echo " };"; 2047 echo " var chart = new google.visualization. LineChart(document.getElementById('dqzp_zoom_div'));";2077 echo " var chart = new google.visualization.ScatterChart(document.getElementById('dqzp_zoom_div'));"; 2048 2078 echo " chart.draw(data, options);"; 2049 2079 echo " }"; … … 2060 2090 echo "<center>loading plot in $total_time seconds<br></center>"; 2061 2091 } 2062 2063 2092 2064 2093 ########################################################################### … … 2968 2997 2969 2998 ?> 2970
Note:
See TracChangeset
for help on using the changeset viewer.
