Index: /tags/ipp-ps2-20190404/ippMonitor/czartool/czarpoll.pl
===================================================================
--- /tags/ipp-ps2-20190404/ippMonitor/czartool/czarpoll.pl	(revision 40759)
+++ /tags/ipp-ps2-20190404/ippMonitor/czartool/czarpoll.pl	(revision 40760)
@@ -350,29 +350,35 @@
     $plotter->setStandardMode();
 
-    foreach $stage (@stages) {
-        foreach $row ( @{$rows} ) {
-            my ($label) = @{$row};
-
-            # skip update labels for now. The plots are not relevant.
-            next if $label =~ 'ps_ud';
-
-            chomp($label);
-            $plotter->createTimeSeries($label, $stage, $begin, $end, 1, 0, 1);
-        }
-    }
+    #TdB 20190411: We are turning off these plots for the time being. They take up a lot of time and are rarely looked at. If need be, can be generated on the fly using czartool.
+    #foreach $stage (@stages) {
+    #    foreach $row ( @{$rows} ) {
+    #        my ($label) = @{$row};
+
+    #        # skip update labels for now. The plots are not relevant.
+    #        next if $label =~ 'ps_ud';
+
+    #        chomp($label);
+    #        $plotter->createTimeSeries($label, $stage, $begin, $end, 1, 0, 1);
+    #    }
+    #}
 
     my $allServerLabels = undef;
 
     # create plots for each label for all stages
-    foreach $row ( @{$rows} ) {
-        my ($label) = @{$row};
-
-        # skip update labels for now. The plots are not relevant.
-        next if $label =~ 'ps_ud';
-	# Skip individual label tables for raw-like stages.
-#	if ($stage =~ /Exp/) { next; } 
-
-        $plotter->createTimeSeries($label, undef, $begin, $end, 1, 1, 1);
-    }
+    #TdB 20190411: We are turning off some these plots for the time being.
+    #foreach $row ( @{$rows} ) {
+    #    my ($label) = @{$row};
+
+    #  #  # skip update labels for now. The plots are not relevant.
+    #  #  next if $label =~ 'ps_ud';
+    #  #  # Skip individual label tables for raw-like stages.
+    #  # if ($stage =~ /Exp/) { next; } 
+    #  #  $plotter->createTimeSeries($label, undef, $begin, $end, 1, 1, 1);
+
+    #    #TdB 20190411: Make the all stages plots for the nightlyscience labels only
+    #    if ($label =~ m/nightlyscience/) {
+    #      $plotter->createTimeSeries($label, undef, $begin, $end, 1, 0, 1);
+    #    }
+    #}
 
     $allServerLabels = "all_".$server."_labels";
@@ -380,8 +386,8 @@
     $plotter->createTimeSeries($allServerLabels, undef, $begin, $end, 1, 0, 1);
 
-    foreach $stage (@stages) {
-
-        $plotter->createTimeSeries($allServerLabels, $stage, $begin, $end, 1, 0, 1); # TODO must be a neater way...
-    }
+    #TdB 20190411: We are turning off these plots for the time being. They take up a lot of time and are rarely looked at. If need be, can be generated on the fly using czartool.
+    #foreach $stage (@stages) {
+    #    $plotter->createTimeSeries($allServerLabels, $stage, $begin, $end, 1, 0, 1); # TODO must be a neater way...
+    #}
 }
 
Index: /tags/ipp-ps2-20190404/ippMonitor/czartool/czartool/CzarDb.pm
===================================================================
--- /tags/ipp-ps2-20190404/ippMonitor/czartool/czartool/CzarDb.pm	(revision 40759)
+++ /tags/ipp-ps2-20190404/ippMonitor/czartool/czartool/CzarDb.pm	(revision 40760)
@@ -282,4 +282,5 @@
 	## labels, but this suffices for now
         push @{$labels}, 'PV3.Pole.Reprocess.20180510';
+	push @{$labels}, 'ps_ud_QUB';
     }
 
@@ -944,5 +945,5 @@
         host, used, available, writable, readable
         FROM hosts
-        ORDER BY host;
+        ORDER BY host DESC;
 SQL
 
