diff options
| author | Bogdan Drutu <bdrutu@google.com> | 2017-06-06 13:56:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-06 13:56:55 -0700 |
| commit | 80ec0c120bb133b3d3747406be7e4c543b9e0446 (patch) | |
| tree | 94d30b9612fd44408026455597ac7c76492536b2 /examples | |
| parent | 84d0f46e88faa89c0d822a73a7a610b9ac1bc471 (diff) | |
| download | platform_external_opencensus-java-80ec0c120bb133b3d3747406be7e4c543b9e0446.tar.gz platform_external_opencensus-java-80ec0c120bb133b3d3747406be7e4c543b9e0446.tar.bz2 platform_external_opencensus-java-80ec0c120bb133b3d3747406be7e4c543b9e0446.zip | |
Move internal & common & trace to the new package io.opencensus (#339)
Diffstat (limited to 'examples')
8 files changed, 22 insertions, 139 deletions
diff --git a/examples/build.gradle b/examples/build.gradle index 711f3bd8..aac3619e 100644 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -24,21 +24,21 @@ task statsRunner(type: CreateStartScripts) { } task multiSpansTracing(type: CreateStartScripts) { - mainClassName = 'com.google.instrumentation.examples.trace.MultiSpansTracing' + mainClassName = 'io.opencensus.examples.trace.MultiSpansTracing' applicationName = 'MultiSpansTracing' outputDir = new File(project.buildDir, 'tmp') classpath = jar.outputs.files + project.configurations.runtime } task multiSpansScopedTracing(type: CreateStartScripts) { - mainClassName = 'com.google.instrumentation.examples.trace.MultiSpansScopedTracing' + mainClassName = 'io.opencensus.examples.trace.MultiSpansScopedTracing' applicationName = 'MultiSpansScopedTracing' outputDir = new File(project.buildDir, 'tmp') classpath = jar.outputs.files + project.configurations.runtime } task multiSpansContextTracing(type: CreateStartScripts) { - mainClassName = 'com.google.instrumentation.examples.trace.MultiSpansContextTracing' + mainClassName = 'io.opencensus.examples.trace.MultiSpansContextTracing' applicationName = 'MultiSpansContextTracing' outputDir = new File(project.buildDir, 'tmp') classpath = jar.outputs.files + project.configurations.runtime diff --git a/examples/src/main/java/com/google/instrumentation/examples/stats/StatsRunner.java b/examples/src/main/java/com/google/instrumentation/examples/stats/StatsRunner.java index a7e901df..831ce591 100644 --- a/examples/src/main/java/com/google/instrumentation/examples/stats/StatsRunner.java +++ b/examples/src/main/java/com/google/instrumentation/examples/stats/StatsRunner.java @@ -13,7 +13,6 @@ package com.google.instrumentation.examples.stats; -import com.google.instrumentation.common.NonThrowingCloseable; import com.google.instrumentation.stats.MeasurementDescriptor; import com.google.instrumentation.stats.MeasurementDescriptor.BasicUnit; import com.google.instrumentation.stats.MeasurementDescriptor.MeasurementUnit; @@ -23,6 +22,8 @@ import com.google.instrumentation.stats.StatsContext; import com.google.instrumentation.stats.StatsContextFactory; import com.google.instrumentation.stats.TagKey; import com.google.instrumentation.stats.TagValue; +import io.opencensus.common.NonThrowingCloseable; + import java.util.Arrays; /** Simple program that uses Stats contexts. */ diff --git a/examples/src/main/java/com/google/instrumentation/examples/trace/BasicContextTracing.java b/examples/src/main/java/com/google/instrumentation/examples/trace/BasicContextTracing.java deleted file mode 100644 index 11a37dfe..00000000 --- a/examples/src/main/java/com/google/instrumentation/examples/trace/BasicContextTracing.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2017, Google Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.instrumentation.examples.trace; - -import com.google.instrumentation.common.NonThrowingCloseable; -import com.google.instrumentation.trace.Span; -import com.google.instrumentation.trace.Tracer; -import com.google.instrumentation.trace.Tracing; - -/** - * Example showing how to create a {@link Span}, install it to the current context and add - * annotations. - */ -public final class BasicContextTracing { - // Per class Tracer. - private static final Tracer tracer = Tracing.getTracer(); - - private static void doWork() { - // Add an annotation to the current Span. - tracer.getCurrentSpan().addAnnotation("This is a doWork() annotation."); - } - - /** Main method. */ - public static void main(String[] args) { - Span span = tracer.spanBuilder("MyRootSpan").becomeRoot().startSpan(); - try (NonThrowingCloseable ws = tracer.withSpan(span)) { - doWork(); - } - span.end(); - } -} diff --git a/examples/src/main/java/com/google/instrumentation/examples/trace/BasicScopedTracing.java b/examples/src/main/java/com/google/instrumentation/examples/trace/BasicScopedTracing.java deleted file mode 100644 index 4eddf800..00000000 --- a/examples/src/main/java/com/google/instrumentation/examples/trace/BasicScopedTracing.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2017, Google Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.instrumentation.examples.trace; - -import com.google.instrumentation.common.NonThrowingCloseable; -import com.google.instrumentation.trace.Span; -import com.google.instrumentation.trace.Tracer; -import com.google.instrumentation.trace.Tracing; - -/** - * Example showing how to create a {@link Span} using scoped Span, install it in the current - * context, and add annotations. - */ -public final class BasicScopedTracing { - // Per class Tracer. - private static final Tracer tracer = Tracing.getTracer(); - - private static void doWork() { - // Add an annotation to the current Span. - tracer.getCurrentSpan().addAnnotation("This is a doWork() annotation."); - } - - /** Main method. */ - public static void main(String[] args) { - try (NonThrowingCloseable ss = - tracer.spanBuilder("MyRootSpan").becomeRoot().startScopedSpan()) { - doWork(); - } - } -} diff --git a/examples/src/main/java/com/google/instrumentation/examples/trace/BasicTracing.java b/examples/src/main/java/com/google/instrumentation/examples/trace/BasicTracing.java deleted file mode 100644 index 1a78aebe..00000000 --- a/examples/src/main/java/com/google/instrumentation/examples/trace/BasicTracing.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2017, Google Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.instrumentation.examples.trace; - -import com.google.instrumentation.trace.Span; -import com.google.instrumentation.trace.Tracer; -import com.google.instrumentation.trace.Tracing; - -/** Example showing how to create a {@link Span} and add annotations. */ -public final class BasicTracing { - // Per class Tracer. - private static final Tracer tracer = Tracing.getTracer(); - - private static void doWork() { - Span span = tracer.spanBuilder(null, "MyRootSpan").startSpan(); - span.addAnnotation("This annotation is added directly to the span."); - span.end(); - } - - /** Main method. */ - public static void main(String[] args) { - doWork(); - } -} diff --git a/examples/src/main/java/com/google/instrumentation/examples/trace/MultiSpansContextTracing.java b/examples/src/main/java/io/opencensus/examples/trace/MultiSpansContextTracing.java index c83b11d9..ef497d7e 100644 --- a/examples/src/main/java/com/google/instrumentation/examples/trace/MultiSpansContextTracing.java +++ b/examples/src/main/java/io/opencensus/examples/trace/MultiSpansContextTracing.java @@ -11,13 +11,13 @@ * limitations under the License. */ -package com.google.instrumentation.examples.trace; +package io.opencensus.examples.trace; -import com.google.instrumentation.common.NonThrowingCloseable; -import com.google.instrumentation.trace.Span; -import com.google.instrumentation.trace.TraceExporter; -import com.google.instrumentation.trace.Tracer; -import com.google.instrumentation.trace.Tracing; +import io.opencensus.common.NonThrowingCloseable; +import io.opencensus.trace.Span; +import io.opencensus.trace.TraceExporter; +import io.opencensus.trace.Tracer; +import io.opencensus.trace.Tracing; /** * Example showing how to create a child {@link Span}, install it to the current context and add diff --git a/examples/src/main/java/com/google/instrumentation/examples/trace/MultiSpansScopedTracing.java b/examples/src/main/java/io/opencensus/examples/trace/MultiSpansScopedTracing.java index be7672d7..267fb639 100644 --- a/examples/src/main/java/com/google/instrumentation/examples/trace/MultiSpansScopedTracing.java +++ b/examples/src/main/java/io/opencensus/examples/trace/MultiSpansScopedTracing.java @@ -11,13 +11,13 @@ * limitations under the License. */ -package com.google.instrumentation.examples.trace; +package io.opencensus.examples.trace; -import com.google.instrumentation.common.NonThrowingCloseable; -import com.google.instrumentation.trace.Span; -import com.google.instrumentation.trace.TraceExporter; -import com.google.instrumentation.trace.Tracer; -import com.google.instrumentation.trace.Tracing; +import io.opencensus.common.NonThrowingCloseable; +import io.opencensus.trace.Span; +import io.opencensus.trace.TraceExporter; +import io.opencensus.trace.Tracer; +import io.opencensus.trace.Tracing; /** * Example showing how to create a child {@link Span} using scoped Spans, install it in the current diff --git a/examples/src/main/java/com/google/instrumentation/examples/trace/MultiSpansTracing.java b/examples/src/main/java/io/opencensus/examples/trace/MultiSpansTracing.java index 5268a797..036d3684 100644 --- a/examples/src/main/java/com/google/instrumentation/examples/trace/MultiSpansTracing.java +++ b/examples/src/main/java/io/opencensus/examples/trace/MultiSpansTracing.java @@ -11,12 +11,12 @@ * limitations under the License. */ -package com.google.instrumentation.examples.trace; +package io.opencensus.examples.trace; -import com.google.instrumentation.trace.Span; -import com.google.instrumentation.trace.TraceExporter; -import com.google.instrumentation.trace.Tracer; -import com.google.instrumentation.trace.Tracing; +import io.opencensus.trace.Span; +import io.opencensus.trace.TraceExporter; +import io.opencensus.trace.Tracer; +import io.opencensus.trace.Tracing; /** Example showing how to directly create a child {@link Span} and add annotations. */ public final class MultiSpansTracing { |
