private void SetProcessor(TCategory property, MetricProcessor <TCategory, TProperty> processor) { if (processors.ContainsKey(property)) { throw new NotSupportedException("Cannot set twice processor for category: " + property); } processors[property] = processor; }
internal MetricProcessor <TCategory, TProperty> .ResultBatch MergeResults( MetricProcessor <TCategory, TProperty> .ResultBatch b1, MetricProcessor <TCategory, TProperty> .ResultBatch b2) { if (!b1.IsFrozen || !b2.IsFrozen) { throw new ArgumentException("Merged batches has to be frozen"); } var batch = CreateBatch(); foreach (var indicator in processors.Keys) { var processor = processors[indicator]; var mergedResult = processor.Merge(b1.GetResult(indicator), b2.GetResult(indicator)); batch.Insert(indicator, mergedResult); } batch.Freeze(); return(batch); }