Exemplo n.º 1
0
        private void MakeAggregates(string name)
        {
            var safeContext = parent.CloneWithoutAggregate();

            var intReduced = aggregateInt
                             .LocalTimeReduce <
                Reporting.IntReportingReducer, Reporting.ReportingRecord <Int64>, Reporting.ReportingRecord <Int64>, Reporting.ReportingRecord <Int64>,
                string, Pair <string, Reporting.ReportingRecord <Int64> >, T>(x => x.First, x => x.Second, () => new Reporting.IntReportingReducer(),
                                                                              name + ".IRILR", null, null)
                             .LocalTimeCombine <
                Reporting.IntReportingReducer, Reporting.ReportingRecord <Int64>, Reporting.ReportingRecord <Int64>, Reporting.ReportingRecord <Int64>,
                string, T>(() => new Reporting.IntReportingReducer(), name + ".IRILC", x => x.First.GetHashCode());

            var intReporter = new Reporting.AggregateStatisticsStage <Int64, T>(safeContext, name + ".IRI");

            //intReporter.Factory = (i => new Reporting.AggregateStatisticsVertex<Int64, T>(i, intReporter));
            intReporter.ConnectTo(intReduced);
            parent.intAggregator.ConnectTo(intReduced);

            var doubleReduced = aggregateDouble
                                .LocalTimeReduce <
                Reporting.DoubleReportingReducer, Reporting.ReportingRecord <double>, Reporting.ReportingRecord <double>, Reporting.ReportingRecord <double>,
                string, Pair <string, Reporting.ReportingRecord <double> >, T>(x => x.First, x => x.Second, () => new Reporting.DoubleReportingReducer(),
                                                                               name + ".IRDLR", null, null)
                                .LocalTimeCombine <
                Reporting.DoubleReportingReducer, Reporting.ReportingRecord <double>, Reporting.ReportingRecord <double>, Reporting.ReportingRecord <double>,
                string, T>(() => new Reporting.DoubleReportingReducer(), name + ".IRDLC", x => x.First.GetHashCode());

            var doubleReporter = new Reporting.AggregateStatisticsStage <double, T>(safeContext, name + ".IRD");

            //doubleReporter.Factory = (i => new Reporting.AggregateStatisticsVertex<double, T>(i, doubleReporter));
            doubleReporter.ConnectTo(doubleReduced);
            parent.doubleAggregator.ConnectTo(doubleReduced);
        }
Exemplo n.º 2
0
        void MakeAggregates()
        {
            var safeContext = this.CloneWithoutAggregate();

            intAggregator = new Reporting.AggregateStatisticsStage <Int64, T>(safeContext, scope + ".IRI");
            //intAggregator.Factory = (i => new Reporting.AggregateStatisticsVertex<Int64, T>(i, intAggregator));
            downstreamConnector.ConnectIntAggregator(intAggregator.Output);

            doubleAggregator = new Reporting.AggregateStatisticsStage <double, T>(safeContext, scope + ".IRD");
            //doubleAggregator.Factory = (i => new Reporting.AggregateStatisticsVertex<double, T>(i, doubleAggregator));
            downstreamConnector.ConnectDoubleAggregator(doubleAggregator.Output);
        }
Exemplo n.º 3
0
 public InternalTimeContext(TimeContextManager m, string s, Reporting.IReportingConnector <T> downstreamConn, bool hasAgg)
 {
     scope               = s;
     manager             = m;
     downstreamConnector = downstreamConn;
     if (hasAgg)
     {
         MakeAggregates();
     }
     else
     {
         intAggregator    = null;
         doubleAggregator = null;
     }
 }