public class

ClientLog

extends Object
java.lang.Object
   ↳ com.microstrategy.web.app.utils.ClientLog

Class Overview

This class includes generic methods for having a way for measuring client rendering times. It depends on three global JavaScript variables that should be defined on a script included on all pages (for example, DHTML.js): globalLogNames and globalLogTimes. These variables are arrays where the component names (identifiers) and the time they took for rendering will be stored.

Summary

Constants
int MONITOR_LEVEL_ACTION Indicates the level of monitoring will include only those that come from an action.
int MONITOR_LEVEL_ALL Indicates the level of monitoring will include pages and other components (beans/transforms) that have the monitoring mechanism included
int MONITOR_LEVEL_DETAILED Indicates the level of monitoring will include only those that come from inner components.
int MONITOR_LEVEL_METHOD Indicates the level of monitoring will include only those that come from a method.
int MONITOR_LEVEL_PAGE Indicates the level of monitoring will include only those that come from pages.
int MONITOR_TYPE_LIVE Indicates the Monitoring Type of connection is live - pages will be accessed directly from the web server
int MONITOR_TYPE_STATIC Indicates the Monitoring Type of connection is static - pages will be saved first into a client computer and from there statistics will be requested
int VIEW_MODE_BROWSER_ALERT Flag for indicating the view mode of the log statistics will be through an alert displayed on the client's browser.
int VIEW_MODE_BROWSER_INLINE Flag for indicating the view mode of the log statistics will be through an floating div displayed on the client's browser.
int VIEW_MODE_HTML_REPORT Flag for indicating the view mode of the log statistics will be through an HTML page loaded on the client's computer.
int VIEW_MODE_LOG_FILE Flag for indicating the view mode of the log statistics will be through a log file generated on the web server machine.
Public Constructors
ClientLog()
Public Methods
static AppContext getAppContext()
Getter for the AppContext object
static String getLoggingForm()
Gets the logging page where the form to be submitted with the client performance information is located
static String getLoggingPage()
Gets the logging page that will be accessed for obtaining the statistics information
static int getMonitorLevel()
Gets the level of monitoring this utility will perform
static String getMonitorLogFile()
Gets the location of the log file to create/update if the monitoring view mode is to generate it
static int getMonitorType()
Gets the type of monitoring that this utility will perform
static boolean getTraceIsOn()
Determines if tracing is on or not.
static int getViewMode()
Gets the type of monitoring that this utility will perform
static void initializePerformance(MarkupOutput out)
Defines the required elements for the monitoring to be fully enabled.
static void initializePerformanceClientActions(MarkupOutput out)
Adds script to the HTML page for the method and action level.
static void logEndTime(String componentId, MarkupOutput out)
Ends the timer for the component specified and save the performance information for latter display.
static void logEndTime(String componentId, MarkupOutput out, int levelFlag)
Ends the timer for the component specified and save the performance information for latter display.
static void logStartTime(String componentId, MarkupOutput out)
Starts the timer for the component specified.
static void logStartTime(String componentId, MarkupOutput out, int levelFlag)
Starts the timer for the component specified
static void processPerformance(ArrayList newNames, ArrayList newTimes, String sURL, String urlObjID)
Updates the log file in the web server with the information the client has sent it via cookies
static void setAppContext(AppContext appContext)
Setter for the AppContext object
static void setLoggingForm(String webForm)
Sets the logging page where the form to be submitted with the client performance information is located
static void setLoggingPage(String webPage)
Sets the logging page that will be accessed for obtaining the statistics information
static void setMonitorLevel(int value)
Sets the level of monitoring this utility will perform
static void setMonitorLogFile(String filePath)
Sets the location of the log file to create/update if the monitoring view mode is to generate it
static void setMonitorType(int value)
Sets the type of monitoring that this utility will perform
static void setViewMode(int value)
Sets the type of view mode that this monitoring utility will perform
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int MONITOR_LEVEL_ACTION

Indicates the level of monitoring will include only those that come from an action.

Constant Value: 8 (0x00000008)

public static final int MONITOR_LEVEL_ALL

Indicates the level of monitoring will include pages and other components (beans/transforms) that have the monitoring mechanism included

Constant Value: 15 (0x0000000f)

public static final int MONITOR_LEVEL_DETAILED

Indicates the level of monitoring will include only those that come from inner components.

Constant Value: 2 (0x00000002)

public static final int MONITOR_LEVEL_METHOD

Indicates the level of monitoring will include only those that come from a method.

Constant Value: 4 (0x00000004)

public static final int MONITOR_LEVEL_PAGE

Indicates the level of monitoring will include only those that come from pages.

Constant Value: 1 (0x00000001)

public static final int MONITOR_TYPE_LIVE

Indicates the Monitoring Type of connection is live - pages will be accessed directly from the web server

Constant Value: 1 (0x00000001)

public static final int MONITOR_TYPE_STATIC

Indicates the Monitoring Type of connection is static - pages will be saved first into a client computer and from there statistics will be requested

Constant Value: 2 (0x00000002)

public static final int VIEW_MODE_BROWSER_ALERT

Flag for indicating the view mode of the log statistics will be through an alert displayed on the client's browser.

