예제 #1
0
파일: eXTask.cs 프로젝트: eXtensoft/xf-web
        public eXTask(List <TypedItem> list)
        {
            this.Items   = list;
            this.Tds     = DateTime.Now;
            CreatedAt    = Tds.ToString(XFConstants.DateTimeFormat);
            this.Message = "Task";
            if (list.ContainsKey <Guid>(XFConstants.EventWriter.MessageId))
            {
                MessageId = list.Get <Guid>(XFConstants.EventWriter.MessageId);
            }
            if (list.ContainsKey <string>(XFConstants.Context.ZONE))
            {
                Zone = list.Get <string>(XFConstants.Context.ZONE);
            }
            if (list.ContainsKey <string>(XFConstants.Context.Application))
            {
                ApplicationKey = list.Get <string>(XFConstants.Context.Application);
            }
            if (list.ContainsKey <string>(XFConstants.EventWriter.Message))
            {
                Message = list.Get <string>(XFConstants.EventWriter.Message);
            }
            if (list.ContainsKey <DateTimeOffset>("metric.event.start"))
            {
                Start = list.Get <DateTimeOffset>("metric.event.start");
            }
            if (list.ContainsKey <double>("metric.event.elapsed"))
            {
                Elapsed = list.Get <double>("metric.event.elapsed");
            }
            if (list.ContainsKey <string>(XFConstants.TaskWriter.TaskId))
            {
                TaskId = list.Get <string>(XFConstants.TaskWriter.TaskId);
            }
            if (list.ContainsKey <string>(XFConstants.TaskWriter.TaskMasterId))
            {
                MasterId = list.Get <string>(XFConstants.TaskWriter.TaskMasterId);
            }
            if (list.ContainsKey <string>(XFConstants.TaskWriter.TaskType))
            {
                TaskType = list.Get <string>(XFConstants.TaskWriter.TaskType);
            }
            if (list.ContainsKey <string>(XFConstants.TaskWriter.TaskName))
            {
                TaskName = list.Get <string>(XFConstants.TaskWriter.TaskName);
            }
            if (list.ContainsKey <string>("event.outcome"))
            {
                TaskOutcome = list.Get <string>("event.outcome");
            }

            Year      = Tds.Year;
            Month     = Tds.Month;
            Day       = Tds.Day;
            DayOfWeek = Tds.DayOfWeek.ToString();
            Hour      = Tds.Hour;
            Minute    = Tds.Minute;
        }
예제 #2
0
 public eXStatus(List <TypedItem> list)
 {
     this.Items = list;
     this.Tds   = DateTime.Now;
     Year       = Tds.Year;
     Month      = Tds.Month;
     Day        = Tds.Day;
     DayOfWeek  = Tds.DayOfWeek.ToString();
     Hour       = Tds.Hour;
     Minute     = Tds.Minute;
     CreatedAt  = Tds.ToString(XFConstants.DateTimeFormat);
     if (list.ContainsKey <Guid>(XFConstants.EventWriter.MessageId))
     {
         MessageId = list.Get <Guid>(XFConstants.EventWriter.MessageId);
     }
     if (list.ContainsKey <string>(XFConstants.EventWriter.Message))
     {
         Message = list.Get <string>(XFConstants.EventWriter.Message);
     }
     if (list.ContainsKey <string>(XFConstants.Context.ZONE))
     {
         Zone = list.Get <string>(XFConstants.Context.ZONE);
     }
     if (list.ContainsKey <string>(XFConstants.Context.Application))
     {
         ApplicationKey = list.Get <string>(XFConstants.Context.Application);
     }
     if (list.ContainsKey <string>(XFConstants.Status.Description))
     {
         Description = list.Get <string>(XFConstants.Status.Description);
     }
     if (list.ContainsKey <string>(XFConstants.Status.ModelId))
     {
         ModelId = list.Get <string>(XFConstants.Status.ModelId);
     }
     if (list.ContainsKey <string>(XFConstants.Status.ModelName))
     {
         ModelName = list.Get <string>(XFConstants.Status.ModelName);
     }
     if (list.ContainsKey <string>(XFConstants.Status.ModelType))
     {
         ModelType = list.Get <string>(XFConstants.Status.ModelType);
     }
     if (list.ContainsKey <string>(XFConstants.Status.StatusText))
     {
         Status = list.Get <string>(XFConstants.Status.StatusText);
     }
 }
