public void GenerateReports() { timeSeriesRepository.DeleteAll(); var map = new Dictionary<string, IBuildSparkline>(); foreach (var timeSeries in generateTimeSeries.Generate(userEventRepository.GetAll())) { timeSeriesRepository.Add(timeSeries); IBuildSparkline builder; if (!map.TryGetValue(timeSeries.Feature, out builder)) map.Add(timeSeries.Feature, builder = new SparklineBuilder()); builder.Add(timeSeries.Ticks + timeSeries.Starts); } foreach (var name in map.Keys) { var feature = featureRepository.Get(name); feature.Sparkline = map[name].Build(SPARKLINE_LENGTH_IN_DAYS); } context.SaveChanges(); }
public SparklineBuilderTest() { builder = new SparklineBuilder(); }