Skip to content

Commit 29568ba

Browse files
committed
Fix style violations
1 parent 794561c commit 29568ba

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
package com.example.spanner;
1+
/*
2+
* Copyright 2018 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
216

3-
import java.util.Arrays;
17+
package com.example.spanner;
418

519
import com.google.cloud.spanner.DatabaseClient;
620
import com.google.cloud.spanner.DatabaseId;
@@ -17,11 +31,16 @@
1731
import io.opencensus.trace.Tracing;
1832
import io.opencensus.trace.samplers.Samplers;
1933

34+
import java.util.Arrays;
35+
36+
/**
37+
* This sample demonstrates how to enable opencensus tracing and stats in cloud spanner client.
38+
*/
2039
public class TracingSample {
2140

2241
private static final String SAMPLE_SPAN = "CloudSpannerSample";
2342

24-
public static void main(String[] args) throws Exception {
43+
public static void main(String[] args) throws Exception {
2544
if (args.length != 2) {
2645
System.err.println("Usage: TracingSample <instance_id> <database_id>");
2746
return;
@@ -33,7 +52,8 @@ public static void main(String[] args) throws Exception {
3352
ZPageHandlers.startHttpServerAndRegisterAll(8080);
3453
// Installs an exporter for stack driver traces.
3554
StackdriverExporter.createAndRegister();
36-
Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList(SAMPLE_SPAN));
55+
Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(
56+
Arrays.asList(SAMPLE_SPAN));
3757

3858
// Installs an exporter for stack driver stats.
3959
StackdriverStatsExporter.createAndRegister();

0 commit comments

Comments
 (0)