Index: /tags/ipp-ps2-20190404/ippMonitor/czartool/czartool/Plotter.pm
===================================================================
--- /tags/ipp-ps2-20190404/ippMonitor/czartool/czartool/Plotter.pm	(revision 40759)
+++ /tags/ipp-ps2-20190404/ippMonitor/czartool/czartool/Plotter.pm	(revision 40760)
@@ -78,5 +78,7 @@
                                                     };
     $self->{_dateFormat} = "%Y%m%d-%H%M%S";
-    $self->{_outputFormat} = "png font \"".$self->{_config}->getGnuplotFont()."\" ".$self->{_config}->getGnuplotFontSize();
+    #$self->{_outputFormat} = "png font \"".$self->{_config}->getGnuplotFont()."\" ".$self->{_config}->getGnuplotFontSize();
+    $self->{_outputFormat} = "pngcairo dashed font \"".$self->{_config}->getGnuplotFont().", ".$self->{_config}->getGnuplotFontSize()."\" ";
+
 
     bless $self, $class;
@@ -463,5 +465,5 @@
         "set ylabel \"Items\";" .
         "set boxwidth 0.75;" .
-        "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" .
+        "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 1 lc 2, '' using 4 title \"Pending\" lt 1 lc 4;" .
         "\n";
 
@@ -595,4 +597,18 @@
         "set xlabel \"Time\";" .
         "set ylabel \"$yTitle\";" .
+        "set style line  1 lt 1 lw 2 lc rgb '#a6cee3';" .
+        "set style line  2 lt 1 lw 2 lc rgb '#1f78b4';" .
+        "set style line  3 lt 2 lw 2 lc rgb '#fb9a99';" .
+        "set style line  4 lt 1 lw 2 lc rgb '#e31a1c';" .
+        "set style line  5 lt 1 lw 2 lc rgb '#33a02c';" .
+        "set style line  6 lt 2 lw 2 lc rgb '#b2df8a';" .
+        "set style line  7 lt 1 lw 2 lc rgb '#ff7f00';" .
+        "set style line  8 lt 2 lw 2 lc rgb '#fdbf6f';" .
+        "set style line  9 lt 1 lw 2 lc rgb '#cab2d6';" .
+        "set style line 10 lt 1 lw 2 lc rgb '#6a3d9a';" .
+        "set style line 11 lt 3 lw 2 lc rgb 'cyan';" .
+        "set style line 12 lt 3 lw 2 lc rgb '#c51b7d';" .
+        "set style line 13 lt 3 lw 2 lc rgb '#b15928';" .
+        "set style line 14 lt 3 lw 2 lc rgb '#000004';" .
         "plot ";
 
@@ -600,4 +616,6 @@
     # loop through stages array so that they are ordered properly (not maintained in hash)
     #foreach my $stage (@allStages) {
