Skip to content

Commit

Permalink
Removing client-side references to tracing. For now
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Nov 12, 2018
1 parent 48c3eb6 commit dce76b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.tracing.DistributedTracer;
import org.openqa.selenium.remote.tracing.HttpTracing;
import org.openqa.selenium.remote.tracing.Span;

import java.io.IOException;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -130,8 +127,6 @@ public Response execute(Command command) throws IOException {
}
}

DistributedTracer tracer = DistributedTracer.getInstance();

if (NEW_SESSION.equals(command.getName())) {
if (commandCodec != null) {
throw new SessionNotCreatedException("Session already exists");
Expand All @@ -155,9 +150,8 @@ public Response execute(Command command) throws IOException {
}

HttpRequest httpRequest = commandCodec.encode(command);
try (Span span = tracer.createSpan(command.getName(), tracer.getActiveSpan())) {
try {
log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), true));
span.addTag("selenium-sessionid", String.valueOf(command.getSessionId()));
HttpResponse httpResponse = client.execute(httpRequest);
log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), false));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
import org.openqa.selenium.remote.http.HttpMethod;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.tracing.DistributedTracer;
import org.openqa.selenium.remote.tracing.Span;

import java.io.BufferedInputStream;
import java.io.IOException;
Expand Down Expand Up @@ -99,14 +97,12 @@ private Optional<Result> createSession(HttpClient client, InputStream newSession

HttpResponse response;
long start = System.currentTimeMillis();
DistributedTracer tracer = DistributedTracer.getInstance();
try (Span span = tracer.createSpan("NEW_SESSION", tracer.getActiveSpan())) {
request.setHeader(CONTENT_LENGTH, String.valueOf(size));
request.setHeader(CONTENT_TYPE, JSON_UTF_8.toString());
request.setContent(newSessionBlob);

response = client.execute(request);
}
request.setHeader(CONTENT_LENGTH, String.valueOf(size));
request.setHeader(CONTENT_TYPE, JSON_UTF_8.toString());
request.setContent(newSessionBlob);

response = client.execute(request);
long time = System.currentTimeMillis() - start;

// Ignore the content type. It may not have been set. Strictly speaking we're not following the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.tracing.HttpTracing;

import okhttp3.ConnectionPool;
import okhttp3.Credentials;
Expand Down Expand Up @@ -156,7 +155,7 @@ public HttpClient createClient(URL url) {
: response;
});

return HttpTracing.decorate(new OkHttpClient(client.build(), url));
return new OkHttpClient(client.build(), url);
}
};
}
Expand Down

0 comments on commit dce76b5

Please sign in to comment.