public ISegment StartMessageBrokerSegment(MethodCall methodCall, MessageBrokerDestinationType destinationType, MessageBrokerAction operation, string brokerVendorName, string destinationName)
        {
#if DEBUG
            Log.Finest("Skipping StartMessageBrokerSegment outside of a transaction");
#endif
            return(Segment.NoOpSegment);
        }
 public static string ResolveDestinationName(MessageBrokerDestinationType destinationType,
                                             string queueNameOrRoutingKey)
 {
     return((destinationType == MessageBrokerDestinationType.TempQueue ||
             destinationType == MessageBrokerDestinationType.TempTopic)
         ? null
         : queueNameOrRoutingKey);
 }
        public static MetricName GetMessageBroker(MessageBrokerDestinationType type, MessageBrokerAction action,
                                                  string vendor, string queueName)
        {
            var normalizedType = NormalizeMessageBrokerDestinationTypeForMetricName(type);

            return((queueName != null)
                ? MetricName.Create(MessageBrokerPrefix, vendor, normalizedType, action, MessageBrokerNamed, queueName)
                : MetricName.Create(MessageBrokerPrefix, vendor, normalizedType, action, MessageBrokerTemp));
        }
        private static MessageBrokerDestinationType NormalizeMessageBrokerDestinationTypeForMetricName(
            MessageBrokerDestinationType type)
        {
            if (type == MessageBrokerDestinationType.TempQueue)
            {
                return(MessageBrokerDestinationType.Queue);
            }

            if (type == MessageBrokerDestinationType.TempTopic)
            {
                return(MessageBrokerDestinationType.Topic);
            }

            return(type);
        }
Example #5
0
        public static TransactionName ForBrokerTransaction(MessageBrokerDestinationType type, string vendor, string destination)
        {
            var trxName = new StringBuilder(vendor)
                          .Append(MetricNames.PathSeparator)
                          .Append(EnumNameCache <MessageBrokerDestinationType> .GetName(type))
                          .Append(MetricNames.PathSeparator);

            if (string.IsNullOrWhiteSpace(destination))
            {
                trxName.Append(MetricNames.MessageBrokerTemp);
            }
            else
            {
                trxName.Append(MetricNames.MessageBrokerNamed)
                .Append(MetricNames.PathSeparator)
                .Append(destination);
            }

            return(new TransactionName(false, MetricNames.Message, trxName.ToString()));
        }
        public static ISegment StartMessageBrokerSegmentOrThrow(this IAgent agent, string vendor, MessageBrokerDestinationType destinationType, string destination, MessageBrokerAction action, MethodCall methodCall = null)
        {
            methodCall = methodCall ?? GetDefaultMethodCall(agent);
            var segment = agent.CurrentTransaction.StartMessageBrokerSegment(methodCall, destinationType, action, vendor, destination);

            if (segment == null)
            {
                throw new NullReferenceException("segment");
            }

            return(segment);
        }
 public void SetMessageBrokerTransactionName(MessageBrokerDestinationType destinationType, string brokerVendorName, string destination = null, TransactionNamePriority priority = TransactionNamePriority.Uri)
 {
 }
Example #8
0
 public ITransaction CreateTransaction(MessageBrokerDestinationType destinationType, string brokerVendorName, string destination, Action wrapperOnCreate)
 {
     return(CreateTransaction(TransactionName.ForBrokerTransaction(destinationType, brokerVendorName, destination), true, wrapperOnCreate ?? NoOpWrapperOnCreate));
 }