Search in sources :

Example 1 with ThreadMetrics

use of org.neo4j.metrics.source.jvm.ThreadMetrics 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;
}
Also used : ReadReplicaMetrics(org.neo4j.metrics.source.causalclustering.ReadReplicaMetrics) CheckPointingMetrics(org.neo4j.metrics.source.db.CheckPointingMetrics) NetworkMetrics(org.neo4j.metrics.source.cluster.NetworkMetrics) MemoryBuffersMetrics(org.neo4j.metrics.source.jvm.MemoryBuffersMetrics) LogRotationMetrics(org.neo4j.metrics.source.db.LogRotationMetrics) BoltMetrics(org.neo4j.metrics.source.db.BoltMetrics) CatchUpMetrics(org.neo4j.metrics.source.causalclustering.CatchUpMetrics) TransactionMetrics(org.neo4j.metrics.source.db.TransactionMetrics) OperationalMode(org.neo4j.kernel.impl.factory.OperationalMode) CoreMetrics(org.neo4j.metrics.source.causalclustering.CoreMetrics) MemoryPoolMetrics(org.neo4j.metrics.source.jvm.MemoryPoolMetrics) ClusterMetrics(org.neo4j.metrics.source.cluster.ClusterMetrics) CypherMetrics(org.neo4j.metrics.source.db.CypherMetrics) ThreadMetrics(org.neo4j.metrics.source.jvm.ThreadMetrics) PageCacheMetrics(org.neo4j.metrics.source.db.PageCacheMetrics) EntityCountMetrics(org.neo4j.metrics.source.db.EntityCountMetrics) ServerMetrics(org.neo4j.metrics.source.server.ServerMetrics) GCMetrics(org.neo4j.metrics.source.jvm.GCMetrics)

Aggregations

OperationalMode (org.neo4j.kernel.impl.factory.OperationalMode)1 CatchUpMetrics (org.neo4j.metrics.source.causalclustering.CatchUpMetrics)1 CoreMetrics (org.neo4j.metrics.source.causalclustering.CoreMetrics)1 ReadReplicaMetrics (org.neo4j.metrics.source.causalclustering.ReadReplicaMetrics)1 ClusterMetrics (org.neo4j.metrics.source.cluster.ClusterMetrics)1 NetworkMetrics (org.neo4j.metrics.source.cluster.NetworkMetrics)1 BoltMetrics (org.neo4j.metrics.source.db.BoltMetrics)1 CheckPointingMetrics (org.neo4j.metrics.source.db.CheckPointingMetrics)1 CypherMetrics (org.neo4j.metrics.source.db.CypherMetrics)1 EntityCountMetrics (org.neo4j.metrics.source.db.EntityCountMetrics)1 LogRotationMetrics (org.neo4j.metrics.source.db.LogRotationMetrics)1 PageCacheMetrics (org.neo4j.metrics.source.db.PageCacheMetrics)1 TransactionMetrics (org.neo4j.metrics.source.db.TransactionMetrics)1 GCMetrics (org.neo4j.metrics.source.jvm.GCMetrics)1 MemoryBuffersMetrics (org.neo4j.metrics.source.jvm.MemoryBuffersMetrics)1 MemoryPoolMetrics (org.neo4j.metrics.source.jvm.MemoryPoolMetrics)1 ThreadMetrics (org.neo4j.metrics.source.jvm.ThreadMetrics)1 ServerMetrics (org.neo4j.metrics.source.server.ServerMetrics)1