Esempio n. 1
0
 static FxCounters()
 {
     CacheTotal = new PerformanceCounterCategoryMetadata()
     {
         Name        = CacheConfiguration.Current.PerformanceCounters.CategoryNamePrefix + " - Totals",
         Description = PerformanceCounterCategoryMetadata.DefaultDescription
     };
 }
Esempio n. 2
0
 static FxCounters()
 {
     CacheTotal = new PerformanceCounterCategoryMetadata()
     {
         Name = CacheConfiguration.Current.PerformanceCounters.CategoryNamePrefix + " - Totals",
         Description = PerformanceCounterCategoryMetadata.DefaultDescription
     };
 }
Esempio n. 3
0
 private void InstrumentCacheHit(PerformanceCounterCategoryMetadata targetCategory, IMethodInvocation input)
 {
     if (CacheConfiguration.Current.PerformanceCounters.InstrumentCacheTotalCounts)
     {
         PerformanceCounter.IncrementCount(FxCounters.CacheTotal.CacheHits);
     }
     if (CacheConfiguration.Current.PerformanceCounters.InstrumentCacheTargetCounts)
     {
         PerformanceCounter.IncrementCount(targetCategory.CacheHits);
     }
 }
Esempio n. 4
0
        private static PerformanceCounterCategoryMetadata InstrumentCacheRequest(IMethodInvocation input)
        {
            PerformanceCounterCategoryMetadata category = null;

            if (CacheConfiguration.Current.PerformanceCounters.InstrumentCacheTotalCounts)
            {
                PerformanceCounter.IncrementCount(FxCounters.CacheTotal.CacheRequests);
            }
            if (CacheConfiguration.Current.PerformanceCounters.InstrumentCacheTargetCounts)
            {
                var cacheKey = CacheKeyBuilder.GetCacheKeyPrefix(input);
                category = new PerformanceCounterCategoryMetadata()
                {
                    Name        = CacheConfiguration.Current.PerformanceCounters.CategoryNamePrefix + " - " + cacheKey,
                    Description = PerformanceCounterCategoryMetadata.DefaultDescription
                };
                PerformanceCounter.IncrementCount(category.CacheRequests);
            }
            return(category);
        }