Interface IProfiler


public interface IProfiler
Interface which can be implemented to roll your own profiler for client requests. See "Profiling Module" in the AppStore for more information.
  • Field Details

    • PROFILER_KEY

      static final String PROFILER_KEY
      The name of the HTTP header for the profiler request token.
      See Also:
  • Method Details

    • enterRuntime

      default Object enterRuntime(String sessionId, String requestId, String userName, Set<String> userRoles, String jsonRequest, Long now)
      Method that is called upon handling a new request in the runtime.
      Parameters:
      sessionId - the session identifier of the request
      requestId - the identifier of the request
      userName - the name of the user that made the request
      userRoles - the security roles of the user that made the request
      jsonRequest - the JSON content of the request as a String
      now - the timestamp of the request (in milliseconds since the Unix epoch)
      Returns:
      some object that will be passed to the corresponding finishRuntime(Object, Long)
    • finishRuntime

      default void finishRuntime(Object logObject, Long now)
      Method that is called upon finishing a request in the runtime.
      Parameters:
      logObject - the object that was returned by the corresponding enterRuntime(String, String, String, Set, String, Long)
      now - the timestamp of the end of the request (in milliseconds since the Unix epoch)
    • enterDatabase

      default Object enterDatabase(String sessionId, String requestId, String requestData, Long now)
      Method that is called upon issuing a new query to the database.
      Parameters:
      sessionId - the session identifier of the session for which the query is made
      requestId - the identifier of the request for which the query is made
      requestData - the SQL statement that is sent to the database
      now - the timestamp of the request (in milliseconds since the Unix epoch)
      Returns:
      some object that will be passed to the corresponding finishDatabase(Object, Long)
    • finishDatabase

      default void finishDatabase(Object logObject, Long now)
      Method that is called upon finishing a query on the database.
      Parameters:
      logObject - the object that was returned by the corresponding enterDatabase(String, String, String, Long)
      now - the timestamp of the query result (in milliseconds since the Unix epoch)
    • logClientData

      default void logClientData(String jsonObject, String sessionId)
      Method that is called right after enterRuntime(String, String, String, Set, String, Long), containing the same information.
      Parameters:
      jsonObject - the JSON content of the request as a String
      sessionId - the session identifier of the request
    • stop

      default void stop()
      Stops the profiler.