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 theStatsHandlerSupportinterface and extends theFileHandlerclass.- 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.StringAPPLICATION_METHODstatic java.lang.StringAPPLICATION_REQUESTstatic intFORMAT_HTMLstatic intFORMAT_TEXT_TAB_DELIMITEDstatic java.lang.StringFORWARDED_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 voidclear()Clears out collected statistics.StatsHandlerSupport.DataendRequest(java.lang.String sessionID)This is used to mark the end of statistics collectionStatsHandlerSupport.DataendRequest(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 StatsHandlerSupportgetInstance()Returns our singleton StatsHandlerSupport instance.StatsHandlerSupport.DataindicateEndOfApp(java.lang.String sessionID)Indicate the end of the Application Level request.booleanisDisabled()Whether Web Statistics are disabled or not.voidpublish(LogRecord record)Publish the log informationvoidsaveStatsToHeaders(int statCode, ContainerServices cntrSvcs)Save a collection of statistics to HTTP headers.voidsetLogFileName(java.lang.String path)Sets the physical location of the log filevoidsetMode(int logMode)Method used to set the log mode.voidstartRequest(java.lang.String sessionID, RequestKeys keys)Method used to indicate to the handler that statistics gathering should start at this point.voidstartRequest(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:
setModein interfaceStatsHandlerSupport- Parameters:
logMode-intvalue 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:
setLogFileNamein 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:
publishin classFileHandler- Parameters:
record-LogRecordinstance- 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:
startRequestin 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:
startRequestin 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:
isDisabledin 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:
indicateEndOfAppin 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:
endRequestin 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:
saveStatsToHeadersin interfaceStatsHandlerSupport- Parameters:
statCode- A bitmap of specific statistics that should be saved to HTTP Headers.cntrSvcs- AContainerServicesinstance 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:
endRequestin interfaceStatsHandlerSupport- Parameters:
sessionID- String value with the session ID openedout-Writerinstance- Returns:
- statistics
- See Also:
StatsHandlerSupport.endRequest(String,Writer)
-
clear
public void clear()
Description copied from interface:StatsHandlerSupportClears out collected statistics.- Specified by:
clearin interfaceStatsHandlerSupport- Since:
- MicroStrategy Web 9.0.1
-
-