Exemplo n.º 1
0
        /// <summary>
        /// 消息树构建 由插件调用 应用不需要关心这个方法
        /// </summary>
        /// <returns></returns>
        public static RemotionCallContext logRemoteCallClient()
        {
            IMessageTree tree      = Jasmine.GetManager().GetMessageTree(CallContextManager.MessageTreeId);
            String       messageId = tree.MessageId;

            if (messageId == null)
            {
                messageId      = Jasmine.GetProducer().CreateMessageId();
                tree.MessageId = messageId;
            }

            String childId = Jasmine.GetProducer().CreateMessageId();

            Jasmine.Event(JasmineConstants.TYPE_REMOTE_CALL, "", "0", childId);

            String root = tree.RootMessageId;

            if (root == null)
            {
                root = messageId;
            }

            return(new RemotionCallContext()
            {
                ChildMessageId = childId,
                ParentMessageId = messageId,
                RootMessageId = root
            });

            //ctx.AddProperty(CatContext.ROOT, root);
            //ctx.AddProperty(CatContext.PARENT, messageId);
            //ctx.AddProperty(CatContext.CHILD, childId);
        }
Exemplo n.º 2
0
        /// <summary>
        ///  消息树构建 由插件调用 应用不需要关心这个方法
        /// </summary>
        /// <param name="ctx"></param>
        public static void logRemoteCallServer(RemotionCallContext ctx)
        {
            IMessageTree tree           = Jasmine.GetManager().GetMessageTree(CallContextManager.MessageTreeId);
            String       childMessageId = ctx.ChildMessageId;
            String       rootId         = ctx.RootMessageId;
            String       parentId       = ctx.ParentMessageId;

            if (childMessageId != null)
            {
                tree.MessageId = childMessageId;
            }
            if (parentId != null)
            {
                tree.ParentMessageId = parentId;
            }
            if (rootId != null)
            {
                tree.RootMessageId = rootId;
            }

            String childId = Jasmine.GetProducer().CreateMessageId();

            Jasmine.Event(JasmineConstants.TYPE_REMOTE_CALL, "", "0", childId);
        }
Exemplo n.º 3
0
 public static ITransaction NewTransaction(string type, string name)
 {
     return(Jasmine.GetProducer().NewTransaction(type, name, CallContextManager.MessageTreeId));
 }
Exemplo n.º 4
0
 public static IEvent NewEvent(string type, string name)
 {
     return(Jasmine.GetProducer().NewEvent(type, name, CallContextManager.MessageTreeId));
 }
Exemplo n.º 5
0
 private static void LogMetricInternal(string name, string status, string keyValuePairs = null)
 {
     Jasmine.GetProducer().LogMetric(name, status, keyValuePairs, CallContextManager.MessageTreeId);
 }
Exemplo n.º 6
0
 private static void Heartbeat(string type, string name, string status = "0", string nameValuePairs = null)
 {
     Jasmine.GetProducer().LogHeartbeat(type, name, status, nameValuePairs, CallContextManager.MessageTreeId);
 }
Exemplo n.º 7
0
 public static void Event(string type, string name, string status = "0", string nameValuePairs = null)
 {
     Jasmine.GetProducer().LogEvent(type, name, status, nameValuePairs, CallContextManager.MessageTreeId);
 }
Exemplo n.º 8
0
 public static void Error(Exception ex)
 {
     Jasmine.GetProducer().LogError(ex, CallContextManager.MessageTreeId);
 }