예제 #3
0
        public eXError(List <TypedItem> list)
        {
            this.Items = list;
            this.Tds   = DateTime.Now;
            CreatedAt  = Tds.ToString(XFConstants.DateTimeFormat);
            if (list.ContainsKey <Guid>(XFConstants.EventWriter.MessageId))
            {
                MessageId = list.Get <Guid>(XFConstants.EventWriter.MessageId);
            }
            if (list.ContainsKey <string>(XFConstants.EventWriter.Message))
            {
                Message = list.Get <string>(XFConstants.EventWriter.Message);
            }
            if (list.ContainsKey <string>(XFConstants.Context.ZONE))
            {
                Zone = list.Get <string>(XFConstants.Context.ZONE);
            }
            if (list.ContainsKey <string>(XFConstants.Context.Application))
            {
                ApplicationKey = list.Get <string>(XFConstants.Context.Application);
            }
            if (list.ContainsKey <string>(XFConstants.EventWriter.ErrorSeverity))
            {
                Severity = list.Get <string>(XFConstants.EventWriter.ErrorSeverity).ToString();
            }
            if (list.ContainsKey <string>(XFConstants.EventWriter.Category))
            {
                Category = list.Get <string>(XFConstants.EventWriter.Category).ToString();
            }
            if (list.ContainsKey <string>(XFConstants.Message.Verb))
            {
                Verb = list.Get <string>(XFConstants.Message.Verb).ToString();
            }
            if (list.ContainsKey <string>(XFConstants.Context.Model))
            {
                Model = list.Get <string>(XFConstants.Context.Model).ToString();
            }
            if (list.ContainsKey <string>(XFConstants.EventWriter.StackTrace))
            {
                StackTrace = list.Get <string>(XFConstants.EventWriter.StackTrace);
            }

            if (list.ContainsKey <string>(XFConstants.Context.UICULTURE))
            {
                UICulture = list.Get <string>(XFConstants.Context.UICULTURE);
            }
            if (list.ContainsKey <DateTime>(XFConstants.Context.RequestBegin))
            {
                RequestBegin = list.Get <DateTime>(XFConstants.Context.RequestBegin);
            }
            if (list.ContainsKey <DateTime>(XFConstants.Metrics.Scope.DataRequestService.Begin))
            {
                DataRequestBegin = list.Get <DateTime>(XFConstants.Metrics.Scope.DataRequestService.Begin);
            }
            if (list.ContainsKey <DateTimeOffset>(XFConstants.Metrics.Scope.DataRequestService.End))
            {
                DataRequestEnd = list.Get <DateTime>(XFConstants.Metrics.Scope.DataRequestService.End);
            }
            if (list.ContainsKey <DateTimeOffset>(XFConstants.Context.RequestEnd))
            {
                RequestEnd = list.Get <DateTime>(XFConstants.Context.RequestEnd);
            }
            if (list.ContainsKey <string>(XFConstants.Metrics.DbType))
            {
                Dbtype = list.Get <string>(XFConstants.Metrics.DbType);
                if (Dbtype.Equals("sqlserver", StringComparison.OrdinalIgnoreCase))
                {
                    if (list.ContainsKey <string>(XFConstants.Metrics.Database.Datasource))
                    {
                        string   datastore = list.Get <string>(XFConstants.Metrics.Database.Datasource);
                        string[] cn        = datastore.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                        if (cn != null && cn.Length == 2)
                        {
                            string[] server = cn[0].Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                            if (server != null && server.Length == 2)
                            {
                                Server = server[1];
                            }
                            string[] catalog = cn[1].Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                            if (catalog != null && catalog.Length == 2)
                            {
                                Database = catalog[1];
                            }
                        }
                    }
                }
            }
            if (list.ContainsKey <string>(XFConstants.Metrics.Database.Command))
            {
                var found = list.FirstOrDefault(x => x.Key.Equals(XFConstants.Metrics.Database.Command));
                Command     = found.Value.ToString();
                CommandType = found.Scope;
            }
            if (list.ContainsKey <DateTime>(XFConstants.Metrics.Scope.Command.Begin))
            {
                DataAccessBegin = list.Get <DateTime>(XFConstants.Metrics.Scope.Command.Begin);
                if (list.ContainsKey <DateTime>(XFConstants.Metrics.Scope.Command.End))
                {
                    DataAccessEnd = list.Get <DateTime>(XFConstants.Metrics.Scope.Command.End);
                }
            }
            if (list.ContainsKey <string>("request.uri"))
            {
                Uri = list.Get <string>("request.uri");
            }
            if (list.ContainsKey <Guid>("app.context.instance"))
            {
                AppContextInstance = list.Get <Guid>("app.context.instance").ToString();
            }
            if (list.ContainsKey <string>("app.context.instance"))
            {
                AppContextInstance = list.Get <string>("app.context.instance");
            }
            if (list.ContainsKey <string>(XFConstants.Context.Ticket))
            {
                TicketId = list.Get <string>(XFConstants.Context.Ticket);
            }


            Year      = Tds.Year;
            Month     = Tds.Month;
            Day       = Tds.Day;
            DayOfWeek = Tds.DayOfWeek.ToString();
            Hour      = Tds.Hour;
            Minute    = Tds.Minute;
        }
