public Task Handle(EndpointMetadataReport message, IMessageHandlerContext context)
        {
            var instanceId = EndpointInstanceId.From(context.MessageHeaders);

            queueLengthProvider.Process(instanceId, message);

            return(TaskEx.Completed);
        }
        public Task Handle(MetricReport message, IMessageHandlerContext context)
        {
            var endpointInstanceId = EndpointInstanceId.From(context.MessageHeaders);

            if (legacyEndpoints.TryAdd(endpointInstanceId.InstanceId))
            {
                Logger.Warn($"Legacy queue length report received from {endpointInstanceId.InstanceName} instance of {endpointInstanceId.EndpointName}");
            }

            return(TaskEx.Completed);
        }
        public string ClassifyFailure(ClassifiableMessageDetails failureDetails)
        {
            if (failureDetails.ProcessingAttempt == null)
            {
                return(null);
            }

            var instanceId = EndpointInstanceId.From(failureDetails.ProcessingAttempt.Headers);

            return(instanceId?.EndpointName);
        }
        public Task Handle(TaggedLongValueOccurrence message, IMessageHandlerContext context)
        {
            var instanceId  = EndpointInstanceId.From(context.MessageHeaders);
            var messageType = context.MessageHeaders[MetricHeaders.MetricType];

            if (messageType == QueueLengthMessageType)
            {
                queueLengthProvider.Process(instanceId, message);
            }

            return(TaskEx.Completed);
        }
        public Task Handle(TaggedLongValueOccurrence message, IMessageHandlerContext context)
        {
            var instanceId  = EndpointInstanceId.From(context.MessageHeaders);
            var messageType = new EndpointMessageType(instanceId.EndpointName, message.TagValue);

            var metricType = context.MessageHeaders[MetricHeaders.MetricType];

            switch (metricType)
            {
            case ProcessingTimeMessageType:
                processingTimeStore.Store(message.Entries, instanceId, messageType);
                break;

            case CriticalTimeMessageType:
                criticalTimeStore.Store(message.Entries, instanceId, messageType);
                break;
            }

            return(TaskEx.Completed);
        }