本文整理汇总了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);
}
示例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>();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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>();
}
示例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);
}