From dce76b5aa86184f4f0a629139b6406a9752cce74 Mon Sep 17 00:00:00 2001 From: Simon Stewart Date: Mon, 12 Nov 2018 14:10:12 +0000 Subject: [PATCH] Removing client-side references to tracing. For now --- .../selenium/remote/HttpCommandExecutor.java | 8 +------- .../openqa/selenium/remote/ProtocolHandshake.java | 14 +++++--------- .../selenium/remote/internal/OkHttpClient.java | 3 +-- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java index 8d372992cff08..4dad8b17fe593 100644 --- a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java +++ b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java @@ -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; @@ -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"); @@ -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)); diff --git a/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java b/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java index cee90c882c2f7..e5e2c84039dfe 100644 --- a/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java +++ b/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java @@ -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; @@ -99,14 +97,12 @@ private Optional 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 diff --git a/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java b/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java index 667875fb9f155..8f2ea9bf25128 100644 --- a/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java +++ b/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java @@ -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; @@ -156,7 +155,7 @@ public HttpClient createClient(URL url) { : response; }); - return HttpTracing.decorate(new OkHttpClient(client.build(), url)); + return new OkHttpClient(client.build(), url); } }; }