Package org.forgerock.monitoring
Class DropwizardMetricsCollectionResourceProvider
java.lang.Object
org.forgerock.monitoring.DropwizardMetricsCollectionResourceProvider
- All Implemented Interfaces:
CollectionResourceProvider
public class DropwizardMetricsCollectionResourceProvider
extends Object
implements CollectionResourceProvider
A CREST CollectionResourceProvider that adds queryFilter, field filtering, sorting abilities, and paging
to the dropwizard json metrics data. Note that only offset-based paging is supported.
-
Constructor Summary
ConstructorDescriptionDropwizardMetricsCollectionResourceProvider
(Supplier<org.forgerock.monitoring.api.instrument.MeterRegistry> meterRegistrySupplier) Constructs the resource provider for the passed in Dropwizard metric set supplier.DropwizardMetricsCollectionResourceProvider
(org.forgerock.monitoring.api.instrument.MeterRegistry meterRegistry) Constructs the resource provider for the passed in Dropwizard metric set. -
Method Summary
Modifier and TypeMethodDescriptionqueryCollection
(Context context, QueryRequest request, QueryResourceHandler handler) Searches
the collection for all resources which match the query request criteria.readInstance
(Context context, String resourceId, ReadRequest request) Reads
an existing resource within the collection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.forgerock.json.resource.CollectionResourceProvider
actionCollection, actionInstance, createInstance, deleteInstance, patchInstance, updateInstance
-
Constructor Details
-
DropwizardMetricsCollectionResourceProvider
public DropwizardMetricsCollectionResourceProvider(org.forgerock.monitoring.api.instrument.MeterRegistry meterRegistry) Constructs the resource provider for the passed in Dropwizard metric set.- Parameters:
meterRegistry
- The DropwizardMetricSet
from which to provide metrics.
-
DropwizardMetricsCollectionResourceProvider
public DropwizardMetricsCollectionResourceProvider(Supplier<org.forgerock.monitoring.api.instrument.MeterRegistry> meterRegistrySupplier) Constructs the resource provider for the passed in Dropwizard metric set supplier.- Parameters:
meterRegistrySupplier
-Supplier
of the DropwizardMetricSet
from which to provide metrics.
-
-
Method Details
-
queryCollection
public Promise<QueryResponse,ResourceException> queryCollection(Context context, QueryRequest request, QueryResourceHandler handler) Description copied from interface:CollectionResourceProvider
Searches
the collection for all resources which match the query request criteria.Implementations must invoke
QueryResourceHandler.handleResource(ResourceResponse)
for each resource which matches the query criteria. Once all matching resources have been returned implementations are required to return either aQueryResponse
if the query has completed successfully, orResourceException
if the query did not complete successfully (even if some matching resources were returned).- Specified by:
queryCollection
in interfaceCollectionResourceProvider
- Parameters:
context
- The request server context.request
- The query request.handler
- The query resource handler to be notified for each matching resource.- Returns:
- A
Promise
containing the result of the operation. - See Also:
-
readInstance
public Promise<ResourceResponse,ResourceException> readInstance(Context context, String resourceId, ReadRequest request) Description copied from interface:CollectionResourceProvider
Reads
an existing resource within the collection.- Specified by:
readInstance
in interfaceCollectionResourceProvider
- Parameters:
context
- The request server context.resourceId
- The ID of the targeted resource within the collection.request
- The read request.- Returns:
- A
Promise
containing the result of the operation. - See Also:
-