Constant Value: 4 (0x00000004)

public static final int VIEW_MODE_BROWSER_INLINE

Flag for indicating the view mode of the log statistics will be through an floating div displayed on the client's browser.

Constant Value: 8 (0x00000008)

public static final int VIEW_MODE_HTML_REPORT

Flag for indicating the view mode of the log statistics will be through an HTML page loaded on the client's computer. For this flag to be applied, it requires the Monitoring Type to be Live.

Constant Value: 2 (0x00000002)

public static final int VIEW_MODE_LOG_FILE

Flag for indicating the view mode of the log statistics will be through a log file generated on the web server machine. For this flag to be applied, it requires the Monitoring Type to be Live.

Constant Value: 1 (0x00000001)

Public Constructors

public ClientLog ()

Public Methods

public static AppContext getAppContext ()

Getter for the AppContext object

public static String getLoggingForm ()

Gets the logging page where the form to be submitted with the client performance information is located

Returns
  • the url of the page to access

public static String getLoggingPage ()

Gets the logging page that will be accessed for obtaining the statistics information

Returns
  • a String with the url to access

public static int getMonitorLevel ()

Gets the level of monitoring this utility will perform

Returns
  • a value indicating if the monitoring will be done at all levels, only pages, or none.

public static String getMonitorLogFile ()

Gets the location of the log file to create/update if the monitoring view mode is to generate it

Returns
  • a String containing the full location of where the log file might be placed.

public static int getMonitorType ()

Gets the type of monitoring that this utility will perform

Returns
  • a value indicating if the monitoring will be done live or static.

public static boolean getTraceIsOn ()

Determines if tracing is on or not.

Returns
  • true if tracing is enabled, otherwise returns false

public static int getViewMode ()

Gets the type of monitoring that this utility will perform

Returns
  • a value indicating if the monitoring will be done live or static.

public static void initializePerformance (MarkupOutput out)

Defines the required elements for the monitoring to be fully enabled. This calls needs to be executed only once in all the code that will be used for rendering the page to be analyzed.

Parameters
out a MarkupOutput instance where the output of this method will be written to.

public static void initializePerformanceClientActions (MarkupOutput out)

Adds script to the HTML page for the method and action level.

public static void logEndTime (String componentId, MarkupOutput out)

Ends the timer for the component specified and save the performance information for latter display. For this monitoring to happen, the Monitor Level should be set to Detailed or All Levels

Parameters
componentId An identifier for the component to measure. The string should not contain blank spaces or characters that are invalid for JavaScript
out a MarkupOutput instance where the output of this method will be written to.

public static void logEndTime (String componentId, MarkupOutput out, int levelFlag)

Ends the timer for the component specified and save the performance information for latter display.

Parameters
componentId An identifier for the component to measure. The string should not contain blank spaces or characters that are invalid for JavaScript
out a MarkupOutput instance where the output of this method will be written to.
levelFlag integer that indicates the level at which this method has been called. This flag needs to coincide with the current Monitor Level for the monitoring to be performed.

public static void logStartTime (String componentId, MarkupOutput out)

Starts the timer for the component specified. For this monitoring to happen, the Monitor Level should be set to Detailed or at All Levels

Parameters
componentId An identifier for the component to measure. The string should not contain blank spaces or characters that are invalid for JavaScript
out a MarkupOutput instance where the output of this method will be written to.

public static void logStartTime (String componentId, MarkupOutput out, int levelFlag)

Starts the timer for the component specified

Parameters
componentId An identifier for the component to measure. The string should not contain blank spaces or characters that are invalid for JavaScript
out a MarkupOutput instance where the output of this method will be written to.
levelFlag integer that indicates the level at which this method has been called. This flag needs to coincide with the current Monitor Level for the monitoring to be performed.

public static void processPerformance (ArrayList newNames, ArrayList newTimes, String sURL, String urlObjID)

Updates the log file in the web server with the information the client has sent it via cookies

Parameters
newNames an Array of Strings with the name of the components that were analyzed
newTimes an Array of String with the times each one of the components took to render
sURL the URL that was originally called
urlObjID (for MFCBlaster purposes) a unique identifier for the URL being analyzed

public static void setAppContext (AppContext appContext)

Setter for the AppContext object

public static void setLoggingForm (String webForm)

Sets the logging page where the form to be submitted with the client performance information is located

Parameters
webForm the url of the page to access

public static void setLoggingPage (String webPage)

Sets the logging page that will be accessed for obtaining the statistics information

Parameters
webPage the url of the page to access

public static void setMonitorLevel (int value)

Sets the level of monitoring this utility will perform

Parameters
value a flag indicating if the monitoring will be done at all levels, only pages, or none.

public static void setMonitorLogFile (String filePath)

Sets the location of the log file to create/update if the monitoring view mode is to generate it

Parameters
filePath a String containing the full location of where the log file might be placed.

public static void setMonitorType (int value)

Sets the type of monitoring that this utility will perform

Parameters
value a flag indicating if the monitoring will be done live or static.

public static void setViewMode (int value)

Sets the type of view mode that this monitoring utility will perform

Parameters
value a flag indicating the type of view mode of the monitoring results