예제 #4
0
        public eXEvent(List <TypedItem> list)
        {
            this.Items = list;
            this.Tds   = DateTime.Now;
            CreatedAt  = Tds.ToString(XFConstants.DateTimeFormat);
            if (list.ContainsKey <Guid>(XFConstants.EventWriter.MessageId))
            {
                MessageId = list.Get <Guid>(XFConstants.EventWriter.MessageId);
            }
            if (list.ContainsKey <string>("sessionid"))
            {
                SessionId = list.Get <string>("sessionid");
            }
            if (list.ContainsKey <string>(XFConstants.Context.PrimaryScope))
            {
                PrimaryScope = list.Get <string>(XFConstants.Context.PrimaryScope);
            }
            if (list.ContainsKey <string>(XFConstants.Context.SecondaryScope))
            {
                SecondaryScope = list.Get <string>(XFConstants.Context.SecondaryScope);
            }
            if (list.ContainsKey <string>(XFConstants.EventWriter.Message))
            {
                Message = list.Get <string>(XFConstants.EventWriter.Message);
            }
            if (list.ContainsKey <string>(XFConstants.Context.ZONE))
            {
                Zone = list.Get <string>(XFConstants.Context.ZONE);
            }
            if (list.ContainsKey <string>(XFConstants.Context.Application))
            {
                ApplicationKey = list.Get <string>(XFConstants.Context.Application);
            }
            if (list.ContainsKey <string>("xf.bigdata.usecase"))
            {
                UseCase = list.Get <string>("xf.bigdata.usecase");
            }
            if (list.ContainsKey <DateTimeOffset>("metric.event.start"))
            {
                Start = list.Get <DateTimeOffset>("metric.event.start");
            }
            if (list.ContainsKey <double>("metric.event.elapsed"))
            {
                Elapsed = list.Get <double>("metric.event.elapsed");
            }
            if (list.ContainsKey <int>("usecase.resultset.count"))
            {
                ResultsetCount = list.Get <int>("usecase.resultset.count");
            }
            if (list.ContainsKey <string>("request.uri"))
            {
                Uri = list.Get <string>("request.uri");
            }

            if (list.ContainsKey <string>("event.outcome"))
            {
                EventOutcome = list.Get <string>("event.outcome");
            }
            if (list.ContainsKey <Guid>("app.context.instance"))
            {
                AppContextInstance = list.Get <Guid>("app.context.instance").ToString();
            }
            if (list.ContainsKey <string>("app.context.instance"))
            {
                AppContextInstance = list.Get <string>("app.context.instance").ToString();
            }

            Year      = Tds.Year;
            Month     = Tds.Month;
            Day       = Tds.Day;
            DayOfWeek = Tds.DayOfWeek.ToString();
            Hour      = Tds.Hour;
            Minute    = Tds.Minute;
        }
예제 #5
0
파일: eXKpi.cs 프로젝트: eXtensoft/xf-2.0
        public eXKpi(List <TypedItem> list)
        {
            this.Items = list;
            this.Tds   = DateTime.Now;
            CreatedAt  = Tds.ToString(XFConstants.DateTimeFormat);
            if (list.ContainsKey <Guid>(XFConstants.EventWriter.MessageId))
            {
                MessageId = list.Get <Guid>(XFConstants.EventWriter.MessageId);
            }
            if (list.ContainsKey <string>("key"))
            {
                Key = list.Get <string>("key");
            }
            if (list.ContainsKey <string>("group"))
            {
                Group = list.Get <string>("group");
            }
            if (list.ContainsKey <string>("scopeid"))
            {
                ScopeId = list.Get <string>("scopeid");
            }
            if (list.ContainsKey <string>("sessionid"))
            {
                SessionId = list.Get <string>("sessionid");
            }
            if (list.ContainsKey <string>("activity"))
            {
                Activity = list.Get <string>("activity");
            }
            if (list.ContainsKey <string>(XFConstants.EventWriter.Message))
            {
                Message = list.Get <string>(XFConstants.EventWriter.Message);
            }
            if (list.ContainsKey <string>(XFConstants.Context.ZONE))
            {
                Zone = list.Get <string>(XFConstants.Context.ZONE);
            }
            if (list.ContainsKey <string>(XFConstants.Context.Application))
            {
                ApplicationKey = list.Get <string>(XFConstants.Context.Application);
            }
            if (list.ContainsKey <string>("src"))
            {
                Src = list.Get <string>("src");
            }
            if (list.ContainsKey <string>("name"))
            {
                Key = list.Get <string>("name");
            }
            if (list.ContainsKey <string>("data"))
            {
                string   s = list.Get <string>("data");
                string[] t = s.Split(new char[] { ';' });
                Data = new List <string>(t);
            }

            if (list.ContainsKey <int>("elapsed"))
            {
                Elapsed = list.Get <int>("elapsed");
            }


            if (list.ContainsKey <string>(XFConstants.EventWriter.Message))
            {
                Message = list.Get <string>(XFConstants.EventWriter.Message);
            }
            if (list.ContainsKey <string>(XFConstants.Context.ZONE))
            {
                Zone = list.Get <string>(XFConstants.Context.ZONE);
            }
            if (list.ContainsKey <string>(XFConstants.Context.Application))
            {
                ApplicationKey = list.Get <string>(XFConstants.Context.Application);
            }


            Year      = Tds.Year;
            Month     = Tds.Month;
            Day       = Tds.Day;
            DayOfWeek = Tds.DayOfWeek.ToString();
            Hour      = Tds.Hour;
            Minute    = Tds.Minute;
        }
