<commit_before>#####################
GRPC-Java OpenTracing
#####################

============
Installation
============

This package is available on Maven Central and can be added to your project as follows:

**Maven**
```
<dependencies>
	<dependency>
		<groupId>io.opentracing.contrib.grpc</groupId>
		<artifactId>grpc-opentracing</artifactId>
		<version>0.1.0</version>
	</dependency>
</dependencies>
```

**Gradle**
```
compile 'io.opentracing.contrib.grpc:grpc-opentracing:0.1.0'
```

**Note:** This package was developed using grpc-java v1.0.0-pre1.

==========
QuickStart
========== 

If you want to add basic tracing to your clients and servers, you can do so in a few short and simple steps. (These code snippets use the grpc example's generated GreeterGrpc.java)

**Clients**

- Instantiate a tracer
- Create a `ClientTracingInterceptor`
- Intercept the client channel

	```java
	public class YourClient {

		private final ManagedChannel channel;
  		private final GreeterGrpc.GreeterBlockingStub blockingStub;

		public YourClient(String host, int port) {
			channel = ManagedChannelBuilder.forAddress(host, port)
				.usePlaintext(true)
				.build();
		
			Tracer tracer = yourOpenTracingTracer; # any implementation of io.opentracing.Tracer
			ClientTracingInterceptor tracingInterceptor = new ClientTracingInterceptor(tracer)

			blockingStub = GreeterGrpc.newBlockingStub(tracingInterceptor.intercept(channel));
		}
	}
	```
**Servers**

- Instantiate a tracer
- Create a `ServerTracingInterceptor`
- Intercept a service 
	
	```java
	public class YourServer {

		private int port;
	  	private Server server;

	  	private void start() throws IOException {
		
			Tracer tracer = yourOpenTracingTracer;
			ServerTracingInterceptor tracingInterceptor = new ServerTracingInterceptor(tracer);

			server = ServerBuilder.forPort(port)
				.addService(tracingInterceptor.intercept(someServiceDef))
				.build()
				.start();

			Runtime.getRuntime().addShutdownHook(new Thread() {
			  	@Override
			  	public void run() {
					HelloWorldServer.this.stop();
				}
			});
		}
	}
	```

==============<commit_msg>Fix README format<commit_after>#####################
GRPC-Java OpenTracing
#####################

============
Installation
============

This package is available on Maven Central and can be added to your project as follows:

**Maven**

.. code-block::
	<dependencies>
		<dependency>
			<groupId>io.opentracing.contrib.grpc</groupId>
			<artifactId>grpc-opentracing</artifactId>
			<version>0.1.0</version>
		</dependency>
	</dependencies>

**Gradle**

.. code-block::
	
	compile 'io.opentracing.contrib.grpc:grpc-opentracing:0.1.0'

**Note:** This package was developed using grpc-java v1.0.0-pre1.

==========
QuickStart
========== 

If you want to add basic tracing to your clients and servers, you can do so in a few short and simple steps. (These code snippets use the grpc example's generated GreeterGrpc.java)

**Clients**

- Instantiate a tracer
- Create a `ClientTracingInterceptor`
- Intercept the client channel

.. code-block:: java

	public class YourClient {

		private final ManagedChannel channel;
  		private final GreeterGrpc.GreeterBlockingStub blockingStub;

		public YourClient(String host, int port) {
			channel = ManagedChannelBuilder.forAddress(host, port)
				.usePlaintext(true)
				.build();
		
			Tracer tracer = yourOpenTracingTracer; # any implementation of io.opentracing.Tracer
			ClientTracingInterceptor tracingInterceptor = new ClientTracingInterceptor(tracer)

			blockingStub = GreeterGrpc.newBlockingStub(tracingInterceptor.intercept(channel));
		}
	}

**Servers**

- Instantiate a tracer
- Create a `ServerTracingInterceptor`
- Intercept a service 
	
.. code-block:: java

	public class YourServer {

		private int port;
	  	private Server server;

	  	private void start() throws IOException {
		
			Tracer tracer = yourOpenTracingTracer;
			ServerTracingInterceptor tracingInterceptor = new ServerTracingInterceptor(tracer);

			server = ServerBuilder.forPort(port)
				.addService(tracingInterceptor.intercept(someServiceDef))
				.build()
				.start();

			Runtime.getRuntime().addShutdownHook(new Thread() {
			  	@Override
			  	public void run() {
					HelloWorldServer.this.stop();
				}
			});
		}
	}

==============
{'fraction_non_alphanumeric': 0.14008872285780993, 'fraction_numerical': 0.0046696240952603316, 'mean_word_length': 4.409090909090909, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5747522', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1288, 'n_words': 330}