improvements to many session testing

This commit is contained in:
Jonathan Shook 2024-11-20 16:06:20 -06:00
parent 55f11d5395
commit 36d12fb790
2 changed files with 16 additions and 6 deletions

View File

@ -85,6 +85,7 @@ public class Cqld4Space extends BaseSpace<Cqld4Space> {
// stop insights for testing
OptionsMap defaults = new OptionsMap();
defaults.put(TypedDriverOption.MONITOR_REPORTING_ENABLED, false); // We don't need to do this every time we run a test or sanity check
defaults.put(TypedDriverOption.SESSION_LEAK_THRESHOLD, 100000000);
DriverConfigLoader dcl = DriverConfigLoader.fromMap(defaults);
// add streamlined cql parameters

View File

@ -31,10 +31,7 @@ import io.nosqlbench.nb.api.labels.NBLabeledElement;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import java.lang.management.MemoryManagerMXBean;
import java.lang.management.MemoryPoolMXBean;
import java.lang.management.*;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ -50,6 +47,7 @@ public class NBSession extends NBHeartbeatComponent implements Function<List<Cmd
private final static Logger logger = LogManager.getLogger(NBSession.class);
// private final ClientSystemMetricChecker clientMetricChecker;
private MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
private OperatingSystemMXBean osbean = ManagementFactory.getOperatingSystemMXBean();
private final Map<String, NBBufferedContainer> containers = new ConcurrentHashMap<>();
@ -74,6 +72,17 @@ public class NBSession extends NBHeartbeatComponent implements Function<List<Cmd
new NBSessionSafetyMetrics(this);
OperatingSystemMXBean osMxBean = ManagementFactory.getOperatingSystemMXBean();
if (osMxBean instanceof com.sun.management.UnixOperatingSystemMXBean osb) {
create().gauge(
"open_file_descriptors",
() -> (double) osb.getOpenFileDescriptorCount(),
MetricCategory.Internals,
"open file descriptors"
);
}
// on-heap
create().gauge(
"on_heap_memory_used",