Closed amitanandaiyer closed 3 years ago
@amitanandaiyer @robertsami Would it be better to Extend the "PreparedStatement" class to our version that includes this functionality? That can take as arguments the SQL string, the Histogram pointer, Txn type, etc..
All it would do for methods like "executeUpdate", "executeQuery etc. is call the Base class' method and calculate latency..
That way most of the code will remain same. And we will have to only change the getPreparedStatement() method. Let me know what you think.
@psudheer21 i think your proposal is a more expedient solution. i prefer composition over inheritance in such cases, as in my experience extending third party library classes can be fragile, but not going to argue strongly one way or the other!
@amitanandaiyer nice! this seems great to have, but wondering a couple things:
one thing to consider that may be a bit cleaner is introducing something like the following:
this way we can inject custom functionality, such as tracking timings, as needed. note @psudheer21 that this kind of construct would also more cleanly deal with the retry logic introduced in TPCCLoader recently