https://github.com/marschall/jfr-jdbc
a JDBC driver that wraps an other JDBC driver and generates JFR events
https://github.com/marschall/jfr-jdbc
java java-flight-recorder jdbc
Last synced: about 1 month ago
JSON representation
a JDBC driver that wraps an other JDBC driver and generates JFR events
- Host: GitHub
- URL: https://github.com/marschall/jfr-jdbc
- Owner: marschall
- Created: 2019-02-20T17:10:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-03T10:11:10.000Z (over 1 year ago)
- Last Synced: 2025-03-27T02:43:17.064Z (about 2 months ago)
- Topics: java, java-flight-recorder, jdbc
- Language: Java
- Size: 92.8 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
JFR JDBC [](https://maven-badges.herokuapp.com/maven-central/com.github.marschall/jfr-jdbc) [](https://www.javadoc.io/doc/com.github.marschall/jfr-jdbc) [](https://travis-ci.org/marschall/jfr-jdbc)
========A JDBC driver that wraps an other JDBC driver and generates JFR events.
```xml
com.github.marschall
jfr-jdbc
0.4.0```
Usage
-----Simply wrap your `DataSource` with a `JfrDataSource`
```java
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 concatenationCaveats
-------- 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