public class

StatsHandler

extends FileHandler
implements StatsHandlerSupport
java.lang.Object
   ↳ com.microstrategy.utils.log.Handler
     ↳ com.microstrategy.utils.log.StreamHandler
       ↳ com.microstrategy.utils.log.FileHandler
         ↳ com.microstrategy.web.app.StatsHandler

Class Overview

This class implements the StatsHandlerSupport interface and extends the FileHandler class.

Summary

Constants
String APPLICATION_METHOD
String APPLICATION_REQUEST
int FORMAT_HTML
int FORMAT_TEXT_TAB_DELIMITED
String FORWARDED_REQUEST
[Expand]
Inherited Constants
From interface com.microstrategy.web.app.StatsHandlerSupport
[Expand]
Inherited Fields
From class com.microstrategy.utils.log.FileHandler
Public Methods
void clear()
Clears out collected statistics.
StatsHandlerSupport.Data endRequest(String sessionID, Writer out)
This is used to mark the end of statistics collection, and print out statistics to the specified writer.
StatsHandlerSupport.Data endRequest(String sessionID)
This is used to mark the end of statistics collection
static StatsHandlerSupport getInstance()
Returns our singleton StatsHandlerSupport instance.
StatsHandlerSupport.Data indicateEndOfApp(String sessionID)
Indicate the end of the Application Level request.
boolean isDisabled()
Whether Web Statistics are disabled or not.
void publish(LogRecord record)
Publish the log information
void saveStatsToHeaders(int statCode, ContainerServices cntrSvcs)
Save a collection of statistics to HTTP headers.
void setLogFileName(String path)
Sets the physical location of the log file
synchronized void setMode(int logMode)
Method used to set the log mode.
void startRequest(String sessionID, RequestKeys keys, long startMillis)
Method used to indicate to the handler that statistics gathering should start at the time specified as the startMillis parameter.
void startRequest(String sessionID, RequestKeys keys)
Method used to indicate to the handler that statistics gathering should start at this point.
[Expand]
Inherited Methods
From class com.microstrategy.utils.log.FileHandler
From class com.microstrategy.utils.log.StreamHandler
From class com.microstrategy.utils.log.Handler
From class java.lang.Object
From interface com.microstrategy.utils.log.Configurable
From interface com.microstrategy.web.app.StatsHandlerSupport

Constants

public static final String APPLICATION_METHOD

Constant Value: "mstrWeb"

public static final String APPLICATION_REQUEST

Constant Value: "com.microstrategy.web.app.ServletEventHandler"

public static final int FORMAT_HTML

Constant Value: 1 (0x00000001)

public static final int FORMAT_TEXT_TAB_DELIMITED

Constant Value: 2 (0x00000002)

public static final String FORWARDED_REQUEST

Constant Value: "ForwardedRequest"

Public Methods

public void clear ()

Clears out collected statistics.

public StatsHandlerSupport.Data endRequest (String sessionID, Writer out)

This is used to mark the end of statistics collection, and print out statistics to the specified writer.

Parameters
sessionID String value with the session ID opened
out Writer instance
Returns
  • statistics

public StatsHandlerSupport.Data endRequest (String sessionID)

This is used to mark the end of statistics collection

Parameters
sessionID String value with the session ID opened

public static StatsHandlerSupport getInstance ()

Returns our singleton StatsHandlerSupport instance.

Returns

public StatsHandlerSupport.Data indicateEndOfApp (String sessionID)

Indicate the end of the Application Level request. This is used to mark the end of statistics collection. Unlike endRequest(String), this method does not write any statistics to any output stream, nor clear the data collected afterwards.

Parameters
sessionID String with the value of the session identifier

public boolean isDisabled ()

Whether Web Statistics are disabled or not.

Returns
  • true if Web Statistics are disabled.

public void publish (LogRecord record)

Publish the log information

Parameters
record LogRecord instance

public void saveStatsToHeaders (int statCode, ContainerServices cntrSvcs)

Save a collection of statistics to HTTP headers.

Parameters
statCode A bitmap of specific statistics that should be saved to HTTP Headers.
cntrSvcs A ContainerServices instance to use for creating HTTP Headers.

public void setLogFileName (String path)

Sets the physical location of the log file

Parameters
path The physical location of the file to which all log messages would be written if the logging mode is set to LOG_MODE_FILE

public synchronized void setMode (int logMode)

Method used to set the log mode.

Parameters
logMode int value to define as mode
See Also

public void startRequest (String sessionID, RequestKeys keys, long startMillis)

Method used to indicate to the handler that statistics gathering should start at the time specified as the startMillis parameter.

Parameters
sessionID String value with the session ID opened
keys the RequestKeys collection from the application
startMillis the time that Web statistics should use as the start time (expressed in milliseconds).

public void startRequest (String sessionID, RequestKeys keys)

Method used to indicate to the handler that statistics gathering should start at this point.

Parameters
sessionID String value with the session ID opened
keys the RequestKeys collection from the application