com.sun.faban.harness.webclient
Class RunAnalyzer

java.lang.Object
  extended by com.sun.faban.harness.webclient.RunAnalyzer

public class RunAnalyzer
extends Object

Run Analyzer that handles all the backend tasks to analyze the runs.

Author:
Akara Sucharitakul

Nested Class Summary
static class RunAnalyzer.Type
          Analysis types.
 
Constructor Summary
RunAnalyzer()
           
 
Method Summary
static void analyze(RunAnalyzer.Type type, String[] runIdStrings, String output, String user)
          Executes the run analysis.
static void clear(String name)
          Removes the analysis results.
static boolean exists(String name)
          Checks whether the analysis with the given name exists.
static String suggestName(RunAnalyzer.Type type, String[] runIdStrings)
          Provides a suggested analysis name for the analysis based on the analysis type and and run ids that are used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunAnalyzer

public RunAnalyzer()
Method Detail

suggestName

public static String suggestName(RunAnalyzer.Type type,
                                 String[] runIdStrings)
Provides a suggested analysis name for the analysis based on the analysis type and and run ids that are used. The run id can come in the form of bench.seq or host.bench.seq. We try to keep the suggested name as short as possible. We have three formats:
  1. Generic format: type_runId1_runId2...
  2. Same benchmark: type-bench_seq1_.seq2...
  3. Same host, same benchmark: type-bench-host_seq1_seq2...

Parameters:
type - Whether it is a compare or an average
runIdStrings - The run ids to include in the analysis
Returns:
The suggested analysis name

exists

public static boolean exists(String name)
Checks whether the analysis with the given name exists.

Parameters:
name - The analysis name
Returns:
true if the analysis exists, false otherwise

clear

public static void clear(String name)
Removes the analysis results.

Parameters:
name - The name of the result to remove

analyze

public static void analyze(RunAnalyzer.Type type,
                           String[] runIdStrings,
                           String output,
                           String user)
                    throws IOException
Executes the run analysis.

Parameters:
type - The type of the analysis
runIdStrings - The run ids to analyze, in form of String array
output - The name of the analysis results
user - The user name requesting this analysis
Throws:
IOException - The analysis failed and results are not generated