net.sf.infrared.web.ui
Class ViewUtil

java.lang.Object
  extended bynet.sf.infrared.web.ui.ViewUtil

public class ViewUtil
extends Object

Utility methods used by InfraRED web GUI.


Constructor Summary
ViewUtil()
           
 
Method Summary
static String extractMethodName(String name)
           
static AggregateApiTime[] getAggregateJDBCSummary(AggregateOperationTree tree)
           
static ContextApiTime[] getComponentSummary(HttpSession session, String apiType)
           
static String getFormattedTime(double time)
          Gets the String format of the given double with two places after decimal point
static String getFormattedTime(double time, int precision)
          Gets the String format of the given double with the given number of integers after the decimal point.
static String getFormattedTime(String time, int precision)
           
static AggregateApiTime[] getJDBCSummary(AggregateOperationTree tree)
          Gets the summary of JDBC APIs for this operation.
static AggregateApiTime[] getJDBCSummary(AggregateOperationTree[] trees)
          Gets the aggregate of JDBC AIP executions across an array of operations.
protected static void getJDBCSummary(TreeNode node, List list)
           
static String getSortByHrefInLayer(String sortBy, String sortDir, String currentSortBy, String apiType, String exclusiveInclusiveMode)
           
static String getSortByHrefInSummary(String sortBy, String sortDir, String currentSortBy)
           
static String getSortByIconInLayer(String sortBy, String sortDir, String currentSortBy, String exclusiveInclusiveMode)
           
static String getSortByIconInSummary(String sortBy, String sortDir, String currentSortBy)
           
static String getSqlLog(PerformanceDataSnapShot pefData, AggregateOperationTree tree)
           
static SqlStatistics[] getSqlStatistics(AggregateApiTime[] apiTimes)
           
static AggregateApiTime[] getSummaryForALayer(HttpServletRequest request, HttpSession session, String apiType)
           
static AggregateApiTime[] getSummaryForALayer(PerformanceDataSnapShot perfData, String layer)
           
static ContextApiTime[] getSummaryOfAllComponents(HttpSession session)
           
static SqlStatistics[] getTopNQueriesByCount(SqlStatistics[] sqlStatistics, int n)
           
static SqlStatistics[] getTopNQueriesByExecutionTime(SqlStatistics[] sqlStatistics, int n)
           
static void sort(AggregateApiTime[] arr, HttpServletRequest request)
          Sorts an array of TimeVo object in-place.
static void sort(LayerTime[] layerTimes, String fieldName, boolean ascending)
           
static void sort(String sortBy, boolean ascending, AggregateApiTime[] arr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewUtil

public ViewUtil()
Method Detail

getFormattedTime

public static String getFormattedTime(double time)
Gets the String format of the given double with two places after decimal point

Parameters:
time -
Returns:

getFormattedTime

public static String getFormattedTime(double time,
                                      int precision)
Gets the String format of the given double with the given number of integers after the decimal point.

Parameters:
time -
precision - the number of places after the decimal point.
Returns:

getFormattedTime

public static String getFormattedTime(String time,
                                      int precision)

getJDBCSummary

public static AggregateApiTime[] getJDBCSummary(AggregateOperationTree[] trees)
Gets the aggregate of JDBC AIP executions across an array of operations.

Parameters:
trees -
Returns:

getAggregateJDBCSummary

public static AggregateApiTime[] getAggregateJDBCSummary(AggregateOperationTree tree)

getJDBCSummary

public static AggregateApiTime[] getJDBCSummary(AggregateOperationTree tree)
Gets the summary of JDBC APIs for this operation. Returns an array of AggregateApiTime objects which are the root of all JDBC operation subtrees in different execution paths of the given operation.

Parameters:
tree -
Returns:

sort

public static void sort(AggregateApiTime[] arr,
                        HttpServletRequest request)
Sorts an array of TimeVo object in-place. The sort criteria is determined by the sortBy and sortDir request parameters.

Parameters:
arr -
request -

sort

public static void sort(String sortBy,
                        boolean ascending,
                        AggregateApiTime[] arr)

sort

public static void sort(LayerTime[] layerTimes,
                        String fieldName,
                        boolean ascending)

getSummaryForALayer

public static AggregateApiTime[] getSummaryForALayer(PerformanceDataSnapShot perfData,
                                                     String layer)

getSummaryForALayer

public static AggregateApiTime[] getSummaryForALayer(HttpServletRequest request,
                                                     HttpSession session,
                                                     String apiType)

getSummaryOfAllComponents

public static ContextApiTime[] getSummaryOfAllComponents(HttpSession session)

getComponentSummary

public static ContextApiTime[] getComponentSummary(HttpSession session,
                                                   String apiType)

getJDBCSummary

protected static void getJDBCSummary(TreeNode node,
                                     List list)

getTopNQueriesByExecutionTime

public static SqlStatistics[] getTopNQueriesByExecutionTime(SqlStatistics[] sqlStatistics,
                                                            int n)

getTopNQueriesByCount

public static SqlStatistics[] getTopNQueriesByCount(SqlStatistics[] sqlStatistics,
                                                    int n)

getSqlStatistics

public static SqlStatistics[] getSqlStatistics(AggregateApiTime[] apiTimes)

extractMethodName

public static String extractMethodName(String name)

getSqlLog

public static String getSqlLog(PerformanceDataSnapShot pefData,
                               AggregateOperationTree tree)

getSortByHrefInLayer

public static String getSortByHrefInLayer(String sortBy,
                                          String sortDir,
                                          String currentSortBy,
                                          String apiType,
                                          String exclusiveInclusiveMode)

getSortByHrefInSummary

public static String getSortByHrefInSummary(String sortBy,
                                            String sortDir,
                                            String currentSortBy)

getSortByIconInLayer

public static String getSortByIconInLayer(String sortBy,
                                          String sortDir,
                                          String currentSortBy,
                                          String exclusiveInclusiveMode)

getSortByIconInSummary

public static String getSortByIconInSummary(String sortBy,
                                            String sortDir,
                                            String currentSortBy)