com.konakartadmin.utils
Class ApiAnalysis

java.lang.Object
  extended by com.konakartadmin.utils.ApiAnalysis

public class ApiAnalysis
extends java.lang.Object

Analyses the API calls collected in the specified input file For file that's specified must be a KonaKart log file that had the following log flags set: log4j.logger.com.konakart.bl.KKApiMgr = DEBUG


Nested Class Summary
 class ApiAnalysis.ApiCall
          Holds details of the ApiCall
 
Field Summary
private static int DEFAULT_TOP_N
           
 java.lang.String endingText
          ending text
 java.lang.String inputFileName
          input file name
static org.apache.commons.logging.Log log
          logger
 long maxTime
          maximum time found for single query
 java.lang.String outputFileName
          output file name
 java.lang.String startText
          starting text
 int topN
          topN statements
(package private) static java.lang.String usage
           
 
Constructor Summary
ApiAnalysis()
           
 
Method Summary
 boolean analyseApi()
          Analyses the API call information collected in the specified input file
 void apiAnalysis(java.lang.String[] args)
          Analyse the API call logging in the specified file
 java.lang.String getEndingText()
           
 java.lang.String getInputFileName()
           
 java.lang.String getOutputFileName()
           
 java.lang.String getStartText()
           
 int getTopN()
           
static void main(java.lang.String[] args)
           
 void setEndingText(java.lang.String endingText)
           
 void setInputFileName(java.lang.String inputFileName)
           
 void setOutputFileName(java.lang.String outputFileName)
           
 void setStartText(java.lang.String startText)
           
 void setTopN(int topN)
           
private  void writeResults(java.io.BufferedWriter bw, java.util.Map<java.lang.String,ApiAnalysis.ApiCall> apiHash, java.lang.String headingMean, java.lang.String headingTotal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.apache.commons.logging.Log log
logger


DEFAULT_TOP_N

private static final int DEFAULT_TOP_N
See Also:
Constant Field Values

usage

static final java.lang.String usage
See Also:
Constant Field Values

startText

public java.lang.String startText
starting text


endingText

public java.lang.String endingText
ending text


inputFileName

public java.lang.String inputFileName
input file name


outputFileName

public java.lang.String outputFileName
output file name


topN

public int topN
topN statements


maxTime

public long maxTime
maximum time found for single query

Constructor Detail

ApiAnalysis

public ApiAnalysis()
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args -

apiAnalysis

public void apiAnalysis(java.lang.String[] args)
Analyse the API call logging in the specified file

Parameters:
args - command line arguments

analyseApi

public boolean analyseApi()
                   throws KKAdminException,
                          java.io.IOException
Analyses the API call information collected in the specified input file

Returns:
true if the file was parsed successfully otherwise false
Throws:
KKAdminException - if the file could not be found
java.io.IOException - if the files could not be read or written

writeResults

private void writeResults(java.io.BufferedWriter bw,
                          java.util.Map<java.lang.String,ApiAnalysis.ApiCall> apiHash,
                          java.lang.String headingMean,
                          java.lang.String headingTotal)
                   throws java.io.IOException
Throws:
java.io.IOException

getInputFileName

public java.lang.String getInputFileName()
Returns:
the inputFileName

setInputFileName

public void setInputFileName(java.lang.String inputFileName)
Parameters:
inputFileName - the inputFileName to set

getOutputFileName

public java.lang.String getOutputFileName()
Returns:
the outputFileName

setOutputFileName

public void setOutputFileName(java.lang.String outputFileName)
Parameters:
outputFileName - the outputFileName to set

getTopN

public int getTopN()
Returns:
the topN

setTopN

public void setTopN(int topN)
Parameters:
topN - the topN to set

getStartText

public java.lang.String getStartText()
Returns:
the startText

setStartText

public void setStartText(java.lang.String startText)
Parameters:
startText - the startText to set

getEndingText

public java.lang.String getEndingText()
Returns:
the endingText

setEndingText

public void setEndingText(java.lang.String endingText)
Parameters:
endingText - the endingText to set


Copyright © 2011 DS Data Systems UK Ltd.