Statistics::getSuccessfulTransactionCount, "result", "success");
counter(registry, "hibernate.transactions", "The number of transactions we know to have failed",
s -> s.getTransactionCount() - s.getSuccessfulTransactionCount(), "result", "failure");
counter(registry, "hibernate.optimistic.failures", "The number of StaleObjectStateExceptions that have occurred",
Statistics::getOptimisticFailureCount);