Class ResourceStatisticsImpl.Builder
java.lang.Object
org.glassfish.jersey.server.internal.monitoring.ResourceStatisticsImpl.Builder
- Enclosing class:
ResourceStatisticsImpl
Builder of resource statistics instances.
Must be thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ResourceStatisticsImplprivate final ResourceMethodStatisticsImpl.Factoryprivate final ConcurrentMap<ResourceMethodStatisticsImpl.Builder, Boolean> private final AtomicReference<ExecutionStatisticsImpl.Builder> private final AtomicReference<ExecutionStatisticsImpl.Builder> -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(ResourceMethodStatisticsImpl.Factory methodFactory) Create a new builder.Builder(Resource resource, ResourceMethodStatisticsImpl.Factory methodFactory) Create a new builder. -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddExecution(ResourceMethod resourceMethod, long methodStartTime, long methodDuration, long requestStartTime, long requestDuration) Add execution of a resource method in the resource.(package private) voidaddMethod(ResourceMethod resourceMethod) Add a resource method to the statistics.(package private) ResourceStatisticsImplbuild()Build a new instance ofResourceStatisticsImpl.getOrCreate(ResourceMethod resourceMethod)
-
Field Details
-
methodsBuilders
-
methodFactory
-
resourceExecutionStatisticsBuilder
-
requestExecutionStatisticsBuilder
-
cached
-
-
Constructor Details
-
Builder
Builder(Resource resource, ResourceMethodStatisticsImpl.Factory methodFactory) Create a new builder.- Parameters:
resource- Resource for which the instance is created.
-
Builder
Builder(ResourceMethodStatisticsImpl.Factory methodFactory) Create a new builder.
-
-
Method Details
-
build
ResourceStatisticsImpl build()Build a new instance ofResourceStatisticsImpl. Note that this build method is called from various different threads.- Returns:
- New instance of resource statistics.
-
addExecution
void addExecution(ResourceMethod resourceMethod, long methodStartTime, long methodDuration, long requestStartTime, long requestDuration) Add execution of a resource method in the resource.- Parameters:
resourceMethod- Resource method executed.methodStartTime- Time of execution of the resource method.methodDuration- Time spent on execution of resource method itself.requestStartTime- Time when the request matching to the executed resource method has been received by Jersey.requestDuration- Time of whole request processing (from receiving the request until writing the response).
-
addMethod
Add a resource method to the statistics.- Parameters:
resourceMethod- Resource method.
-
getOrCreate
-