/// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            Thread.MemoryBarrier();

            var numMessages     = _messageProcessedCounter;
            var snapshotLatency = _lastLatency;
            var peakMax         = _maxLatency;
            var peakMin         = _minLatency;

            Thread.MemoryBarrier();

            var message = MonitoringMessageFactory.Create <ProcessingVelocityMessage>(MonitorableProcessor);

            message.NumberMessagesProcessed = numMessages;
            message.Velocity       = (float)numMessages / Frequence;
            message.Latency        = (float)Math.Round(snapshotLatency / 1000, 5);
            message.PeakMaxLatency = (float)Math.Round(peakMax / 1000, 5);
            message.PeakMinLatency = (float)Math.Round(peakMin / 1000, 5);

            Logger.Info(String.Format("NumberMessagesProcessed {0}", numMessages));
            Logger.Info(String.Format("Latency {0}", snapshotLatency));
            Logger.Info(String.Format("PeakMaxLatency {0}", peakMax));
            Logger.Info(String.Format("PeakMinLatency {0}", peakMin));
            Logger.Info(String.Format("Velocity {0}", message.Velocity));

            ReSet();

            MonitoringSender.Send(message);
        }
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var message = MonitoringMessageFactory.Create <QueueLoadMessage>(MonitorableProcessor);

            message.TotalMessages = MonitorableProcessor.MonitorableInputGateway.Count();

            MonitoringSender.Send(message);
        }
Exemple #3
0
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var message = MonitoringMessageFactory.Create <HeartBeatMessage>(MonitorableProcessor);

            message.Status = MonitorableProcessor.ProcessorStatus;

            MonitoringSender.Send(message);
        }
Exemple #4
0
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var message = MonitoringMessageFactory.Create <HealthMessage>(MonitorableProcessor);

            message.MemoryWorkingSet = Environment.WorkingSet / 1024;

            MonitoringSender.Send(message);
        }
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var messageTypesMessage = MonitoringMessageFactory.Create <OutputTypesMessage>(MonitorableProcessor);

            messageTypesMessage.MessageTypes = _messageTypes.Values.ToList();

            MonitoringSender.Send(messageTypesMessage);
        }
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var message = MonitoringMessageFactory.Create <TransferVelocityMessage>(MonitorableProcessor);

            message.Input.Total = (float)_inputSize / 1024;
            message.Input.Speed = message.Input.Total / Frequence;

            message.Output.Total = (float)_outputSize / 1024;
            message.Output.Speed = message.Output.Total / Frequence;

            MonitoringSender.Send(message);
            ReSet();
        }
Exemple #7
0
        /// <summary>
        /// Messages the received.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="Mrwesb.Core.Monitoring.MonitorEventArgs"/> instance containing the event data.</param>
        private void MessageReceived(object sender, MonitorEventArgs args)
        {
            if (Status != MonitorStatus.Started)
            {
                return;
            }

            CountMessages++;
            if (CountMessages % 10 == 0)
            {
                MonitoringSender.Send(new MonitoringMessageFake {
                    Count = CountMessages
                });
            }
        }
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            if (_monitorableRouter == null)
            {
                return;
            }

            var types = _monitorableRouter.GetMessageTypes();

            UpdateBag(types);

            var messageTypes = MonitoringMessageFactory.Create <MessageTypesMessage>(MonitorableProcessor);

            messageTypes.MessageTypes = _bagTypes.Values.ToList();

            MonitoringSender.Send(messageTypes);
        }