Class ClientLog


  • public class ClientLog
    extends java.lang.Object
    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.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MONITOR_LEVEL_ACTION
      Indicates the level of monitoring will include only those that come from an action.
      static int MONITOR_LEVEL_ALL
      Indicates the level of monitoring will include pages and other components (beans/transforms) that have the monitoring mechanism included
      static int MONITOR_LEVEL_DETAILED
      Indicates the level of monitoring will include only those that come from inner components.
      static int MONITOR_LEVEL_METHOD
      Indicates the level of monitoring will include only those that come from a method.
      static int MONITOR_LEVEL_PAGE
      Indicates the level of monitoring will include only those that come from pages.
      static int MONITOR_TYPE_LIVE
      Indicates the Monitoring Type of connection is live - pages will be accessed directly from the web server
      static 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
      static 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.
      static 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.
      static 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.
      static 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.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientLog()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static AppContext getAppContext()
      Getter for the AppContext object
      static java.lang.String getLoggingForm()
      Gets the logging page where the form to be submitted with the client performance information is located
      static java.lang.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 java.lang.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​(java.lang.String componentId, MarkupOutput out)
      Ends the timer for the component specified and save the performance information for latter display.
      static void logEndTime​(java.lang.String componentId, MarkupOutput out, int levelFlag)
      Ends the timer for the component specified and save the performance information for latter display.
      static void logStartTime​(java.lang.String componentId, MarkupOutput out)
      Starts the timer for the component specified.
      static void logStartTime​(java.lang.String componentId, MarkupOutput out, int levelFlag)
      Starts the timer for the component specified
      static void processPerformance​(java.util.ArrayList newNames, java.util.ArrayList newTimes, java.lang.String sURL, java.lang.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​(java.lang.String webForm)
      Sets the logging page where the form to be submitted with the client performance information is located
      static void setLoggingPage​(java.lang.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​(java.lang.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VIEW_MODE_LOG_FILE

        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.
        See Also:
        Constant Field Values
      • VIEW_MODE_HTML_REPORT

        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.
        See Also:
        Constant Field Values
      • VIEW_MODE_BROWSER_ALERT

        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.
        See Also:
        Constant Field Values
      • VIEW_MODE_BROWSER_INLINE

        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.
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • MONITOR_LEVEL_PAGE

        public static final int MONITOR_LEVEL_PAGE
        Indicates the level of monitoring will include only those that come from pages.
        See Also:
        Constant Field Values
      • MONITOR_LEVEL_DETAILED

        public static final int MONITOR_LEVEL_DETAILED
        Indicates the level of monitoring will include only those that come from inner components.
        See Also:
        Constant Field Values
      • MONITOR_LEVEL_ALL

        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
        See Also:
        Constant Field Values
      • MONITOR_LEVEL_METHOD

        public static final int MONITOR_LEVEL_METHOD
        Indicates the level of monitoring will include only those that come from a method.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • MONITOR_LEVEL_ACTION

        public static final int MONITOR_LEVEL_ACTION
        Indicates the level of monitoring will include only those that come from an action.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • MONITOR_TYPE_LIVE

        public static final int MONITOR_TYPE_LIVE
        Indicates the Monitoring Type of connection is live - pages will be accessed directly from the web server
        See Also:
        Constant Field Values
      • MONITOR_TYPE_STATIC

        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
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClientLog

        public ClientLog()
    • Method Detail

      • logStartTime

        public static void logStartTime​(java.lang.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.
      • logStartTime

        public static void logStartTime​(java.lang.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.
      • logEndTime

        public static void logEndTime​(java.lang.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.
      • logEndTime

        public static void logEndTime​(java.lang.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.
      • processPerformance

        public static void processPerformance​(java.util.ArrayList newNames,
                                              java.util.ArrayList newTimes,
                                              java.lang.String sURL,
                                              java.lang.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
      • initializePerformance

        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.
      • initializePerformanceClientActions

        public static void initializePerformanceClientActions​(MarkupOutput out)
        Adds script to the HTML page for the method and action level.
        Since:
        MicroStrategy Web 8.0.0
      • setViewMode

        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
      • setMonitorType

        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.
      • setMonitorLevel

        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.
      • setMonitorLogFile

        public static void setMonitorLogFile​(java.lang.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.
      • setLoggingForm

        public static void setLoggingForm​(java.lang.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
      • getLoggingForm

        public static java.lang.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
      • setLoggingPage

        public static void setLoggingPage​(java.lang.String webPage)
        Sets the logging page that will be accessed for obtaining the statistics information
        Parameters:
        webPage - the url of the page to access
      • getTraceIsOn

        public static boolean getTraceIsOn()
        Determines if tracing is on or not.
        Returns:
        true if tracing is enabled, otherwise returns false
      • getViewMode

        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.
      • getMonitorType

        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.
      • getMonitorLevel

        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.
      • getMonitorLogFile

        public static java.lang.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.
      • getLoggingPage

        public static java.lang.String getLoggingPage()
        Gets the logging page that will be accessed for obtaining the statistics information
        Returns:
        a String with the url to access
      • getAppContext

        public static AppContext getAppContext()
        Getter for the AppContext object
        Since:
        MicroStrategy Web 8.0.0
      • setAppContext

        public static void setAppContext​(AppContext appContext)
        Setter for the AppContext object
        Since:
        MicroStrategy Web 8.0.0