Package com.flurry.android
Class FlurryPerformance.HttpLogger
java.lang.Object
com.flurry.android.FlurryPerformance.HttpLogger
- Enclosing class:
- FlurryPerformance
Provide a HttpLogger class that users can create before connection, then log event after.
Flurry will compute the time.
Example#1: (inside user’s own interceptor when merging is not easy)
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new HttpInterceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
FlurryPerformance.HttpLogger logger = new FlurryPerformance.HttpLogger();
Response response = chain.proceed(request);
logger.logEvent(MyGroupID, request, response);
return response;
}
})
.build();
Example#2: (provide your own data, or for any connection call like HttpURLConnection)
URL url = new URL("https://www.example.com/");
FlurryPerformance.HttpLogger logger = new FlurryPerformance.HttpLogger();
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
...
logger.logEvent(MyGroupID, connection.getURL().toString(), connection.getResponseCode(),
connection.getURL().toString());
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Log Flurry HTTP/S Network Requests events with users provided data.void
Log Flurry HTTP/S Network Requests events with okhttp3.Request and okhttp3.Response.
-
Constructor Details
-
HttpLogger
public HttpLogger()
-
-
Method Details
-
logEvent
Log Flurry HTTP/S Network Requests events with okhttp3.Request and okhttp3.Response.- Parameters:
id
- The group IDrequest
- okhttp3.request instanceresponse
- okhttp3.Response instance
-
logEvent
Log Flurry HTTP/S Network Requests events with users provided data.- Parameters:
id
- The group IDrequestUrl
- Request URLresponseCode
- Response coderesponseUrl
- Response URL
-