org.drjekyll.sentry.apachehttpclient4.RequestHash Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sentry-http-interceptors Show documentation
Show all versions of sentry-http-interceptors Show documentation
Sends tracing information about Apache HttpClient 4 calls to Sentry
package org.drjekyll.sentry.apachehttpclient4;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.util.Args;
final class RequestHash {
static final String SPAN_DATA_KEY = "request.hash";
private RequestHash() {
// utility
}
static int create(HttpUriRequest httpUriRequest) {
Args.notNull(httpUriRequest, "HTTP request");
int uriHash = httpUriRequest.getURI() != null ? httpUriRequest.getURI().hashCode() : 0;
return 31 * uriHash + (httpUriRequest.getMethod() != null ? httpUriRequest.getMethod().hashCode() : 0);
}
}