当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationMetricsReporting.StmtGroupMetrics方法代码示例

本文整理汇总了Java中com.espertech.esper.client.ConfigurationMetricsReporting.StmtGroupMetrics方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationMetricsReporting.StmtGroupMetrics方法的具体用法?Java ConfigurationMetricsReporting.StmtGroupMetrics怎么用?Java ConfigurationMetricsReporting.StmtGroupMetrics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.espertech.esper.client.ConfigurationMetricsReporting的用法示例。


在下文中一共展示了ConfigurationMetricsReporting.StmtGroupMetrics方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
    applyMetricsConfig(configuration, -1, 7000, true);

    ConfigurationMetricsReporting.StmtGroupMetrics groupOne = new ConfigurationMetricsReporting.StmtGroupMetrics();
    groupOne.setInterval(8000);
    groupOne.addIncludeLike("%GroupOne%");
    groupOne.setReportInactive(true);
    configuration.getEngineDefaults().getMetricsReporting().addStmtGroup("GroupOneStatements", groupOne);

    ConfigurationMetricsReporting.StmtGroupMetrics groupTwo = new ConfigurationMetricsReporting.StmtGroupMetrics();
    groupTwo.setInterval(6000);
    groupTwo.setDefaultInclude(true);
    groupTwo.addExcludeLike("%Default%");
    groupTwo.addExcludeLike("%Metrics%");
    configuration.getEngineDefaults().getMetricsReporting().addStmtGroup("GroupTwoNonDefaultStatements", groupTwo);

    ConfigurationMetricsReporting.StmtGroupMetrics groupThree = new ConfigurationMetricsReporting.StmtGroupMetrics();
    groupThree.setInterval(-1);
    groupThree.addIncludeLike("%Metrics%");
    configuration.getEngineDefaults().getMetricsReporting().addStmtGroup("MetricsStatements", groupThree);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:22,代码来源:ExecClientMetricsReportingStmtGroups.java

示例2: StatementMetricRepository

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
/**
 * Ctor.
 *
 * @param engineURI     engine URI
 * @param specification specifies statement groups
 */
