Class ResourceMethodStatisticsImpl.Builder

  • Enclosing class:
    ResourceMethodStatisticsImpl

    static class ResourceMethodStatisticsImpl.Builder
    extends java.lang.Object
    Builder of resource method statistics.

    Must be thread-safe.

    • Constructor Detail

      • Builder

        Builder​(ResourceMethod resourceMethod)
        Create a new builder instance.
        Parameters:
        resourceMethod - Resource method for which statistics are evaluated.
    • Method Detail

      • build

        ResourceMethodStatisticsImpl build()
        Build an instance of resource method statistics.
        Returns:
        New instance of resource method statistics.
      • addResourceMethodExecution

        void addResourceMethodExecution​(long methodStartTime,
                                        long methodDuration,
                                        long requestStartTime,
                                        long requestDuration)
        Add execution of the resource method to the statistics.
        Parameters:
        methodStartTime - Time spent on execution of resource method itself (Unix timestamp format).
        methodDuration - Time of execution of the resource method.
        requestStartTime - Time of whole request processing (from receiving the request until writing the response). (Unix timestamp format)
        requestDuration - Time when the request matching to the executed resource method has been received by Jersey.