コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var message = MonitoringMessageFactory.Create <QueueLoadMessage>(MonitorableProcessor);

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

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

            message.Status = MonitorableProcessor.ProcessorStatus;

            MonitoringSender.Send(message);
        }
コード例 #4
0
ファイル: HealthSampler.cs プロジェクト: yashhotline/HermEsb
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var message = MonitoringMessageFactory.Create <HealthMessage>(MonitorableProcessor);

            message.MemoryWorkingSet = Environment.WorkingSet / 1024;

            MonitoringSender.Send(message);
        }
コード例 #5
0
        /// <summary>
        /// Samplers the task.
        /// </summary>
        protected override void SamplerTask()
        {
            var messageTypesMessage = MonitoringMessageFactory.Create <OutputTypesMessage>(MonitorableProcessor);

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

            MonitoringSender.Send(messageTypesMessage);
        }
コード例 #6
0
        /// <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();
        }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
        /// <summary>
        /// Sends the queues info.
        /// </summary>
        private void SendQueuesInfo()
        {
            var message = MonitoringMessageFactory.Create <InputQueueMessage>(_controller.Processor);

            message.InputControlQueue            = _controller.ReceiverEndPoint.Uri.OriginalString;
            message.InputControlQueueTransport   = _controller.ReceiverEndPoint.Transport;
            message.InputProcessorQueue          = _controller.Processor.ReceiverEndPoint.Uri.OriginalString;
            message.InputProcessorQueueTransport = _controller.Processor.ReceiverEndPoint.Transport;

            Send(message);

            if (_controller.Processor is ServiceProcessor)
            {
                var messageInputQueues = MonitoringMessageFactory.Create <MessageTypesMessage>(_controller.Processor);
                var messageTypes       = (_controller.Processor as ServiceProcessor).GetMessageTypes();
                messageInputQueues.MessageTypes = messageTypes.AsParallel().Select(
                    x => new MessageType {
                    FullName = x.FullName
                }).ToList();

                Send(messageInputQueues);
            }
        }