Skip to content

a JDBC driver that wraps an other JDBC driver and generates JFR events

Notifications You must be signed in to change notification settings

nikogillen/jfr-jdbc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JFR JDBC Maven Central Javadocs Build Status

A JDBC driver that wraps an other JDBC driver and generates JFR events.

<dependency>
  <groupId>com.github.marschall</groupId>
  <artifactId>jfr-jdbc</artifactId>
  <version>0.4.0</version>
</dependency>

Usage

Simply wrap your DataSource with a JfrDataSource

new JfrDataSource(dataSource)

If you use Driver simply prefix your JDBC URL with "jfr:" for example use "jdbc:jfr:h2:mem:" instead of "jdbc:h2:mem:".

The project is a Java module with the name com.github.marschall.jfr.jdbc.

Implementation/Overhead

The implementation is based around wrapper objects.

  • no reflection
  • no string concatenation

Caveats

  • does not work with Oracle explicit statement caching
  • does not work with unwrapped objects
  • does not work with implicitly closed objects
  • does not work with cached statements provided by a connection pool
  • only accessing the first warning is instrumented, accessing the following ones is not
  • reconstructing the JDBC call time and row count is not super reliable especially in the case for more exotic row iteration

About

a JDBC driver that wraps an other JDBC driver and generates JFR events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%