// Token: 0x06000E27 RID: 3623 RVA: 0x00035A14 File Offset: 0x00033C14
 internal void Update(NotificationLocation location, NotificationPayloadBase payload, Action <NotificationStatisticsValue, NotificationPayloadBase> doUpdate)
 {
     if (location != null && payload != null && doUpdate != null)
     {
         this.UpdateInternal(location, payload, doUpdate);
     }
 }
        // Token: 0x06000E2A RID: 3626 RVA: 0x00035AB4 File Offset: 0x00033CB4
        private void UpdateInternal(NotificationLocation location, NotificationPayloadBase payload, Action <NotificationStatisticsValue, NotificationPayloadBase> doUpdate)
        {
            NotificationStatisticsKey   key   = new NotificationStatisticsKey(location, payload.GetType(), payload.EventType == QueryNotificationType.Reload);
            NotificationStatisticsValue orAdd = this.data.GetOrAdd(key, new NotificationStatisticsValue());

            doUpdate(orAdd, payload);
        }
 // Token: 0x06000E6C RID: 3692 RVA: 0x00036644 File Offset: 0x00034844
 public void NotificationDropped(NotificationPayloadBase payload, NotificationState state)
 {
     if (NotificationStatisticsManager.IncomingNotificationStatisticsEnabled && NotificationStatisticsManager.IsStatisticable(payload))
     {
         this.incomingNotifications.Update(payload.Source, payload, delegate(NotificationStatisticsValue v, NotificationPayloadBase p)
         {
             NotificationStatisticsManager.UpdateNotificationDropped(v, p, state);
         });
         this.TriggerLogCheck();
     }
     if (NotificationStatisticsManager.OutgoingNotificationStatisticsEnabled)
     {
         RemoteNotificationPayload remoteNotificationPayload = payload as RemoteNotificationPayload;
         if (remoteNotificationPayload != null && remoteNotificationPayload.ChannelIds != null)
         {
             foreach (string channelId in remoteNotificationPayload.ChannelIds)
             {
                 this.outgoingNotifications.Update(new ChannelLocation(channelId), payload, delegate(NotificationStatisticsValue v, NotificationPayloadBase p)
                 {
                     NotificationStatisticsManager.UpdateNotificationDropped(v, p, state);
                 });
             }
         }
     }
 }
 // Token: 0x06000E64 RID: 3684 RVA: 0x00036301 File Offset: 0x00034501
 public void NotificationReceived(NotificationPayloadBase payload)
 {
     if (NotificationStatisticsManager.IncomingNotificationStatisticsEnabled && NotificationStatisticsManager.IsStatisticable(payload))
     {
         this.incomingNotifications.Update(payload.Source, payload, new Action <NotificationStatisticsValue, NotificationPayloadBase>(NotificationStatisticsManager.UpdateNotificationReceived));
         this.TriggerLogCheck();
     }
 }
 // Token: 0x06000E68 RID: 3688 RVA: 0x000363C8 File Offset: 0x000345C8
 public void NotificationDispatched(string channelId, NotificationPayloadBase payload)
 {
     if ((NotificationStatisticsManager.IncomingNotificationStatisticsEnabled || NotificationStatisticsManager.OutgoingNotificationStatisticsEnabled) && !string.IsNullOrEmpty(channelId) && NotificationStatisticsManager.IsStatisticable(payload))
     {
         if (NotificationStatisticsManager.IncomingNotificationStatisticsEnabled)
         {
             this.incomingNotifications.Update(payload.Source, payload, new Action <NotificationStatisticsValue, NotificationPayloadBase>(NotificationStatisticsManager.UpdateNotificationDispatched));
         }
         if (NotificationStatisticsManager.OutgoingNotificationStatisticsEnabled)
         {
             this.outgoingNotifications.Update(new ChannelLocation(channelId), payload, new Action <NotificationStatisticsValue, NotificationPayloadBase>(NotificationStatisticsManager.UpdateNotificationDispatched));
         }
         this.TriggerLogCheck();
     }
 }
 internal void AddGroupAssociationNotificationPayload(NotificationPayloadBase payload)
 {
     lock (this)
     {
         if (this.refreshAll)
         {
             NotificationStatisticsManager.Instance.NotificationCreated(payload);
             NotificationStatisticsManager.Instance.NotificationDropped(payload, NotificationState.CreatedOrReceived);
         }
         else
         {
             this.payloadQueue.Enqueue(payload);
             NotificationStatisticsManager.Instance.NotificationCreated(payload);
         }
     }
 }
