retrofit
Interface Profiler<T>


public interface Profiler<T>

A hook allowing clients to log HTTP method times and response status codes.

Author:
Eric Burke ([email protected])

Nested Class Summary
static class Profiler.RequestInformation
          Information about the HTTP request.
 
Method Summary
 void afterCall(Profiler.RequestInformation requestInfo, long elapsedTime, int statusCode, T beforeCallData)
          Invoked after an HTTP method completes.
 T beforeCall()
          Invoked before an HTTP method call.
 

Method Detail

beforeCall

T beforeCall()
Invoked before an HTTP method call. The object returned by this method will be passed to afterCall(retrofit.Profiler.RequestInformation, long, int, T) when the call returns.

This method gives implementers the opportunity to include information that may change during the server call in afterCall logic.


afterCall

void afterCall(Profiler.RequestInformation requestInfo,
               long elapsedTime,
               int statusCode,
               T beforeCallData)
Invoked after an HTTP method completes. This is called from the RestAdapter's background thread.

Parameters:
requestInfo - information about the originating HTTP request.
elapsedTime - time in milliseconds it took the HTTP request to complete.
statusCode - response status code.
beforeCallData - the data returned by the corresponding beforeCall().


Copyright © 2013 Square, Inc.. All Rights Reserved.