+
+    my $plotnr = 1;
     foreach my $stage (@{$self->{allStages}}) {
 
@@ -608,12 +626,14 @@
         if ($numOfPlots == 1) {
 
-            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:2 title \"Pending\" with lines lt 4 lw 2,";
-            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:4 title \"Processed\" with lines lt 2 lw 2,";
-            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:3 title \"Faults\" with lines lt 1 lw 2";
+            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:2 title \"Pending\" with lines lt 1 lc 4 lw 2,";
+            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:4 title \"Processed\" with lines lt 1 lc 2 lw 2,";
+            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:3 title \"Faults\" with lines lt 1 lc 1 lw 2";
         }
         # when plotting multiple stages, show only processed
         else {
-
-            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:4 title \"$stage\" with lines lw 2";
+            #TdB 20190411: adding specific linetypes to the plotting command
+            #print GP "'" . $gnuplotFiles->{$stage} . "' using 1:4 title \"$stage\" with lines lw 2";
+            print GP "'" . $gnuplotFiles->{$stage} . "' using 1:4 title \"$stage\" with lines ls \"$plotnr\"";
+            $plotnr = $plotnr+1;
         }
         $firstIn = 0;
@@ -668,5 +688,5 @@
         set xlabel "Time"
         set ylabel "Available (TB)"
-        plot "$datFile" using 1:2 title "Available" with lines lt 2 lw 2, "$datFile" using 1:3 title "Theoretical" with lines lt 3 lw 2
+        plot "$datFile" using 1:2 title "Available" with lines lt 1 lc 2 lw 2, "$datFile" using 1:3 title "Theoretical" with lines lt 1 lc 3 lw 2
 PLOT
 
@@ -699,25 +719,57 @@
     GP->autoflush(1);
 
+    #TdB 20190411: There have been requests for rotating this plot to increase readability of the machine names
     if ($self->{_outputFormat} ne "X11") {print GP "set output \"$outputFile\";";}
     print GP
-        "set term $self->{_outputFormat};" .
+        "set term $self->{_outputFormat} size 640,1154;" .
         "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" .
         "set style fill solid 1.00 border -1;" .
-        "set key center top;" .
-        "set style histogram rowstacked;" .
-        "set style data histograms;" .
-        "set ylabel \"Space (TB)\";" .
-        "set xtic rotate by -90 scale 0;" .
-        "set yrange [:180];" .
+        "set bmarg 5; " .
+        "set key center right;" .
+        "set xlabel \"Space (TB)\";" .
+        "set xrange [:180];" .
+        "set ytics font '/usr/share/fonts/corefonts/arial.ttf,8';" .
+        "set multiplot;" .
+        "set origin 0.06,-0.02;" .
+        "set size 0.95,1.02;" .
+        "set ytics offset -7,0;" .
         "plot '".$tmpFile->filename."' " .
-        "using 2:xtic(1) t \"Used\" lt 7," .
-        "'' using 3 t \"Over $limit% used\" lt 1," .
-        "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," .
-        "'' using 5 t \"Free\" lt 2," .
-        "'' using 6 notitle fs solid 0.50 lt -1" .
+        "using (column(2)):(column(0)):(0):(column(2)):(column(0)-0.5):(column(0)+0.5):ytic(int(column(0))%2==1?stringcolumn(1):'') notitle lt 6 with boxxyerrorbars;" .
+        "set ytics offset -1,0;" .
+        "plot '".$tmpFile->filename."' " .
+        "using (column(2)):(column(0)):(0):(column(2)):(column(0)-0.5):(column(0)+0.5):ytic(int(column(0))%2==1?'--------':'') notitle lt 6 with boxxyerrorbars;" .
+        "set ytics offset 0.5,0;" .
+        "plot '".$tmpFile->filename."' " .
+        "using (column(2)):(column(0)):(0):(column(2)):(column(0)-0.5):(column(0)+0.5):ytic(int(column(0))%2==0?stringcolumn(1):'')  t \"Used\" lt 6 with boxxyerrorbars," .
+        "'' using (column(3)):(column(0)):(column(2)):(column(2)+column(3)):(column(0)-0.5):(column(0)+0.5) t \"Over column(limit% used\" lt 1 with boxxyerrorbars," .
+        "'' using (column(4)):(column(0)):(column(2)+column(3)):(column(2)+column(3)+column(4)):(column(0)-0.5):(column(0)+0.5) t \"Unavailable\" lt 1 lc rgb 'gray' with boxxyerrorbars," .
+        "'' using (column(5)):(column(0)):(column(2)+column(3)+column(4)):(column(2)+column(3)+column(4)+column(5)):(column(0)-0.5):(column(0)+0.5) t \"Free\" lt 1 lc 2 with boxxyerrorbars," .
+        "'' using (column(6)):(column(0)):(column(2)+column(3)+column(4)+column(5)):(column(2)+column(3)+column(4)+column(5)+column(6)):(column(0)-0.5):(column(0)+0.5) notitle lt 1 lc rgb 'gray' with boxxyerrorbars" .
         ";" .
-
+        "unset multiplot;" .
         "\n";
     close GP;
+
+    #print GP
+    #    "set term $self->{_outputFormat} size 2560,1024;" .
+    #    "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" .
+    #    "set style fill solid 1.00 border -1;" .
+    #    "set bmarg 5; " .
+    #    "set key center top;" .
+    #    "set style histogram rowstacked;" .
+    #    "set style data histograms;" .
+    #    "set ylabel \"Space (TB)\";" .
+    #    "set yrange [:180];" .
+    #    "set xtic rotate by -90 scale 0;" .
+    #    "plot '".$tmpFile->filename."' " .
+    #    "using 2:xtic(1) t \"Used\" lt 7," .
+    #    "'' using 3 t \"Over $limit% used\" lt 1," .
+    #    "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," .
+    #    "'' using 5 t \"Free\" lt 2," .
+    #    "'' using 6 notitle fs solid 0.50 lt -1" .
+    #    ";" .
+
+    #    "\n";
+    #close GP;
 }
 
