Package com.microstrategy.web.app
Class StatsHandler
- java.lang.Object
-
- com.microstrategy.utils.log.Handler
-
- com.microstrategy.utils.log.StreamHandler
-
- com.microstrategy.utils.log.FileHandler
-
- com.microstrategy.web.app.StatsHandler
-
- All Implemented Interfaces:
Configurable
,StatsHandlerSupport
public class StatsHandler extends FileHandler implements StatsHandlerSupport
This class implements theStatsHandlerSupport
interface and extends theFileHandler
class.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microstrategy.web.app.StatsHandlerSupport
StatsHandlerSupport.Data
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
APPLICATION_METHOD
static java.lang.String
APPLICATION_REQUEST
static int
FORMAT_HTML
static int
FORMAT_TEXT_TAB_DELIMITED
static java.lang.String
FORWARDED_REQUEST
-
Fields inherited from class com.microstrategy.utils.log.FileHandler
append, baseFileName, fileInitialized, fileRef, logFileName, logNumber, maxFileCount, maxFileSize
-
Fields inherited from interface com.microstrategy.web.app.StatsHandlerSupport
HDR_BYTES_RECV, HDR_BYTES_SENT, HDR_POLLING_XMLAPI_CALLS, HDR_TOTAL_ISERVER, HDR_TOTAL_XMLAPI_CALLS, HDR_TRANS, HDR_WEBAPP, LOG_MODE_ACTIVE, LOG_MODE_FILE, LOG_MODE_OFF, LOG_MODE_PASSIVE, LOG_MODE_SCREEN, LOG_MODE_SNAPSHOT, STAT_BYTES_RECV, STAT_BYTES_SENT, STAT_POLLING_XMLAPI_CALLS, STAT_TOTAL_ISERVER, STAT_TOTAL_XMLAPI_CALLS, STAT_TRANS, STAT_WEBAPP
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears out collected statistics.StatsHandlerSupport.Data
endRequest(java.lang.String sessionID)
This is used to mark the end of statistics collectionStatsHandlerSupport.Data
endRequest(java.lang.String sessionID, java.io.Writer out)
This is used to mark the end of statistics collection, and print out statistics to the specified writer.static StatsHandlerSupport
getInstance()
Returns our singleton StatsHandlerSupport instance.StatsHandlerSupport.Data
indicateEndOfApp(java.lang.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 informationvoid
saveStatsToHeaders(int statCode, ContainerServices cntrSvcs)
Save a collection of statistics to HTTP headers.void
setLogFileName(java.lang.String path)
Sets the physical location of the log filevoid
setMode(int logMode)
Method used to set the log mode.void
startRequest(java.lang.String sessionID, RequestKeys keys)
Method used to indicate to the handler that statistics gathering should start at this point.void
startRequest(java.lang.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.-
Methods inherited from class com.microstrategy.utils.log.FileHandler
configure, createRealFileName, getFinalName, getLogFileName, isFileInitialized, setBaseFileName, setLogFileName, setNewLogFile, setupFile, writeToNextFile
-
Methods inherited from class com.microstrategy.utils.log.StreamHandler
close, finalize, flush, getWriter, setEncoding, setOutputStream
-
Methods inherited from class com.microstrategy.utils.log.Handler
getEncoding, getEncodingSchemeSetting, getException, getFilter, getFilterSetting, getFormatter, getFormatterSetting, getLevel, getLevelSetting, getStringSettingWithDefaultValue, isLoggable, setException, setFilter, setFormatter, setLevel
-
-
-
-
Field Detail
-
APPLICATION_REQUEST
public static final java.lang.String APPLICATION_REQUEST
- See Also:
- Constant Field Values
-
APPLICATION_METHOD
public static final java.lang.String APPLICATION_METHOD
- See Also:
- Constant Field Values
-
FORWARDED_REQUEST
public static final java.lang.String FORWARDED_REQUEST
- See Also:
- Constant Field Values
-
FORMAT_HTML
public static final int FORMAT_HTML
- Since:
- MicroStrategy Web 8.1.1
- See Also:
- Constant Field Values
-
FORMAT_TEXT_TAB_DELIMITED
public static final int FORMAT_TEXT_TAB_DELIMITED
- Since:
- MicroStrategy Web 8.1.1
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static StatsHandlerSupport getInstance()
Returns our singleton StatsHandlerSupport instance.- Returns:
- A singleton instance of a
StatsHandlerSupport
.
-
setMode
public void setMode(int logMode)
Method used to set the log mode.- Specified by:
setMode
in interfaceStatsHandlerSupport
- Parameters:
logMode
-int
value to define as mode- See Also:
StatsHandlerSupport.setMode(int)
-
setLogFileName
public void setLogFileName(java.lang.String path)
Sets the physical location of the log file- Specified by:
setLogFileName
in interfaceStatsHandlerSupport
- Parameters:
path
- The physical location of the file to which all log messages would be written if the logging mode is set toStatsHandlerSupport.LOG_MODE_FILE
- See Also:
StatsHandlerSupport.setLogFileName(String)
-
publish
public void publish(LogRecord record)
Publish the log information- Overrides:
publish
in classFileHandler
- Parameters:
record
-LogRecord
instance- See Also:
Handler.publish(LogRecord)
-
startRequest
public void startRequest(java.lang.String sessionID, RequestKeys keys)
Method used to indicate to the handler that statistics gathering should start at this point.- Specified by:
startRequest
in interfaceStatsHandlerSupport
- Parameters:
sessionID
- String value with the session ID openedkeys
- the RequestKeys collection from the application- See Also:
StatsHandlerSupport.startRequest(String,RequestKeys)
-
startRequest
public void startRequest(java.lang.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.- Specified by:
startRequest
in interfaceStatsHandlerSupport
- Parameters:
sessionID
- String value with the session ID openedkeys
- the RequestKeys collection from the applicationstartMillis
- the time that Web statistics should use as the start time (expressed in milliseconds).- Since:
- MicroStrategy Web 8.1.1
- See Also:
StatsHandlerSupport.startRequest(String,RequestKeys,long)
-
isDisabled
public boolean isDisabled()
Whether Web Statistics are disabled or not.- Specified by:
isDisabled
in interfaceStatsHandlerSupport
- Returns:
- true if Web Statistics are disabled.
- Since:
- MicroStrategy Web 8.1.1
-
indicateEndOfApp
public StatsHandlerSupport.Data indicateEndOfApp(java.lang.String sessionID)
Indicate the end of the Application Level request. This is used to mark the end of statistics collection. UnlikeendRequest(String)
, this method does not write any statistics to any output stream, nor clear the data collected afterwards.- Specified by:
indicateEndOfApp
in interfaceStatsHandlerSupport
- Parameters:
sessionID
- String with the value of the session identifier- Since:
- MicroStrategy Web 8.1.1
-
endRequest
public StatsHandlerSupport.Data endRequest(java.lang.String sessionID)
This is used to mark the end of statistics collection- Specified by:
endRequest
in interfaceStatsHandlerSupport
- Parameters:
sessionID
- String value with the session ID opened- See Also:
StatsHandlerSupport.endRequest(String)
-
saveStatsToHeaders
public void saveStatsToHeaders(int statCode, ContainerServices cntrSvcs)
Save a collection of statistics to HTTP headers.- Specified by:
saveStatsToHeaders
in interfaceStatsHandlerSupport
- Parameters:
statCode
- A bitmap of specific statistics that should be saved to HTTP Headers.cntrSvcs
- AContainerServices
instance to use for creating HTTP Headers.- Since:
- MicroStrategy Web 8.1.1
-
endRequest
public StatsHandlerSupport.Data endRequest(java.lang.String sessionID, java.io.Writer out)
This is used to mark the end of statistics collection, and print out statistics to the specified writer.- Specified by:
endRequest
in interfaceStatsHandlerSupport
- Parameters:
sessionID
- String value with the session ID openedout
-Writer
instance- Returns:
- statistics
- See Also:
StatsHandlerSupport.endRequest(String,Writer)
-
clear
public void clear()
Description copied from interface:StatsHandlerSupport
Clears out collected statistics.- Specified by:
clear
in interfaceStatsHandlerSupport
- Since:
- MicroStrategy Web 9.0.1
-
-