Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Jul 20, 2022
1 parent acdc2b3 commit e947e39
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
Expand Up @@ -119,7 +119,8 @@ protected void startWrite(HttpRequest msg, Channel channel, @Nullable ContextVie
responseTimeObservation.start();
}

static final class ResponseTimeHandlerContext extends RequestReplySenderContext<HttpRequest, HttpResponse> implements ReactorNettyHandlerContext {
static final class ResponseTimeHandlerContext extends RequestReplySenderContext<HttpRequest, HttpResponse>
implements ReactorNettyHandlerContext {
static final String TYPE = "client";

final String method;
Expand Down
Expand Up @@ -33,7 +33,8 @@
* @author Violeta Georgieva
* @since 1.1.0
*/
public final class ReactorNettyPropagatingReceiverTracingObservationHandler extends PropagatingReceiverTracingObservationHandler<ReceiverContext<HttpRequest>> {
public final class ReactorNettyPropagatingReceiverTracingObservationHandler
extends PropagatingReceiverTracingObservationHandler<ReceiverContext<HttpRequest>> {

/**
* Creates a new instance of {@link ReactorNettyPropagatingReceiverTracingObservationHandler}.
Expand Down
Expand Up @@ -35,7 +35,8 @@
* @author Violeta Georgieva
* @since 1.1.0
*/
public final class ReactorNettyPropagatingSenderTracingObservationHandler extends PropagatingSenderTracingObservationHandler<SenderContext<HttpRequest>> {
public final class ReactorNettyPropagatingSenderTracingObservationHandler
extends PropagatingSenderTracingObservationHandler<SenderContext<HttpRequest>> {

/**
* Creates a new instance of {@link ReactorNettyPropagatingSenderTracingObservationHandler}.
Expand Down
Expand Up @@ -93,10 +93,7 @@ protected void recordWrite(HttpServerOperations ops, String path, String method,
protected void startRead(HttpServerOperations ops, String path, String method) {
super.startRead(ops, path, method);

responseTimeHandlerContext = new ResponseTimeHandlerContext(
recorder,
path,
ops.nettyRequest);
responseTimeHandlerContext = new ResponseTimeHandlerContext(recorder, path, ops.nettyRequest);
responseTimeObservation = Observation.start(this.responseTimeName, responseTimeHandlerContext, OBSERVATION_REGISTRY);
}

Expand All @@ -106,17 +103,15 @@ protected void startWrite(HttpServerOperations ops, String path, String method,
super.startWrite(ops, path, method, status);

if (responseTimeObservation == null) {
responseTimeHandlerContext = new ResponseTimeHandlerContext(
recorder,
path,
ops.nettyRequest);
responseTimeHandlerContext = new ResponseTimeHandlerContext(recorder, path, ops.nettyRequest);
responseTimeObservation = Observation.start(this.responseTimeName, responseTimeHandlerContext, OBSERVATION_REGISTRY);
}
responseTimeHandlerContext.setResponse(ops.nettyResponse); // TODO: Is this OK?
responseTimeHandlerContext.status = status;
}

static final class ResponseTimeHandlerContext extends RequestReplyReceiverContext<HttpRequest, HttpResponse> implements ReactorNettyHandlerContext {
static final class ResponseTimeHandlerContext extends RequestReplyReceiverContext<HttpRequest, HttpResponse>
implements ReactorNettyHandlerContext {
static final String TYPE = "server";

final String method;
Expand Down

0 comments on commit e947e39

Please sign in to comment.