Skip to content

Instantly share code, notes, and snippets.

@esoxjem
Created October 20, 2016 21:26
Show Gist options
  • Save esoxjem/c0797fe65e37adbcdce471a65d0b6814 to your computer and use it in GitHub Desktop.
Save esoxjem/c0797fe65e37adbcdce471a65d0b6814 to your computer and use it in GitHub Desktop.
public class SamplingInterceptor implements Interceptor
{
@Override
public Response intercept(Chain chain) throws IOException
{
Request request = chain.request();
DeviceBandwidthSampler.getInstance().startSampling();
Response response = chain.proceed(request);
DeviceBandwidthSampler.getInstance().stopSampling();
return response;
}
}
@esoxjem
Copy link
Author

esoxjem commented Mar 6, 2018

Oh hey @NightlyNexus. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment