コード例 #1
0
        /// <summary>
        /// Sends a pulse timing event to Raygun. The message is sent on a background thread.
        /// </summary>
        /// <param name="eventType">The type of event that occurred.</param>
        /// <param name="name">The name of the event resource such as the activity name or URL of a network call.</param>
        /// <param name="milliseconds">The duration of the event in milliseconds.</param>
        public void SendPulseTimingEvent(RaygunPulseEventType eventType, string name, long milliseconds)
        {
            lock (_batchLock)
            {
                try
                {
                    if (_activeBatch == null)
                    {
                        _activeBatch = new PulseEventBatch(this);
                    }

                    if (_activeBatch != null && !_activeBatch.IsLocked)
                    {
                        EnsurePulseSessionStarted();

                        PendingEvent pendingEvent = new PendingEvent(eventType, name, milliseconds, _sessionId);
                        _activeBatch.Add(pendingEvent);
                    }
                    else
                    {
                        ThreadPool.QueueUserWorkItem(c => SendPulseTimingEventCore(eventType, name, milliseconds));
                    }
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(string.Format("Error sending pulse timing event to Raygun: {0}", e.Message));
                }
            }
        }
コード例 #2
0
ファイル: PulseEventBatch.cs プロジェクト: pjhuck/raygun4net
 public void Add(PendingEvent pendingEvent)
 {
     _lastUpdate = DateTime.UtcNow;
     _pendingEvents.Add(pendingEvent);
     if (_pendingEvents.Count >= 50)
     {
         Done();
     }
 }
コード例 #3
0
        /// <summary>
        /// Sends a pulse timing event to Raygun. The message is sent on a background thread.
        /// </summary>
        /// <param name="eventType">The type of event that occurred.</param>
        /// <param name="name">The name of the event resource such as the view name or URL of a network call.</param>
        /// <param name="milliseconds">The duration of the event in milliseconds.</param>
        public void SendPulseTimingEvent(RaygunPulseEventType eventType, string name, long milliseconds)
        {
            if (_activeBatch == null)
            {
                _activeBatch = new PulseEventBatch(this);
            }

            if (_activeBatch != null && !_activeBatch.IsLocked)
            {
                if (_sessionId == null)
                {
                    SendPulseSessionEvent(RaygunPulseSessionEventType.SessionStart);
                }
                PendingEvent pendingEvent = new PendingEvent(eventType, name, milliseconds, _sessionId);
                _activeBatch.Add(pendingEvent);
            }
            else
            {
                ThreadPool.QueueUserWorkItem(c => SendPulseTimingEventCore(eventType, name, milliseconds));
            }
        }
コード例 #4
0
 public void Add(PendingEvent pendingEvent)
 {
     _lastUpdate = DateTime.UtcNow;
       _pendingEvents.Add (pendingEvent);
       if (_pendingEvents.Count >= 50) {
     Done ();
       }
 }
コード例 #5
0
        /// <summary>
        /// Sends a pulse timing event to Raygun. The message is sent on a background thread.
        /// </summary>
        /// <param name="eventType">The type of event that occurred.</param>
        /// <param name="name">The name of the event resource such as the view name or URL of a network call.</param>
        /// <param name="milliseconds">The duration of the event in milliseconds.</param>
        public void SendPulseTimingEvent(RaygunPulseEventType eventType, string name, long milliseconds)
        {
            if (_activeBatch == null) {
            _activeBatch = new PulseEventBatch (this);
              }

              if (_activeBatch != null && !_activeBatch.IsLocked) {
            if (_sessionId == null) {
              SendPulseSessionEvent (RaygunPulseSessionEventType.SessionStart);
            }
            PendingEvent pendingEvent = new PendingEvent (eventType, name, milliseconds, _sessionId);
            _activeBatch.Add (pendingEvent);
              } else {
            ThreadPool.QueueUserWorkItem (c => SendPulseTimingEventCore (eventType, name, milliseconds));
              }
        }