예제 #1
0
 /// <summary>
 /// Raises the <see cref="E:WriteLockReleased"/> event.
 /// </summary>
 /// <param name="e">The <see cref="TelemetryEventArgs"/> instance containing the event data.</param>
 protected void OnWriteLockReleased(TelemetryEventArgs e)
 {
     if (WriteLockReleased != null)
     {
         WriteLockReleased(this, e);
     }
 }
예제 #2
0
 /// <summary>
 /// Raises the <see cref="E:LockReleased"/> event.
 /// </summary>
 /// <param name="e">The <see cref="TelemetryEventArgs"/> instance containing the event data.</param>
 protected void OnLockReleased(TelemetryEventArgs e)
 {
     if (LockReleased != null)
     {
         LockReleased(this, e);
     }
 }
예제 #3
0
        /// <summary>
        /// Finishes tracking performance of a call sequence.
        /// </summary>
        /// <param name="timeLockRequest">The time the lock was requested.</param>
        /// <param name="timeLockAcquire">The time the lock was acquired.</param>
        private void FinishTrackingPerformance(long timeLockRequest, long timeLockAcquire)
        {
            var eventArgs = new TelemetryEventArgs();

            eventArgs.Id          = _id;
            eventArgs.RequestTime = timeLockRequest;
            eventArgs.AcquireTime = timeLockAcquire;
            eventArgs.ReleaseTime = PerformanceObserver.MicroTime;
            eventArgs.StackTrace  = new StackTrace();

            OnLockReleased(eventArgs);
        }
예제 #4
0
 /// <summary>
 /// Called when a lock is released.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="TelemetryEventArgs"/> instance containing the event data.</param>
 public void OnLockReleased(object sender, TelemetryEventArgs e)
 {
     lock (this) {
         _telemetryEvents.AddLast(e);
     }
 }