jpl.mipl.mdms.web.domain
Class StatsHtmlPrinter

java.lang.Object
  extended by jpl.mipl.mdms.web.domain.StatsHtmlPrinter

public class StatsHtmlPrinter
extends Object

Purpose: Utility that writes server metric information as a set of HTML tables.

   Copyright 2006, California Institute of Technology.
   ALL RIGHTS RESERVED.
   U.S. Government Sponsorship acknowledge. 2006.
   
 ============================================================================
 Modification History :
 ----------------------

 Date              Who              What
 ----------------------------------------------------------------------------
 08/10/2006        Nick             Initial Release
 ============================================================================
 

Version:
$Id: StatsHtmlPrinter.java,v 1.2 2008/02/20 02:00:00 ntt Exp $
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Field Summary
static float DANGER_RATIO
           
protected  DateFormat dateFormat
           
protected  String dateFormatPattern
           
static String DOCTYPE
           
protected  NumberFormat percentFormat
           
static int REFRESH_WAIT_SECONDS
           
 
Constructor Summary
StatsHtmlPrinter()
          Constructor
 
Method Summary
static String headWithTitle(String title)
           
protected  void printContents(PrintWriter out, DomainModel dModel, String[] groups)
          Prints the domain contents
protected  void printEntry(PrintWriter out, String group, ServerMetrics metrix)
          Prints the metrics information for a given server
 void writeTables(PrintWriter out, DomainModel dModel, String[] groups)
          Writes the domain contents as a set of tables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCTYPE

public static final String DOCTYPE
See Also:
Constant Field Values

REFRESH_WAIT_SECONDS

public static final int REFRESH_WAIT_SECONDS
See Also:
Constant Field Values

DANGER_RATIO

public static final float DANGER_RATIO
See Also:
Constant Field Values

dateFormatPattern

protected String dateFormatPattern

dateFormat

protected DateFormat dateFormat

percentFormat

protected NumberFormat percentFormat
Constructor Detail

StatsHtmlPrinter

public StatsHtmlPrinter()
Constructor

Method Detail

headWithTitle

public static String headWithTitle(String title)

writeTables

public void writeTables(PrintWriter out,
                        DomainModel dModel,
                        String[] groups)
Writes the domain contents as a set of tables

Parameters:
out - PrintWriter
dModel - Domain model
groups - Array of server groups for which information will be printed.

printContents

protected void printContents(PrintWriter out,
                             DomainModel dModel,
                             String[] groups)
Prints the domain contents


printEntry

protected void printEntry(PrintWriter out,
                          String group,
                          ServerMetrics metrix)
Prints the metrics information for a given server

Parameters:
out - Output
group - Server group name
metrix - Instance of metrics for a server