All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.agroal.pool.MetricsRepository Maven / Gradle / Ivy

There is a newer version: 2.5
Show newest version
// Copyright (C) 2017 Red Hat, Inc. and individual contributors as indicated by the @author tags.
// You may not use this file except in compliance with the Apache License, Version 2.0.

package io.agroal.pool;

import io.agroal.api.AgroalDataSourceMetrics;

/**
 * @author Luis Barreiro
 */
public interface MetricsRepository extends AgroalDataSourceMetrics {

    default long beforeConnectionCreation() {
        return 0;
    }

    default void afterConnectionCreation(long timestamp) {
    }

    default long beforeConnectionAcquire() {
        return 0;
    }

    default void afterConnectionAcquire(long timestamp) {
    }

    default void afterConnectionReturn() {
    }

    default void afterLeakDetection() {
    }

    default void afterConnectionInvalid() {
    }

    default void afterConnectionFlush() {
    }

    default void afterConnectionReap() {
    }

    default void afterConnectionDestroy() {
    }

    // --- //

    final class EmptyMetricsRepository implements MetricsRepository {

        @Override
        public String toString() {
            return "Metrics Disabled";
        }
    }

    // --- //
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy