Exemple #1
0
 public void UpdateStart(DistributedStoreKey key, StoreKind storeKind, bool isPrimary)
 {
     lock (this.locker)
     {
         PerformanceEntry orAdd = this.GetOrAdd(storeKind, isPrimary);
         orAdd.RecordStart();
     }
 }
Exemple #2
0
 public void UpdateFinish(DistributedStoreKey key, StoreKind storeKind, bool isPrimary, RequestInfo req, long latencyInMs, Exception exception, bool isSkipped)
 {
     this.LogExecution(key, storeKind, isPrimary, req, latencyInMs, exception, isSkipped);
     lock (this.locker)
     {
         PerformanceEntry orAdd = this.GetOrAdd(storeKind, isPrimary);
         orAdd.RecordFinish(req, latencyInMs, exception, isSkipped);
     }
 }
Exemple #3
0
        private PerformanceEntry GetOrAdd(StoreKind storeKind, bool isPrimary)
        {
            PerformanceEntry performanceEntry = (storeKind == StoreKind.Clusdb) ? this.clusdbPerfEntry : this.dxstorePerfEntry;

            if (performanceEntry == null)
            {
                performanceEntry = new PerformanceEntry(storeKind, isPrimary);
                if (storeKind == StoreKind.Clusdb)
                {
                    this.clusdbPerfEntry = performanceEntry;
                }
                else
                {
                    this.dxstorePerfEntry = performanceEntry;
                }
            }
            return(performanceEntry);
        }