Exemplo n.º 1
0
        public void SetMetricsReportingInterval(String stmtGroupName, long newInterval)
        {
            if (stmtGroupName == null)
            {
                _metricExecStmtGroupDefault.Interval = newInterval;
                return;
            }

            MetricExecStatement exec = _statementGroupExecutions.Get(stmtGroupName);

            if (exec == null)
            {
                throw new ArgumentException("Statement group by name '" + stmtGroupName + "' could not be found");
            }
            exec.Interval = newInterval;
        }
Exemplo n.º 2
0
        public void SetContext(EPRuntime runtime, EPServicesContext servicesContext)
        {
            var metricsExecutionContext = new MetricExecutionContext(servicesContext, runtime, _stmtMetricRepository);

            // create all engine and statement executions
            _metricExecEngine           = new MetricExecEngine(this, _engineUri, _schedule, _specification.EngineInterval);
            _metricExecStmtGroupDefault = new MetricExecStatement(this, _schedule, _specification.StatementInterval, 0);

            int countGroups = 1;

            foreach (KeyValuePair <String, ConfigurationMetricsReporting.StmtGroupMetrics> entry in _specification.StatementGroups)
            {
                var config           = entry.Value;
                var metricsExecution = new MetricExecStatement(this, _schedule, config.Interval, countGroups);
                _statementGroupExecutions.Put(entry.Key, metricsExecution);
                countGroups++;
            }

            // last assign this volatile variable so the time event processing may schedule callbacks
            _executionContext = metricsExecutionContext;
        }