opentracing-contrib / java-jdbc

OpenTracing Instrumentation for JDBC
Apache License 2.0
82 stars 56 forks source link

Interceptor Mode #51

Closed safris closed 4 years ago

safris commented 4 years ago

This PR adds "interceptor mode" to the TracingDriver. The "interceptor mode" is described in the README.md.

The "interceptor mode" behavior is deactivated by default, which means that the TracingDriver works in the same way as before. Only by calling TracingDriver.setInterceptorMode(true) will the "interceptor mode" be activated.

A few other modifications are a part of this PR:

  1. Add TracingDriver.load(), which returns the TracerDriver singleton instance. The existence of this method will greatly simplify this code, which obtains the singleton instance via the DriverManager.
  2. Lower the class version to jdk1.7.
  3. Add assertion to validate that the expected Driver is returned from DriverManager: JdbcTest.assertGetDriver(connection).

I have bumped the version of the java-jdbc module to 0.2.0.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 179


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/io/opentracing/contrib/jdbc/TracingDriver.java 32 37 86.49%
<!-- Total: 32 37 86.49% -->
Totals Coverage Status
Change from base Build 178: 1.3%
Covered Lines: 421
Relevant Lines: 897

💛 - Coveralls