Search in sources :

Example 1 with DbMetricsReporter

use of org.camunda.bpm.engine.impl.metrics.reporter.DbMetricsReporter in project camunda-bpm-platform by camunda.

the class ReportDbMetricsCmd method execute.

public Void execute(CommandContext commandContext) {
    ProcessEngineConfigurationImpl engineConfiguration = Context.getProcessEngineConfiguration();
    if (!engineConfiguration.isMetricsEnabled()) {
        throw new ProcessEngineException("Metrics reporting is disabled");
    }
    if (!engineConfiguration.isDbMetricsReporterActivate()) {
        throw new ProcessEngineException("Metrics reporting to database is disabled");
    }
    DbMetricsReporter dbMetricsReporter = engineConfiguration.getDbMetricsReporter();
    dbMetricsReporter.reportNow();
    return null;
}
Also used : ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) DbMetricsReporter(org.camunda.bpm.engine.impl.metrics.reporter.DbMetricsReporter)

Aggregations

ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 DbMetricsReporter (org.camunda.bpm.engine.impl.metrics.reporter.DbMetricsReporter)1