public interface RequestContext
Modifier and Type | Method and Description |
---|---|
default long |
arrivalTimeNanos()
Get the arrival time of the incoming request in nanoseconds.
|
Map<String,String> |
pathArgs()
Gets a map of parsed path arguments.
|
Request |
request()
Get the incoming request message.
|
Client |
requestScopedClient()
Get an Apollo client that can be used to make backend service requests.
|
Request request()
Client requestScopedClient()
Environment.client()
.Client
.Map<String,String> pathArgs()
default long arrivalTimeNanos()
System.nanoTime()
. To get unix epoch
time, do something like:
long processingTimeNanos = System.nanoTime() - requestContext.arrivalTimeNanos();
long arrivalTimeUnixEpochMillis = System.currentTimeMillis() +
TimeUnit.NANOSECONDS.toMillis(processingTimeNanos);
System.nanoTime()
Copyright © 2016. All rights reserved.