Index: trunk/tools/czartool/Metrics.pm
===================================================================
--- trunk/tools/czartool/Metrics.pm	(revision 29866)
+++ trunk/tools/czartool/Metrics.pm	(revision 29867)
@@ -47,3 +47,77 @@
 }
 
+###########################################################################
+#
+# Writes HTML intro
+#
+###########################################################################
+sub createHtml {
+    my ($self, $title) = @_; 
+
+    open (FILE, ">$self->{path}/index.html");
+    $self->{htmlFile} = *FILE;
+
+    my $htmlFile = $self->{htmlFile};
+    print $htmlFile "<html>\n"; 
+    print $htmlFile "<head>\n";
+    print $htmlFile "<title>$title</title>\n";
+    print $htmlFile "<a name=\"top\"></a>\n";
+    print $htmlFile "<h1 align=\"middle\">$title</h1>\n";
+}
+
+###########################################################################
+#
+# Creates summary plots for period 
+#
+###########################################################################
+sub createSummaryPlots {
+    my ($self) = @_;
+
+    my $htmlFile = $self->{htmlFile};
+
+    print $htmlFile "<a name=\"summaryplot\"></a>\n";
+    print $htmlFile "<h2  align=\"middle\">Summary plots <a href=\"#top\">(top)</a></h1>\n";
+    $self->{plotter}->createTimeSeries("all_stdscience_labels", undef, $self->{begin}, $self->{end}, 0, 0, 0);
+    print $htmlFile "<img src=\"czarplot_linear_all_stdscience_labels_all_stages_t.png\" alt=\"timeseries\" />\n";
+    $self->{plotter}->createHistogram("all_stdscience_labels", $self->{begin}, $self->{end}, 0, 0, 0);
+    print $htmlFile "<img src=\"czarplot_linear_all_stdscience_labels_all_stages_h.png\" alt=\"histogram\" />\n";
+    $self->{plotter}->createRateTimeSeries("all_stdscience_labels", undef, $self->{begin}, $self->{end}, undef, 0);
+    print $htmlFile "<img src=\"czarplot_linear_all_stdscience_labels_all_stages_r.png\" alt=\"rate\" />\n";
+    $self->{plotter}->plotStorageTimeSeries($self->{begin}, $self->{end});
+    print $htmlFile "<img src=\"czarplot_cluster.png\" alt=\"storage plot not available\" />\n";
+}
+
+###########################################################################
+#
+# Creates magic mask plots for provided period 
+#
+###########################################################################
+sub createMaskPlots {
+    my ($self, $begin, $end) = @_;
+
+    my $htmlFile = $self->{htmlFile};
+
+    print $htmlFile "<a name=\"mask\"></a>\n";
+    print $htmlFile "<h2  align=\"middle\">Magic mask fraction <a href=\"#top\">(top)</a></h1>\n";
+
+    $self->{plotter}->plotMagicMaskFraction($begin, $end);
+    print $htmlFile "<img src=\"czarplot_magic_mask_fraction_h.png\" alt=\"\" />\n";
+    print $htmlFile "<img src=\"czarplot_magic_mask_fraction_d.png\" alt=\"\" />\n";
+}
+
+###########################################################################
+#
+# Writes HTML intro
+#
+###########################################################################
+sub finishHtml {
+    my ($self) = @_;
+
+    my $htmlFile = $self->{htmlFile};
+
+    print $htmlFile "<br>\n";
+    print $htmlFile "</body>\n";
+    print $htmlFile "</html>\n";
+    close($htmlFile);
+}
 1;