예제 #6
0
파일: eXAlert.cs 프로젝트: eXtensoft/xf-web
        public eXAlert(List <TypedItem> list)
        {
            this.Items = list;
            this.Tds   = DateTime.Now;
            CreatedAt  = Tds.ToString(XFConstants.DateTimeFormat);
            string status      = "none";
            string disposition = String.Format("{0}:{1}", status, DateTime.Now.ToString(XFConstants.DateTimeFormat));

            Dispositions  = new string[] { disposition };
            CurrentStatus = status;
            if (list.ContainsKey <Guid>(XFConstants.EventWriter.MessageId))
            {
                MessageId = list.Get <Guid>(XFConstants.EventWriter.MessageId);
            }
            if (list.ContainsKey <string>(XFConstants.Alert.Message))
            {
                Message = list.Get <string>(XFConstants.Alert.Message);
            }
            if (list.ContainsKey <string>(XFConstants.Context.ZONE))
            {
                Zone = list.Get <string>(XFConstants.Context.ZONE);
            }
            if (list.ContainsKey <string>(XFConstants.Context.Application))
            {
                ApplicationKey = list.Get <string>(XFConstants.Context.Application);
            }
            if (list.ContainsKey <string>("event.alert.title"))
            {
                Title = list.Get <string>("event.alert.title");
            }
            if (list.ContainsKey <string>("event.alert.categories"))
            {
                string s = list.Get <string>("event.alert.categories");
                if (!String.IsNullOrEmpty(s))
                {
                    string[]      t     = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    List <string> items = new List <string>();
                    foreach (var item in t)
                    {
                        items.Add(item.Trim());
                    }
                    Categories = items.ToArray();
                }
            }

            if (list.ContainsKey <string>("event.alert.importance"))
            {
                Importance = list.Get <string>("event.alert.importance");
            }
            if (list.ContainsKey <string>("event.alert.urgency"))
            {
                Urgency = list.Get <string>("event.alert.urgency");
            }
            if (list.ContainsKey <string>("event.alert.namedtarget"))
            {
                NamedRecipient = list.Get <string>("event.alert.namedtarget");
            }

            if (list.ContainsKey <string>("event.alert.stacktrace"))
            {
                StackTrace = list.Get <string>("event.alert.stacktrace");
            }

            if (list.ContainsKey <string>("event.alert.error"))
            {
                Error = list.Get <string>("event.alert.error");
            }
            if (list.ContainsKey <string>("event.alert.source"))
            {
                Source = list.Get <string>("event.alert.source");
            }
            if (list.ContainsKey <string>("event.alert.topic"))
            {
                Topic = list.Get <string>("event.alert.topic");
            }

            if (list.ContainsKey <string>("event.alert.data"))
            {
                Data = list.Get <string>("event.alert.data");
            }

            if (list.ContainsKey("event.alert.targets"))
            {
                string s = list.Get <string>("event.alert.targets");
                if (!String.IsNullOrWhiteSpace(s))
                {
                    string[]      t     = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    List <string> items = new List <string>();
                    foreach (var item in t)
                    {
                        items.Add(item.Trim());
                    }
                    Audiences = items.ToArray();
                }
            }

            Year      = Tds.Year;
            Month     = Tds.Month;
            Day       = Tds.Day;
            DayOfWeek = Tds.DayOfWeek.ToString();
            Hour      = Tds.Hour;
            Minute    = Tds.Minute;
        }