Пример #1
0
        private void PersistStatementIndexStatistics(NormalizedStatementIndexStatistics newStatistics)
        {
            var repository = repositories.GetNormalizedStatementIndexStatisticsRepository();
            var uniqueKey  = new NormalizedStatementIndexStatisticsUniqueKey()
            {
                DatabaseID            = newStatistics.DatabaseID,
                Date                  = newStatistics.Date,
                IndexID               = newStatistics.IndexID,
                NormalizedStatementID = newStatistics.NormalizedStatementID
            };
            var oldStatistics = repository.GetByUniqueKey(uniqueKey);

            if (oldStatistics == null)
            {
                repository.Create(newStatistics);
            }
            else
            {
                NormalizedStatementIndexStatisticsMergeUtility.ApplySample(oldStatistics, newStatistics);
                repository.Update(oldStatistics);
            }
        }
Пример #2
0
 protected override void ApplySampling(NormalizedStatementIndexStatistics cumulativeData, NormalizedStatementIndexStatistics newSample)
 {
     NormalizedStatementIndexStatisticsMergeUtility.ApplySample(cumulativeData, newSample);
 }