public static CacheBaselines CalculateBaselines() { lock (Nrdo.LockObj) { var global = Nrdo.GlobalStats; var baseline = new CacheBaseline(getCostBaseline(global.CumulativeCost, c => c.CacheStats), Nrdo.TotalPulses, getImpactBaseline(global.TotalQueryTime, c => c.CacheStats), global.TotalQueries); var lastCycle = Nrdo.LastShrinkCycleStats; CacheBaseline cycleBaseline = null; if (lastCycle != null) { var thisCycle = global.Since(lastCycle); var cyclePulses = Nrdo.ShrinkCycleCounter; if (cyclePulses == 0) { cyclePulses = Nrdo.CacheCycleIntervalPulses; } cycleBaseline = new CacheBaseline(getCostBaseline(thisCycle.CumulativeCost, c => c.CacheStats.Since(c.LastShrinkCycleStats)), cyclePulses, getImpactBaseline(thisCycle.TotalQueryTime, c => c.CacheStats.Since(c.LastShrinkCycleStats)), thisCycle.TotalQueries); } return(new CacheBaselines(baseline, cycleBaseline)); } }
internal CacheBaselines(CacheBaseline baseline, CacheBaseline cycleBaseline) { this.baseline = baseline; this.cycleBaseline = cycleBaseline; }