use of org.neo4j.metrics.source.jvm.MemoryPoolMetrics in project neo4j by neo4j.
the class Neo4jMetricsBuilder method build.
public boolean build() {
boolean result = false;
if (config.get(MetricsSettings.neoTxEnabled)) {
life.add(new TransactionMetrics(registry, dependencies.transactionIdStore(), dependencies.transactionCounters()));
result = true;
}
if (config.get(MetricsSettings.neoPageCacheEnabled)) {
life.add(new PageCacheMetrics(registry, dependencies.pageCacheCounters()));
result = true;
}
if (config.get(MetricsSettings.neoCheckPointingEnabled)) {
life.add(new CheckPointingMetrics(reporter, registry, dependencies.monitors(), dependencies.checkPointerMonitor()));
result = true;
}
if (config.get(MetricsSettings.neoLogRotationEnabled)) {
life.add(new LogRotationMetrics(reporter, registry, dependencies.monitors(), dependencies.logRotationMonitor()));
result = true;
}
if (config.get(MetricsSettings.neoCountsEnabled)) {
life.add(new EntityCountMetrics(registry, dependencies.entityCountStats()));
result = true;
}
if (config.get(MetricsSettings.neoNetworkEnabled)) {
life.add(new NetworkMetrics(registry, dependencies.monitors()));
result = true;
}
if (config.get(MetricsSettings.neoClusterEnabled)) {
if (kernelContext.databaseInfo().operationalMode == OperationalMode.ha) {
life.add(new ClusterMetrics(dependencies.monitors(), registry, dependencies.clusterMembers()));
result = true;
} else {
logService.getUserLog(getClass()).warn("Cluster metrics was enabled but the graph database is not in HA mode.");
}
}
if (config.get(MetricsSettings.cypherPlanningEnabled)) {
life.add(new CypherMetrics(registry, dependencies.monitors()));
result = true;
}
if (config.get(MetricsSettings.jvmGcEnabled)) {
life.add(new GCMetrics(registry));
result = true;
}
if (config.get(MetricsSettings.jvmThreadsEnabled)) {
life.add(new ThreadMetrics(registry));
result = true;
}
if (config.get(MetricsSettings.boltMessagesEnabled)) {
life.add(new BoltMetrics(registry, dependencies.monitors()));
result = true;
}
if (config.get(MetricsSettings.jvmMemoryEnabled)) {
life.add(new MemoryPoolMetrics(registry));
result = true;
}
if (config.get(MetricsSettings.jvmBuffersEnabled)) {
life.add(new MemoryBuffersMetrics(registry));
result = true;
}
if (config.get(MetricsSettings.causalClusteringEnabled)) {
OperationalMode mode = kernelContext.databaseInfo().operationalMode;
if (mode == OperationalMode.core) {
life.add(new CoreMetrics(dependencies.monitors(), registry, dependencies.raft()));
life.add(new CatchUpMetrics(dependencies.monitors(), registry));
result = true;
} else if (mode == OperationalMode.read_replica) {
life.add(new ReadReplicaMetrics(dependencies.monitors(), registry));
life.add(new CatchUpMetrics(dependencies.monitors(), registry));
result = true;
} else {
logService.getUserLog(getClass()).warn("Causal Clustering metrics was enabled but the graph database is not in Causal " + "Clustering mode.");
}
}
if (config.get(MetricsSettings.neoServerEnabled)) {
life.add(new ServerMetrics(registry, logService, kernelContext.dependencySatisfier()));
result = true;
}
return result;
}
Aggregations