@@ -746,24 +798,53 @@
     if ($self->{_outputFormat} ne "X11") {print GP "set output \"$outputFile\";";}
     print GP
-        "set term $self->{_outputFormat} size 2560,1024;" .
+        "set term $self->{_outputFormat} size 960,1731;" .
         "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" .
         "set style fill solid 1.00 border -1;" .
         "set bmarg 5; " .
-        "set key center top;" .
-        "set style histogram rowstacked;" .
-        "set style data histograms;" .
-        "set ylabel \"Space (TB)\";" .
-        "set yrange [:180];" .
-        "set xtic rotate by -90 scale 0;" .
+        "set key center right;" .
+        "set xlabel \"Space (TB)\";" .
+        "set xrange [:180];" .
+        "set ytics font '/usr/share/fonts/corefonts/arial.ttf,8';" .
+        "set multiplot;" .
+        "set origin 0.06,-0.02;" .
+        "set size 0.95,1.02;" .
+        "set ytics offset -7,0;" .
         "plot '".$tmpFile->filename."' " .
-        "using 2:xtic(1) t \"Used\" lt 7," .
-        "'' using 3 t \"Over $limit% used\" lt 1," .
-        "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," .
-        "'' using 5 t \"Free\" lt 2," .
-        "'' using 6 notitle fs solid 0.50 lt -1" .
+        "using (column(2)):(column(0)):(0):(column(2)):(column(0)-0.5):(column(0)+0.5):ytic(int(column(0))%2==1?stringcolumn(1):'') notitle lt 6 with boxxyerrorbars;" .
+        "set ytics offset -1,0;" .
+        "plot '".$tmpFile->filename."' " .
+        "using (column(2)):(column(0)):(0):(column(2)):(column(0)-0.5):(column(0)+0.5):ytic(int(column(0))%2==1?'--------':'') notitle lt 6 with boxxyerrorbars;" .
+        "set ytics offset 0.5,0;" .
+        "plot '".$tmpFile->filename."' " .
+        "using (column(2)):(column(0)):(0):(column(2)):(column(0)-0.5):(column(0)+0.5):ytic(int(column(0))%2==0?stringcolumn(1):'')  t \"Used\" lt 6 with boxxyerrorbars," .
+        "'' using (column(3)):(column(0)):(column(2)):(column(2)+column(3)):(column(0)-0.5):(column(0)+0.5) t \"Over column(limit% used\" lt 1 with boxxyerrorbars," .
+        "'' using (column(4)):(column(0)):(column(2)+column(3)):(column(2)+column(3)+column(4)):(column(0)-0.5):(column(0)+0.5) t \"Unavailable\" lt 1 lc rgb 'gray' with boxxyerrorbars," .
+        "'' using (column(5)):(column(0)):(column(2)+column(3)+column(4)):(column(2)+column(3)+column(4)+column(5)):(column(0)-0.5):(column(0)+0.5) t \"Free\" lt 1 lc 2 with boxxyerrorbars," .
+        "'' using (column(6)):(column(0)):(column(2)+column(3)+column(4)+column(5)):(column(2)+column(3)+column(4)+column(5)+column(6)):(column(0)-0.5):(column(0)+0.5) notitle lt 1 lc rgb 'gray' with boxxyerrorbars" .
         ";" .
-
+        "unset multiplot;" .
         "\n";
     close GP;
+
+    #print GP
+    #    "set term $self->{_outputFormat} size 2560,1024;" .
+    #    "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" .
+    #    "set style fill solid 1.00 border -1;" .
+    #    "set bmarg 5; " .
+    #    "set key center top;" .
+    #    "set style histogram rowstacked;" .
+    #    "set style data histograms;" .
+    #    "set ylabel \"Space (TB)\";" .
+    #    "set yrange [:180];" .
+    #    "set xtic rotate by -90 scale 0;" .
+    #    "plot '".$tmpFile->filename."' " .
+    #    "using 2:xtic(1) t \"Used\" lt 7," .
+    #    "'' using 3 t \"Over $limit% used\" lt 1," .
+    #    "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," .
+    #    "'' using 5 t \"Free\" lt 2," .
+    #    "'' using 6 notitle fs solid 0.50 lt -1" .
+    #    ";" .
+    #    "\n";
+    #close GP;
 }
 
