Пример #1
0
 public MemoryCacheWithMetrics(MemoryCacheOptions <TCacheInstance> options, IMetrics metrics,
                               AllowedMetrics <MemoryCacheWithMetrics <TCacheInstance> > settings) : base(options)
 {
     this.Helper = new MetricsHelper <TCacheInstance>(metrics, settings.AllowedCacheMetrics);
     if (settings.AllowedCacheMetrics.HasFlag(CacheMetrics.HitRatio))
     {
         this.Helper.MetricsObj.RegisterOneMinuteRate(
             Metrics.Memory.HitRatio,
             Metrics.Memory.HitCount,
             Metrics.Memory.TotalCount,
             this.Helper.MetricsTags);
     }
 }