Esempio n. 7
0
 internal void AddFolderContentChangePayload(StoreObjectId folderId, NotificationPayloadBase payload)
 {
     lock (this)
     {
         if (this.queue != null && this.queue.Count >= 40)
         {
             NotificationStatisticsManager.Instance.NotificationCreated(payload);
             NotificationStatisticsManager.Instance.NotificationDropped(payload, NotificationState.CreatedOrReceived);
             this.AddFolderRefreshPayload(folderId, payload.SubscriptionId);
         }
         else
         {
             this.queue.Enqueue(payload);
             NotificationStatisticsManager.Instance.NotificationCreated(payload);
         }
     }
 }
 // Token: 0x06000E6A RID: 3690 RVA: 0x000364D8 File Offset: 0x000346D8
 public void NotificationPushed(string destinationUrl, NotificationPayloadBase payload, DateTime pushTime)
 {
     if ((NotificationStatisticsManager.IncomingNotificationStatisticsEnabled || NotificationStatisticsManager.OutgoingNotificationStatisticsEnabled) && !string.IsNullOrEmpty(destinationUrl) && NotificationStatisticsManager.IsStatisticable(payload))
     {
         if (NotificationStatisticsManager.IncomingNotificationStatisticsEnabled)
         {
             this.incomingNotifications.Update(payload.Source, payload, delegate(NotificationStatisticsValue v, NotificationPayloadBase p)
             {
                 NotificationStatisticsManager.UpdateNotificationPushed(v, p, pushTime);
             });
         }
         if (NotificationStatisticsManager.OutgoingNotificationStatisticsEnabled)
         {
             this.outgoingNotifications.Update(new ServerLocation(destinationUrl), payload, delegate(NotificationStatisticsValue v, NotificationPayloadBase p)
             {
                 NotificationStatisticsManager.UpdateNotificationPushed(v, p, pushTime);
             });
         }
         this.TriggerLogCheck();
     }
 }
Esempio n. 9
0
 // Token: 0x0600103E RID: 4158 RVA: 0x0003E635 File Offset: 0x0003C835
 public PusherQueuePayload(NotificationPayloadBase payload, IEnumerable <string> channelIds)
 {
     this.Payload    = payload;
     this.ChannelIds = channelIds;
 }
 // Token: 0x06000E76 RID: 3702 RVA: 0x00036A3F File Offset: 0x00034C3F
 private static bool IsStatisticable(NotificationPayloadBase payload)
 {
     return(payload != null && payload.Source != null && NotificationStatisticsManager.StatisticablePayloadTypes.Contains(payload.GetType()));
 }
        // Token: 0x06000E75 RID: 3701 RVA: 0x000369B4 File Offset: 0x00034BB4
        private static void UpdateNotificationDropped(NotificationStatisticsValue value, NotificationPayloadBase payload, NotificationState state)
        {
            value.Dropped++;
            switch (state)
            {
            case NotificationState.CreatedOrReceived:
                if (payload.ReceivedTime != null)
                {
                    value.ReceivedAndDropped++;
                    return;
                }
                if (payload.CreatedTime != null)
                {
                    value.CreatedAndDropped++;
                    return;
                }
                break;

            case NotificationState.Queued:
                value.QueuedAndDropped++;
                return;

            case NotificationState.Dispatching:
                value.DispatchingAndDropped++;
                break;

            default:
                return;
            }
        }
 // Token: 0x06000E74 RID: 3700 RVA: 0x00036928 File Offset: 0x00034B28
 private static void UpdateNotificationPushed(NotificationStatisticsValue value, NotificationPayloadBase payload, DateTime pushTime)
 {
     value.Pushed++;
     if (payload.CreatedTime != null)
     {
         value.CreatedAndPushed.Add((pushTime - payload.CreatedTime.Value).TotalMilliseconds);
     }
     if (payload.QueuedTime != null)
     {
         value.QueuedAndPushed.Add((pushTime - payload.QueuedTime.Value).TotalMilliseconds);
     }
 }
        // Token: 0x06000E73 RID: 3699 RVA: 0x00036894 File Offset: 0x00034A94
        private static void UpdateNotificationDispatched(NotificationStatisticsValue value, NotificationPayloadBase payload)
        {
            value.Dispatched++;
            DateTime utcNow = DateTime.UtcNow;

            if (payload.CreatedTime != null)
            {
                value.CreatedAndDispatched.Add((utcNow - payload.CreatedTime.Value).TotalMilliseconds);
                return;
            }
            if (payload.ReceivedTime != null)
            {
                value.ReceivedAndDispatched.Add((utcNow - payload.ReceivedTime.Value).TotalMilliseconds);
            }
        }
 // Token: 0x06000E72 RID: 3698 RVA: 0x00036824 File Offset: 0x00034A24
 private static void UpdateNotificationQueued(NotificationStatisticsValue value, NotificationPayloadBase payload)
 {
     payload.QueuedTime = new DateTime?(DateTime.UtcNow);
     value.Queued++;
     if (payload.CreatedTime != null)
     {
         value.CreatedAndQueued.Add((payload.QueuedTime.Value - payload.CreatedTime.Value).TotalMilliseconds);
     }
 }
 // Token: 0x06000E71 RID: 3697 RVA: 0x00036804 File Offset: 0x00034A04
 private static void UpdateNotificationReceived(NotificationStatisticsValue value, NotificationPayloadBase payload)
 {
     payload.ReceivedTime = new DateTime?(DateTime.UtcNow);
     value.Received++;
 }