@@ -313,7 +313,8 @@ public Uni<Response> enqueue()
313313
314314 Call call = callClient .newCall ( requestBuilder .build () );
315315
316- final String timestamp = System .currentTimeMillis () + "." + System .nanoTime (); // to identify the beginning/ending log message
316+ final long nano = System .nanoTime ();
317+ final String timestamp = System .currentTimeMillis () + "." + nano ; // to identify the beginning/ending log message
317318 final HttpUrl url = call .request ().url ();
318319 final String method = call .request ().method ();
319320 logger .info ( "Starting upstream request: [{}] {} ({})" , method , url , timestamp );
@@ -336,7 +337,8 @@ public void onFailure( @NotNull Call call, @NotNull IOException e )
336337 scope .close ();
337338 span .end ();
338339
339- logger .warn ( String .format ("Failed: [%s] %s (%s)" , method , url , timestamp ), e );
340+ logger .warn ( String .format ("Failed: [%s] %s (%s), latency: %s" , method , url , timestamp ,
341+ System .nanoTime () - nano ), e );
340342 p .fail ( e );
341343 }
342344
@@ -352,7 +354,8 @@ public void onResponse( @NotNull Call call, @NotNull Response response )
352354 scope .close ();
353355 span .end ();
354356
355- logger .info ( "Success: [{}] {} -> {} ({})" , method , url , response .code (), timestamp );
357+ logger .info ( "Success: [{}] {} -> {} ({}), latency: {}" , method , url , response .code (), timestamp ,
358+ System .nanoTime () - nano );
356359 p .complete ( response );
357360 }
358361 } );
0 commit comments