CavalliumDBEngine/src/main/java/it/cavallium/dbengine/netty/JMXPooledNettyMonitoring.java

54 lines
1.1 KiB
Java
Raw Normal View History

2021-05-03 18:07:18 +02:00
package it.cavallium.dbengine.netty;
2022-03-16 13:47:56 +01:00
import io.netty5.buffer.api.pool.BufferAllocatorMetric;
import io.netty5.buffer.api.pool.PooledBufferAllocator;
2021-08-31 09:14:46 +02:00
import java.lang.reflect.Field;
2021-05-03 18:07:18 +02:00
public class JMXPooledNettyMonitoring extends JMXNettyMonitoring implements JMXNettyMonitoringMBean {
2021-08-31 09:14:46 +02:00
private final PooledBufferAllocator alloc;
private final BufferAllocatorMetric metric;
2021-05-03 18:07:18 +02:00
2021-08-31 09:14:46 +02:00
public JMXPooledNettyMonitoring(String name, PooledBufferAllocator alloc) {
super(name, alloc.isDirectBufferPooled(), alloc.metric());
this.alloc = alloc;
this.metric = alloc.metric();
2021-05-03 18:07:18 +02:00
}
@Override
public Integer getNumHeapArenas() {
2021-08-31 09:14:46 +02:00
return direct ? 0 : alloc.numArenas();
2021-05-03 18:07:18 +02:00
}
@Override
public Integer getNumDirectArenas() {
2021-08-31 09:14:46 +02:00
return direct ? alloc.numArenas() : 0;
2021-05-03 18:07:18 +02:00
}
@Override
public Integer getNumThreadLocalCachesArenas() {
2022-04-09 02:45:42 +02:00
return 0;
2021-05-03 18:07:18 +02:00
}
@Deprecated
@Override
public Integer getTinyCacheSize() {
2021-08-31 09:14:46 +02:00
return 0;
2021-05-03 18:07:18 +02:00
}
@Override
public Integer getSmallCacheSize() {
2022-04-09 02:45:42 +02:00
return 0;
2021-05-03 18:07:18 +02:00
}
@Override
public Integer getNormalCacheSize() {
2022-04-09 02:45:42 +02:00
return 0;
2021-05-03 18:07:18 +02:00
}
@Override
public Integer getChunkSize() {
2022-04-09 02:45:42 +02:00
return 0;
2021-05-03 18:07:18 +02:00
}
}