示例#1
0
        public List <KeyValuePair <int, List <PerformanceTaskNameFormatted> > > GetRowLevelPerformanceTaskList()
        {
            Dictionary <int, List <PerformanceTaskNameFormatted> > aRow = new Dictionary <int, List <PerformanceTaskNameFormatted> >();
            IDictionaryEnumerator enumerator = RowLevelPerformanceTasks.GetEnumerator();

            int counter = 0;

            while (enumerator.MoveNext())
            {
                PerformanceTaskInformation info1        = enumerator.Value as PerformanceTaskInformation;
                int workerRowCounter                    = (int)(info1.PerformanceTaskName.Split("|".ToCharArray())[1]).ParseInt();
                List <PerformanceTaskNameFormatted> lst = GetList(aRow, workerRowCounter);
                PerformanceTaskNameFormatted        tnf = new PerformanceTaskNameFormatted(workerRowCounter, counter, info1.PerformanceTaskName.Split("|".ToCharArray())[0], info1.Duration);
                lst.Add(tnf);
                if (aRow.ContainsKey(workerRowCounter))
                {
                    aRow[workerRowCounter] = lst;
                }
                else
                {
                    aRow.Add(workerRowCounter, lst);
                }
                counter++;
            }
            List <KeyValuePair <int, List <PerformanceTaskNameFormatted> > > aRowList = (from r in aRow
                                                                                         orderby r.Key
                                                                                         select r).ToList();

            return(aRowList);
        }
示例#2
0
 private void FormatJobPerformanceTasks(PerformanceTaskInformation info, StringBuilder sb)
 {
     if (info != null)
     {
         sb.AppendLine(string.Format("{0}:{1}", info.PerformanceTaskName.PadRight(_MaxJobPerformanceTaskNameLength, ' '), info.Duration));
     }
 }
示例#3
0
        public void Start(string jobId, RowPerformanceTaskNames PerformanceTaskName, int position)
        {
            if (!EyediaCoreConfigurationSection.CurrentConfig.Tracking.PerformanceCounter)
            {
                return;
            }

            if (position > _MaxPerformanceTasks)
            {
                return;
            }

            PerformanceTask            thePerformanceTask  = GetPerformanceTask(jobId);
            PerformanceTaskInformation PerformanceTaskInfo = GetPerformanceTaskSubPerformanceTask(thePerformanceTask, PerformanceTaskName, position);

            if (PerformanceTaskInfo == null)
            {
                PerformanceTaskInfo = new PerformanceTaskInformation(PerformanceTaskName, position);
                thePerformanceTask.RowLevelPerformanceTasks.Add(PerformanceTaskInfo.PerformanceTaskName, PerformanceTaskInfo);
                PerformanceTaskInfo.Start();
            }
            else
            {
                throw new Exception(string.Format("The PerformanceTask '{0}' has already been added", PerformanceTaskName));
            }
        }
示例#4
0
        public void Stop(string jobId, RowPerformanceTaskNames PerformanceTaskName, int position)
        {
            if (!EyediaCoreConfigurationSection.CurrentConfig.Tracking.PerformanceCounter)
            {
                return;
            }

            PerformanceTaskInformation PerformanceTaskInfo = GetPerformanceTaskSubPerformanceTask(GetPerformanceTask(jobId), PerformanceTaskName, position);

            if (PerformanceTaskInfo == null)
            {
                return;
            }

            PerformanceTaskInfo.Stop();
        }
示例#5
0
        public void Stop(string jobId, JobPerformanceTaskNames PerformanceTaskName)
        {
            if (!EyediaCoreConfigurationSection.CurrentConfig.Tracking.PerformanceCounter)
            {
                return;
            }

            PerformanceTask            thePerformanceTask  = GetPerformanceTask(jobId);
            PerformanceTaskInformation PerformanceTaskInfo = GetPerformanceTaskSubPerformanceTask(thePerformanceTask, PerformanceTaskName);

            if (PerformanceTaskInfo == null)
            {
                return;
            }

            PerformanceTaskInfo.Stop();
            if (PerformanceTaskName == JobPerformanceTaskNames.WorkerFinalize)
            {
                thePerformanceTask.Stop();
            }
        }