Java Code Examples for com.twitter.ostrich.stats.Stats#timeFutureMillis()
The following examples show how to use
com.twitter.ostrich.stats.Stats#timeFutureMillis() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 6 votes |
@Override public Future<PinLaterDequeueResponse> dequeueJobs( RequestContext context, final PinLaterDequeueRequest request) { if (!queueConfig.allowDequeue(request.getQueueName(), request.getLimit())) { Stats.incr(request.getQueueName() + "_dequeue_requests_rate_limited"); return Future.exception(new PinLaterException(ErrorCode.DEQUEUE_RATE_LIMITED, "Dequeue rate limit exceeded for queue: " + request.getQueueName())); } return Stats.timeFutureMillis( "PinLaterService.dequeueJobs", backend.dequeueJobs(context.getSource(), request).onSuccess( new Function<PinLaterDequeueResponse, BoxedUnit>() { @Override public BoxedUnit apply(PinLaterDequeueResponse response) { Stats.incr(request.getQueueName() + "_dequeue", response.getJobsSize()); return null; } }).rescue(new LogAndWrapException<PinLaterDequeueResponse>( context, "dequeueJobs", request.toString()))); }
Example 2
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 6 votes |
@Override public Future<Void> ackDequeuedJobs(RequestContext context, final PinLaterJobAckRequest request) { return Stats.timeFutureMillis( "PinLaterService.ackDequeuedJobs", backend.ackDequeuedJobs(request).onSuccess( new Function<Void, BoxedUnit>() { @Override public BoxedUnit apply(Void aVoid) { Stats.incr(request.getQueueName() + "_ack_succeeded", request.getJobsSucceededSize()); Stats.incr(request.getQueueName() + "_ack_failed", request.getJobsFailedSize()); return null; } }).rescue(new LogAndWrapException<Void>(context, "ackDequeuedJobs", request.toString()))); }
Example 3
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Void> createQueue(RequestContext context, final String name) { if (!validateQueueName(name)) { return Future.exception(new PinLaterException( ErrorCode.QUEUE_NAME_INVALID, "Invalid queue name: " + name)); } return Stats.timeFutureMillis( "PinLaterService.createQueue", backend.createQueue(name).rescue(new LogAndWrapException<Void>( context, "createQueue", name))); }
Example 4
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Void> deleteQueue( RequestContext context, final String name, final String password) { return Stats.timeFutureMillis( "PinLaterService.deleteQueue", backend.deleteQueue(name, password).rescue(new LogAndWrapException<Void>( context, "deleteQueue", name))); }
Example 5
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<PinLaterEnqueueResponse> enqueueJobs( RequestContext context, final PinLaterEnqueueRequest request) { return Stats.timeFutureMillis( "PinLaterService.enqueueJobs", backend.enqueueJobs(request).onSuccess( new Function<PinLaterEnqueueResponse, BoxedUnit>() { @Override public BoxedUnit apply(PinLaterEnqueueResponse response) { Stats.incr(request.getQueueName() + "_enqueue", request.getJobsSize()); return null; } }).rescue(new LogAndWrapException<PinLaterEnqueueResponse>( context, "enqueueJobs", request.toString()))); }
Example 6
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Void> checkpointJobs(RequestContext context, final PinLaterCheckpointJobsRequest request) { return Stats.timeFutureMillis( "PinLaterService.checkpointJobs", backend.checkpointJobs(context.getSource(), request).onSuccess( new Function<Void, BoxedUnit>() { @Override public BoxedUnit apply(Void aVoid) { Stats.incr(request.getQueueName() + "_checkpoint", request.getRequestsSize()); return null; } }).rescue(new LogAndWrapException<Void>( context, "checkpointJobs", request.toString()))); }
Example 7
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Map<String, PinLaterJobInfo>> lookupJobs(RequestContext context, PinLaterLookupJobRequest request) { return Stats.timeFutureMillis( "PinLaterService.lookupJobs", backend.lookupJobs(request).rescue( new LogAndWrapException<Map<String, PinLaterJobInfo>>( context, "lookupJobs", request.toString()))); }
Example 8
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Integer> getJobCount(RequestContext context, PinLaterGetJobCountRequest request) { return Stats.timeFutureMillis( "PinLaterService.getJobCount", backend.getJobCount(request).rescue( new LogAndWrapException<Integer>(context, "getJobCount", request.toString()))); }
Example 9
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Set<String>> getQueueNames(RequestContext context) { return Stats.timeFutureMillis( "PinLaterService.getQueueNames", backend.getQueueNames().rescue( new LogAndWrapException<Set<String>>(context, "getQueueNames", ""))); }
Example 10
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<PinLaterScanJobsResponse> scanJobs(RequestContext context, PinLaterScanJobsRequest request) { return Stats.timeFutureMillis( "PinLaterService.scanJobs", backend.scanJobs(request).rescue( new LogAndWrapException<PinLaterScanJobsResponse>( context, "scanJobs", request.toString()))); }
Example 11
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Integer> retryFailedJobs(RequestContext context, PinLaterRetryFailedJobsRequest request) { return Stats.timeFutureMillis( "PinLaterService.retryFailedJobs", backend.retryFailedJobs(request).rescue( new LogAndWrapException<Integer>( context, "retryFailedJobs", request.toString()))); }
Example 12
Source File: PinLaterServiceImpl.java From pinlater with Apache License 2.0 | 5 votes |
@Override public Future<Integer> deleteJobs(RequestContext context, PinLaterDeleteJobsRequest request) { return Stats.timeFutureMillis( "PinLaterService.deleteJobs", backend.deleteJobs(request).rescue( new LogAndWrapException<Integer>( context, "deleteJobs", request.toString()))); }