hibernate-reactive icon indicating copy to clipboard operation
hibernate-reactive copied to clipboard

statistics for interaction with Vert.x client

Open gavinking opened this issue 2 years ago • 12 comments

We now have a Statistics interface but we don't record any information about statements and connections.

gavinking avatar Jan 27 '22 15:01 gavinking

And when we activate the statistics we see logs mentioning JDBC:

    INFO StatisticalLoggingSessionEventListener [vert.x-eventloop-thread-0] Session Metrics {
        0 nanoseconds spent acquiring 0 JDBC connections;
        0 nanoseconds spent releasing 0 JDBC connections;
        0 nanoseconds spent preparing 0 JDBC statements;
        0 nanoseconds spent executing 0 JDBC statements;
        0 nanoseconds spent executing 0 JDBC batches;
        0 nanoseconds spent performing 0 L2C puts;
        0 nanoseconds spent performing 0 L2C hits;
        0 nanoseconds spent performing 0 L2C misses;
        10408842 nanoseconds spent executing 1 flushes (flushing a total of 3 entities and 0 collections);
        0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
    }

DavideD avatar Jun 10 '22 13:06 DavideD

So I worked on this yesterday, and it's turning out to be waaay harder than it sounds.

To do this properly, I need access to the SessionEventListenerManager that is created in the constructor of AbstractSharedSessionContract from the getConnection() methods of SqlClientPool.

The problem is that currently we call getConnection() before instantiating the ReactiveSessionImpl or ReactiveStatelessSessionImpl, so the SessionEventListenerManager has not yet been built at that point.

I'm not sure what the right solution is. I don't want to move the call to getConnection() into the constructor of ReactiveSessionImpl. Perhaps I could add a setListener() method to ReactiveConnection, but I hate giving it mutable state.

gavinking avatar Jul 09 '22 10:07 gavinking

Perhaps I could add a setListener() method to ReactiveConnection, but I hate giving it mutable state.

Also: this is easy, but it doesn't fully solve the problem, because I can't properly log connection acquisition.

gavinking avatar Jul 09 '22 10:07 gavinking

Hello Is hibernate reactive 2.0 changing something in that problem?

adampoplawski avatar Jun 07 '23 20:06 adampoplawski

Hello @gavinking @DavideD is this topic abandoned for now? Sorry for pushing, just a feature that I miss the most.

adampoplawski avatar Aug 03 '23 05:08 adampoplawski

Not completely abandoned, but nobody is working on it at the moment

DavideD avatar Aug 03 '23 08:08 DavideD

@DavideD thx for information. Thank you for your effort.

adampoplawski avatar Aug 03 '23 11:08 adampoplawski

Hello @DavideD Is there maybe some place where I can check status of this task, to not bother each few months :)

adampoplawski avatar Jan 03 '24 13:01 adampoplawski

Hello, this is the place for status updates. If you don't see any, and the issue is unassigned, it means that nobody is working on it.

You can still ask if you want to double check, or you can try to solve it and send a contribution (I haven't looked into it, so I'm not sure how hard this is to solve).

DavideD avatar Jan 04 '24 08:01 DavideD

@DavideD Thx. All clear now.

adampoplawski avatar Jan 04 '24 09:01 adampoplawski