コード例 #1
0
        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);
        }
コード例 #2
0
 public static string ResolveDestinationName(MessageBrokerDestinationType destinationType,
                                             string queueNameOrRoutingKey)
 {
     return((destinationType == MessageBrokerDestinationType.TempQueue ||
             destinationType == MessageBrokerDestinationType.TempTopic)
         ? null
         : queueNameOrRoutingKey);
 }
コード例 #3
0
        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));
        }
コード例 #4
0
        private static MessageBrokerDestinationType NormalizeMessageBrokerDestinationTypeForMetricName(
            MessageBrokerDestinationType type)
        {
            if (type == MessageBrokerDestinationType.TempQueue)
            {
                return(MessageBrokerDestinationType.Queue);
            }

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

            return(type);
        }
コード例 #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()));
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public void SetMessageBrokerTransactionName(MessageBrokerDestinationType destinationType, string brokerVendorName, string destination = null, TransactionNamePriority priority = TransactionNamePriority.Uri)
 {
 }
コード例 #8
0
 public ITransaction CreateTransaction(MessageBrokerDestinationType destinationType, string brokerVendorName, string destination, Action wrapperOnCreate)
 {
     return(CreateTransaction(TransactionName.ForBrokerTransaction(destinationType, brokerVendorName, destination), true, wrapperOnCreate ?? NoOpWrapperOnCreate));
 }