Search in sources :

Example 1 with InfinispanQueryStatisticsInfo

use of org.infinispan.query.impl.InfinispanQueryStatisticsInfo in project infinispan by infinispan.

the class SearchAdminResource method indexStats.

private CompletionStage<RestResponse> indexStats(RestRequest request) {
    NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder();
    InfinispanQueryStatisticsInfo searchStats = lookupQueryStatistics(request, responseBuilder);
    if (searchStats == null)
        return completedFuture(responseBuilder.build());
    return searchStats.computeLegacyIndexStatistics().thenApply(json -> asJsonResponse(json, responseBuilder));
}
Also used : InfinispanQueryStatisticsInfo(org.infinispan.query.impl.InfinispanQueryStatisticsInfo) NettyRestResponse(org.infinispan.rest.NettyRestResponse)

Example 2 with InfinispanQueryStatisticsInfo

use of org.infinispan.query.impl.InfinispanQueryStatisticsInfo in project infinispan by infinispan.

the class SearchAdminResource method queryStats.

private CompletionStage<RestResponse> queryStats(RestRequest request) {
    NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder();
    InfinispanQueryStatisticsInfo searchStats = lookupQueryStatistics(request, responseBuilder);
    if (searchStats == null)
        return completedFuture(responseBuilder.build());
    return asJsonResponseFuture(searchStats.getLegacyQueryStatistics(), responseBuilder);
}
Also used : InfinispanQueryStatisticsInfo(org.infinispan.query.impl.InfinispanQueryStatisticsInfo) NettyRestResponse(org.infinispan.rest.NettyRestResponse)

Example 3 with InfinispanQueryStatisticsInfo

use of org.infinispan.query.impl.InfinispanQueryStatisticsInfo in project infinispan by infinispan.

the class SearchAdminResource method clearStats.

private CompletionStage<RestResponse> clearStats(RestRequest request) {
    NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder();
    InfinispanQueryStatisticsInfo queryStatistics = lookupQueryStatistics(request, responseBuilder);
    if (queryStatistics == null)
        return completedFuture(responseBuilder.build());
    responseBuilder.status(NO_CONTENT);
    queryStatistics.clear();
    return completedFuture(responseBuilder.build());
}
Also used : InfinispanQueryStatisticsInfo(org.infinispan.query.impl.InfinispanQueryStatisticsInfo) NettyRestResponse(org.infinispan.rest.NettyRestResponse)

Aggregations

InfinispanQueryStatisticsInfo (org.infinispan.query.impl.InfinispanQueryStatisticsInfo)3 NettyRestResponse (org.infinispan.rest.NettyRestResponse)3