public StatementMetricRepository(String engineURI, ConfigurationMetricsReporting specification) {
    this.specification = specification;
    int numGroups = specification.getStatementGroups().size() + 1;  // +1 for default group (remaining stmts)
    this.groupMetrics = new StatementMetricArray[numGroups];

    // default group
    groupMetrics[0] = new StatementMetricArray(engineURI, "group-default", 100, false);

    // initialize all other groups
    int countGroups = 1;
    for (Map.Entry<String, ConfigurationMetricsReporting.StmtGroupMetrics> entry : specification.getStatementGroups().entrySet()) {
        ConfigurationMetricsReporting.StmtGroupMetrics config = entry.getValue();

        int initialNumStmts = config.getNumStatements();
        if (initialNumStmts < 10) {
            initialNumStmts = 10;
        }
        groupMetrics[countGroups] = new StatementMetricArray(engineURI, "group-" + countGroups, initialNumStmts, config.isReportInactive());
        countGroups++;
    }

    statementGroups = new HashMap<String, Integer>();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:30,代码来源:StatementMetricRepository.java

示例3: setContext

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
public void setContext(EPRuntime runtime, EPServicesContext servicesContext) {
    MetricExecutionContext metricsExecutionContext = new MetricExecutionContext(servicesContext, runtime, stmtMetricRepository);

    // create all engine and statement executions
    metricExecEngine = new MetricExecEngine(this, engineUri, schedule, specification.getEngineInterval());
    metricExecStmtGroupDefault = new MetricExecStatement(this, schedule, specification.getStatementInterval(), 0);

    int countGroups = 1;
    for (Map.Entry<String, ConfigurationMetricsReporting.StmtGroupMetrics> entry : specification.getStatementGroups().entrySet()) {
        ConfigurationMetricsReporting.StmtGroupMetrics config = entry.getValue();
        MetricExecStatement metricsExecution = new MetricExecStatement(this, schedule, config.getInterval(), countGroups);
        this.statementGroupExecutions.put(entry.getKey(), metricsExecution);
        countGroups++;
    }

    // last assign this volatile variable so the time event processing may schedule callbacks 
    executionContext = metricsExecutionContext;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:19,代码来源:MetricReportingServiceImpl.java

示例4: setContext

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
public void setContext(EPRuntime runtime, EPServicesContext servicesContext)
{
    MetricExecutionContext metricsExecutionContext = new MetricExecutionContext(servicesContext, runtime, stmtMetricRepository);

    // create all engine and statement executions
    metricExecEngine = new MetricExecEngine(this, engineUri, schedule, specification.getEngineInterval());
    metricExecStmtGroupDefault = new MetricExecStatement(this, schedule, specification.getStatementInterval(), 0);

    int countGroups = 1;
    for (Map.Entry<String, ConfigurationMetricsReporting.StmtGroupMetrics> entry : specification.getStatementGroups().entrySet())
    {
        ConfigurationMetricsReporting.StmtGroupMetrics config = entry.getValue();
        MetricExecStatement metricsExecution = new MetricExecStatement(this, schedule, config.getInterval(), countGroups);
        this.statementGroupExecutions.put(entry.getKey(), metricsExecution);
        countGroups++;
    }

    // last assign this volatile variable so the time event processing may schedule callbacks 
    executionContext = metricsExecutionContext;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:21,代码来源:MetricReportingServiceImpl.java

示例5: configure

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
    applyMetricsConfig(configuration, -1, 10000, true);

    ConfigurationMetricsReporting.StmtGroupMetrics configOne = new ConfigurationMetricsReporting.StmtGroupMetrics();
    configOne.setInterval(-1);
    configOne.addIncludeLike("%@METRIC%");
    configuration.getEngineDefaults().getMetricsReporting().addStmtGroup("metrics", configOne);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExecClientMetricsReportingDisableStatement.java

示例6: addStatement

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
/**
 * Add a statement, inspecting the statement name and adding it to a statement group or the default group, if none.
 *
 * @param stmtName name to inspect
 * @return handle for statement
 */
public StatementMetricHandle addStatement(String stmtName) {
    // determine group
    int countGroups = 1;
    int groupNumber = -1;
    for (Map.Entry<String, ConfigurationMetricsReporting.StmtGroupMetrics> entry : specification.getStatementGroups().entrySet()) {
        List<Pair<StringPatternSet, Boolean>> patterns = entry.getValue().getPatterns();
        boolean result = StringPatternSetUtil.evaluate(entry.getValue().isDefaultInclude(), patterns, stmtName);

        if (result) {
            groupNumber = countGroups;
            break;
        }
        countGroups++;
    }

    // assign to default group if none other apply
    if (groupNumber == -1) {
        groupNumber = 0;
    }

    int index = groupMetrics[groupNumber].addStatementGetIndex(stmtName);

    statementGroups.put(stmtName, groupNumber);

    return new StatementMetricHandle(groupNumber, index);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:33,代码来源:StatementMetricRepository.java

示例7: StatementMetricRepository

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
/**
 * Ctor.
 * @param engineURI engine URI
 * @param specification specifies statement groups
 */
public StatementMetricRepository(String engineURI, ConfigurationMetricsReporting specification)
{
    this.specification = specification;
    int numGroups = specification.getStatementGroups().size() + 1;  // +1 for default group (remaining stmts)
    this.groupMetrics = new StatementMetricArray[numGroups];

    // default group
    groupMetrics[0] = new StatementMetricArray(engineURI, "group-default", 100, false);

    // initialize all other groups
    int countGroups = 1;
    for (Map.Entry<String, ConfigurationMetricsReporting.StmtGroupMetrics> entry : specification.getStatementGroups().entrySet())
    {
        ConfigurationMetricsReporting.StmtGroupMetrics config = entry.getValue();

        int initialNumStmts = config.getNumStatements();
        if (initialNumStmts < 10)
        {
            initialNumStmts = 10;
        }
        groupMetrics[countGroups] = new StatementMetricArray(engineURI, "group-" + countGroups, initialNumStmts, config.isReportInactive());
        countGroups++;
    }

    statementGroups = new HashMap<String, Integer>();
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:32,代码来源:StatementMetricRepository.java

示例8: addStatement

import com.espertech.esper.client.ConfigurationMetricsReporting; //导入方法依赖的package包/类
/**
 * Add a statement, inspecting the statement name and adding it to a statement group or the default group, if none.
 * @param stmtName name to inspect
 * @return handle for statement
 */
public StatementMetricHandle addStatement(String stmtName)
{
    // determine group
    int countGroups = 1;
    int groupNumber = -1;
    for (Map.Entry<String, ConfigurationMetricsReporting.StmtGroupMetrics> entry : specification.getStatementGroups().entrySet())
    {
        List<Pair<StringPatternSet, Boolean>> patterns = entry.getValue().getPatterns();
        boolean result = StringPatternSetUtil.evaluate(entry.getValue().isDefaultInclude(), patterns, stmtName);

        if (result)
        {
            groupNumber = countGroups;
            break;
        }
        countGroups++;
    }

    // assign to default group if none other apply
    if (groupNumber == -1)
    {
        groupNumber = 0;
    }

    int index = groupMetrics[groupNumber].addStatementGetIndex(stmtName);

    statementGroups.put(stmtName, groupNumber);

    return new StatementMetricHandle(groupNumber, index);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:36,代码来源:StatementMetricRepository.java


注:本文中的com.espertech.esper.client.ConfigurationMetricsReporting.StmtGroupMetrics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。