hikaricp_connections_usage_seconds_max{pool="HikariPool-1",} 0.025 # HELP hikaricp_connections_creation_seconds_max Connection creation time # TYPE hikaricp_connections_creation_seconds_max gauge hikaricp_connections_creation_seconds_max{pool="HikariPool-1",} 0.094 # HELP hikaricp_connections_creati...
hikaricp_connections_usage_seconds_count{pool="HikariPool-1",} 3.0 hikaricp_connections_usage_seconds_sum{pool="HikariPool-1",} 0.06 # HELP hikaricp_connections_usage_seconds_max Connection usage time # TYPE hikaricp_connections_usage_seconds_max gauge hikaricp_connections_usage_seconds_max{pool=...
return new PoolStats(SECONDS.toMillis(1)) { @Override protected void update() { //实现了PoolStat的update方法,刷新各个属性的值 this.pendingThreads = HikariPool.this.getThreadsAwaitingConnection(); this.idleConnections = HikariPool.this.getIdleConnections(); this.totalConnections = HikariPool.this....
3.0 hikaricp_connections_usage_seconds_sum{pool="HikariPool-1",} 0.06 # HELP hikaricp_connections_usage_seconds_max Connection usage time # TYPE hikaricp_connections_usage_seconds_max gauge hikaricp_connections_usage_seconds_max{pool="HikariPool-1",} 0.0 # HELP hikaricp_connections_max Max con...
}//这里以获取最大连接数为例,其他的跟这个差不多publicintgetMaxConnections(){if(shouldLoad()) {//是否应该刷新update();//刷新属性值,注意这个update的实现在HikariPool里,因为这些属性值的直接或间接来源都是HikariPool}returnmaxConnections; }protectedabstractvoidupdate();//实现在↑上面已经说了privateboole...
}//这里以获取最大连接数为例,其他的跟这个差不多publicintgetMaxConnections(){if(shouldLoad()) {//是否应该刷新update();//刷新属性值,注意这个update的实现在HikariPool里,因为这些属性值的直接或间接来源都是HikariPool}returnmaxConnections; }protectedabstractvoidupdate();//实现在↑上面已经说了privateboole...
(); } //这里以获取最大连接数为例,其他的跟这个差不多 public int getMaxConnections() { if (shouldLoad()) { //是否应该刷新 update(); //刷新属性值,注意这个update的实现在HikariPool里,因为这些属性值的直接或间接来源都是HikariPool } return maxConnections; } protected abstract void update(); ...
protected volatile int maxConnections; // 最小连接数 protected volatile int minConnections; public PoolStats(final long timeoutMs) { this.timeoutMs = timeoutMs; this.reloadAt = new AtomicLong(); } //这里以获取最大连接数为例,其他的跟这个差不多 public int getMaxConnections() { if (should...
如果大于0且不是单元测试,则进一步判断:(leakDetectionThreshold < SECONDS.toMillis(2) or (leakDetectionThreshold > maxLifetime && maxLifetime > 0),会被重置为0。即如果要生效则必须>0,而且不能小于2秒,而且当maxLifetime > 0时不能大于maxLifetime(默认值1800000毫秒=30分钟)。 leakDetectionThreshold ...
();//刷新属性值,注意这个update的实现在HikariPool里,因为这些属性值的直接或间接来源都是HikariPool}returnmaxConnections; }protectedabstractvoidupdate();//实现在↑上面已经说了privatebooleanshouldLoad(){//按照更新频率来决定是否刷新属性值for(; ; ) {finallongnow = currentTime();finallongreloadTime = ...