예제 #1
0
        private void SetAllFieldDataField(PureProfilingEntity v, Dictionary <string, string> data)
        {
            //"executeType", "executeResult", "parameters" , "Http Verb", "IsAjax", "请求类型", "客户端IP", "dbCount", "dbDuration"
            v.ExecuteType = GetDataField(data, "executeType");
            var executeResult = GetDataField(data, "executeResult");

            if (!string.IsNullOrEmpty(executeResult))
            {
                v.ExecuteResult = Convert.ToInt64(executeResult);
            }
            v.Parameters  = GetDataField(data, "parameters");
            v.HttpVerb    = GetDataField(data, "Http Verb");
            v.IsAjax      = GetDataField(data, "IsAjax");
            v.RequestType = GetDataField(data, "请求类型");
            v.ClientIp    = GetDataField(data, "客户端IP");
            var dbCount = GetDataField(data, "dbCount");

            if (!string.IsNullOrEmpty(dbCount))
            {
                v.DbCount = Convert.ToInt64(dbCount);
            }
            var dbDuration = GetDataField(data, "dbDuration");

            if (!string.IsNullOrEmpty(dbDuration))
            {
                v.DbDuration = Convert.ToInt64(dbDuration);
            }
        }
예제 #2
0
        private PureProfilingEntity FormatTimingSession(ITimingSession session)
        {
            PureProfilingEntity v = new PureProfilingEntity();

            v.SEQ         = Pure.Data.IdGenerateManager.Snowflake.NextId().ToString(); // Guid.NewGuid().ToString();
            v.MachineName = session.MachineName;
            v.Type        = session.Type;
            v.SessionId   = session.Id.ToString();
            v.Id          = session.Id.ToString();
            v.ParentId    = session.ParentId != null?session.ParentId.ToString() : "";

            v.Name                 = session.Name;
            v.Started              = session.Started;
            v.StartMilliseconds    = session.StartMilliseconds;
            v.DurationMilliseconds = session.DurationMilliseconds;
            v.Tags                 = session.Tags != null?session.Tags.ToString() : "";

            v.Sort = session.Sort;

            //var sb = new StringBuilder();
            //sb.Append("{");
            //AppendDataFields(sb, session.Data);
            //sb.Append("}");

            //v.Data = sb.ToString();

            SetAllFieldDataField(v, session.Data);

            return(v);
        }
예제 #3
0
        private PureProfilingEntity FormatTiming(ITimingSession session, ITiming timing)
        {
            PureProfilingEntity v = new PureProfilingEntity();

            v.SEQ         = Pure.Data.IdGenerateManager.Snowflake.NextId().ToString(); // Guid.NewGuid().ToString();
            v.MachineName = session.MachineName;
            v.SessionId   = session.Id.ToString();
            v.Type        = timing.Type;
            v.Id          = timing.Id.ToString();
            v.ParentId    = timing.ParentId != null?timing.ParentId.ToString() : "";

            v.Name                 = timing.Name;
            v.Started              = timing.Started;
            v.StartMilliseconds    = timing.StartMilliseconds;
            v.DurationMilliseconds = timing.DurationMilliseconds;
            v.Tags                 = timing.Tags != null?timing.Tags.ToString() : "";

            v.Sort = timing.Sort;



            //var sb = new StringBuilder();
            //sb.Append("{");
            //AppendDataFields(sb, timing.Data);
            //sb.Append("}");

            //v.Data = sb.ToString();

            SetAllFieldDataField(v, timing.Data);

            if (timing.Tags != null && timing.Tags.Contains(ProfilingSession.FailOnErrorMark))
            {
                v.ErrorCount = 1;
            }
            else
            {
                v.ErrorCount = 0;
            }


            return(v);
        }
        private PureProfilingEntity Format(ITimingSession session)
        {
            PureProfilingEntity v = new PureProfilingEntity();

            v.SEQ                  = Pure.Data.IdGenerateManager.Snowflake.NextId().ToString(); // Guid.NewGuid().ToString();
            v.MachineName          = session.MachineName;
            v.Type                 = session.Type;
            v.Id                   = session.Id.ToString();
            v.ParentId             = session.ParentId.ToString();
            v.Name                 = session.Name;
            v.Started              = session.Started;
            v.StartMilliseconds    = session.StartMilliseconds;
            v.DurationMilliseconds = session.DurationMilliseconds;
            v.Tags                 = session.Tags;
            v.Sort                 = session.Sort;
            v.MachineName          = session.MachineName;
            v.MachineName          = session.MachineName;
            v.MachineName          = session.MachineName;
            v.MachineName          = session.MachineName;
            v.MachineName          = session.MachineName;

            return(v);
        }