Exemplo n.º 1
0
        private static int PrintClientRequestIdsByIssuesBetweenMonths(StreamWriter file, Issue issue, DateTime start, DateTime end, bool print = true)
        {
            var ClientRequestIdInfosInMonth = ClientRequestIdHelper.clientRequestInfoList.Where(x => x.PreciseTimeStamp >= start && x.PreciseTimeStamp < end);

            if (ClientRequestIdInfosInMonth == null || ClientRequestIdInfosInMonth.ToList().Count < 1)
            {
                return(0);
            }

            int count = 0;

            var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue, ClientRequestIdInfosInMonth.ToList());

            count = affectedClientRequestIdInfos == null ? 0 : affectedClientRequestIdInfos.Count;
            if (print && affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
            {
                file.WriteLine("ClientRequestIDs between Date: '" + start.ToString("dddd, MMM dd yyyy") + "' and '" + end.ToString("dddd, MMM dd yyyy") + "' , Count: " + affectedClientRequestIdInfos.ToList().Count);
                file.WriteLine();
                foreach (var clientRequestInfo in affectedClientRequestIdInfos)
                {
                    string clientRequestInfoStatement = string.IsNullOrEmpty(clientRequestInfo.StampName) ? clientRequestInfo.Id : clientRequestInfo.StampName.Split('-').First() + "   " + clientRequestInfo.Id;
                    file.WriteLine(clientRequestInfoStatement);
                }
                file.WriteLine();
            }
            return(count);
        }
Exemplo n.º 2
0
        private static void PrintClientRequestIdsByIssues(StreamWriter file)
        {
            file.WriteLine("---------------------------------------------------------- ClientRequestIds for issues----------------------------------------------------------");
            file.WriteLine();
            foreach (var issue in IssueHelper.IssueList)
            {
                var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                if (affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
                {
                    file.WriteLine("*********ClientRequestIDs affected by issue: " + issue.Type + ", Bug: " + issue.BugId + ", Count: " + affectedClientRequestIdInfos.Count);
                    file.WriteLine();
                    foreach (var clientRequestInfo in affectedClientRequestIdInfos)
                    {
                        string clientRequestInfoStatement = string.IsNullOrEmpty(clientRequestInfo.StampName) ? clientRequestInfo.Id : clientRequestInfo.StampName.Split('-').First() + "   " + clientRequestInfo.Id;
                        file.WriteLine(clientRequestInfoStatement);
                    }
                    file.WriteLine();
                }
            }
            file.WriteLine("*********Uncategorised ClientRequestIDs: ");
            foreach (var clientRequestId in ClientRequestIdHelper.clientRequestInfoList)
            {
                var machingIssues = IssueHelper.GetMachingIssues(clientRequestId.ErrorContent.ToString());

                if (machingIssues == null || machingIssues.Count == 0)
                {
                    string clientRequestInfoStatement = string.IsNullOrEmpty(clientRequestId.StampName) ? clientRequestId.Id : clientRequestId.StampName.Split('-').First() + "   " + clientRequestId.Id;
                    file.WriteLine(clientRequestInfoStatement);
                }
            }
        }
Exemplo n.º 3
0
        private static void GenericAnalysis()
        {
            Parallel.ForEach(IssueHelper.IssueList, (issue) =>
            {
                QueryHelper.ProcessClientRequestInfoDetailsForIssue(issue);
            });

            using (StreamWriter file = File.CreateText(inMarketResultsFilePath))
            {
                file.WriteLine("---------------------------------------------------------- ClientRequestIds for issues----------------------------------------------------------");
                file.WriteLine();
                foreach (var issue in IssueHelper.IssueList)
                {
                    var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                    file.WriteLine("*********ClientRequestIDs affected by issue: " + issue.Type + ", Bug: " + issue.BugId + ", affected count:" + affectedClientRequestIdInfos.Count);
                    file.WriteLine();
                    foreach (var clientRequestInfo in affectedClientRequestIdInfos)
                    {
                        string clientRequestInfoStatement = clientRequestInfo.Id;
                        file.WriteLine(clientRequestInfoStatement);
                    }
                    file.WriteLine();
                }
            }
        }
Exemplo n.º 4
0
        private static void PrintClientRequestIdsByIssuesPerMonth(StreamWriter file)
        {
            DateTime currentTime       = DateTime.Now;
            DateTime currentMonthStart = new DateTime(currentTime.Year, currentTime.Month, 1);
            DateTime oneMonthsAgo      = currentMonthStart.AddMonths(-1);
            DateTime twoMonthsAgo      = currentMonthStart.AddMonths(-2);
            DateTime threeMonthsAgo    = currentMonthStart.AddMonths(-3);

            file.WriteLine("---------------------------------------------------------- ClientRequestIds for issues: monthly display----------------------------------------------------------");
            file.WriteLine();
            foreach (var issue in IssueHelper.IssueList)
            {
                var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                if (affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
                {
                    file.WriteLine("*********ClientRequestIDs affected by issue: " + issue.Type + ", Bug: " + issue.BugId + ", Count: " + affectedClientRequestIdInfos.Count);
                    file.WriteLine();
                }
                else
                {
                    continue;
                }

                PrintClientRequestIdsByIssuesBetweenMonths(file, issue, currentMonthStart, currentTime);
                PrintClientRequestIdsByIssuesBetweenMonths(file, issue, oneMonthsAgo, currentMonthStart);
                PrintClientRequestIdsByIssuesBetweenMonths(file, issue, twoMonthsAgo, oneMonthsAgo);
                PrintClientRequestIdsByIssuesBetweenMonths(file, issue, threeMonthsAgo, twoMonthsAgo);
                PrintClientRequestIdsByIssuesBetweenMonths(file, issue, DateTime.MinValue, threeMonthsAgo);
            }

            file.WriteLine("*********Uncategorised ClientRequestIDs: ");
            PrintUncategorizedClientRequestIdsByIssuesBetweenMonths(file, currentMonthStart, currentTime);
            PrintUncategorizedClientRequestIdsByIssuesBetweenMonths(file, oneMonthsAgo, currentMonthStart);
            PrintUncategorizedClientRequestIdsByIssuesBetweenMonths(file, twoMonthsAgo, oneMonthsAgo);
            PrintUncategorizedClientRequestIdsByIssuesBetweenMonths(file, threeMonthsAgo, twoMonthsAgo);
            PrintUncategorizedClientRequestIdsByIssuesBetweenMonths(file, DateTime.MinValue, threeMonthsAgo);
        }
Exemplo n.º 5
0
        private static void PrintClientRequestIdCountForIssuesByMonth(StreamWriter file)
        {
            DateTime currentTime       = DateTime.Now;
            DateTime currentMonthStart = new DateTime(currentTime.Year, currentTime.Month, 1);
            DateTime oneMonthsAgo      = currentMonthStart.AddMonths(-1);
            DateTime twoMonthsAgo      = currentMonthStart.AddMonths(-2);
            DateTime threeMonthsAgo    = currentMonthStart.AddMonths(-3);

            file.WriteLine("---------------------------------------------------------- ClientRequestId count for issues: monthly display----------------------------------------------------------");
            file.WriteLine();
            if (PrintClientRequestIdsBetweenMonths(file, currentMonthStart, currentTime, false) > 0)
            {
                file.WriteLine("*********Between Date: '" + currentMonthStart.ToString("dddd, MMM dd yyyy") + "' and '" + currentTime.ToString("dddd, MMM dd yyyy") + "'");
                file.WriteLine();
                foreach (var issue in IssueHelper.IssueList)
                {
                    var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                    if (affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
                    {
                        file.WriteLine("Issue: " + issue.Type + ", Bug: " + issue.BugId + ", Affected ClientRequestId Count: " + PrintClientRequestIdsByIssuesBetweenMonths(file, issue, currentMonthStart, currentTime, false));
                        file.WriteLine();
                    }
                    else
                    {
                        continue;
                    }
                }
            }

            if (PrintClientRequestIdsBetweenMonths(file, oneMonthsAgo, currentMonthStart, false) > 0)
            {
                file.WriteLine("*********Between Date: '" + oneMonthsAgo.ToString("dddd, MMM dd yyyy") + "' and '" + currentMonthStart.ToString("dddd, MMM dd yyyy") + "'");
                file.WriteLine();
                foreach (var issue in IssueHelper.IssueList)
                {
                    var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                    if (affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
                    {
                        file.WriteLine("Issue: " + issue.Type + ", Bug: " + issue.BugId + ", Affected ClientRequestId Count: " + PrintClientRequestIdsByIssuesBetweenMonths(file, issue, oneMonthsAgo, currentMonthStart, false));
                        file.WriteLine();
                    }
                    else
                    {
                        continue;
                    }
                }
            }

            if (PrintClientRequestIdsBetweenMonths(file, twoMonthsAgo, oneMonthsAgo, false) > 0)
            {
                file.WriteLine("*********Between Date: '" + twoMonthsAgo.ToString("dddd, MMM dd yyyy") + "' and '" + oneMonthsAgo.ToString("dddd, MMM dd yyyy") + "'");
                file.WriteLine();
                foreach (var issue in IssueHelper.IssueList)
                {
                    var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                    if (affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
                    {
                        file.WriteLine("Issue: " + issue.Type + ", Bug: " + issue.BugId + ", Affected ClientRequestId Count: " + PrintClientRequestIdsByIssuesBetweenMonths(file, issue, twoMonthsAgo, oneMonthsAgo, false));
                        file.WriteLine();
                    }
                    else
                    {
                        continue;
                    }
                }
            }

            if (PrintClientRequestIdsBetweenMonths(file, threeMonthsAgo, twoMonthsAgo, false) > 0)
            {
                file.WriteLine("*********Between Date: '" + threeMonthsAgo.ToString("dddd, MMM dd yyyy") + "' and '" + twoMonthsAgo.ToString("dddd, MMM dd yyyy") + "'");
                file.WriteLine();
                foreach (var issue in IssueHelper.IssueList)
                {
                    var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                    if (affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
                    {
                        file.WriteLine("Issue: " + issue.Type + ", Bug: " + issue.BugId + ", Affected ClientRequestId Count: " + PrintClientRequestIdsByIssuesBetweenMonths(file, issue, threeMonthsAgo, twoMonthsAgo, false));
                        file.WriteLine();
                    }
                    else
                    {
                        continue;
                    }
                }
            }

            if (PrintClientRequestIdsBetweenMonths(file, DateTime.MinValue, threeMonthsAgo, false) > 0)
            {
                file.WriteLine("*********Between Date: '" + DateTime.MinValue.ToString("dddd, MMM dd yyyy") + "' and '" + threeMonthsAgo.ToString("dddd, MMM dd yyyy") + "'");
                file.WriteLine();
                foreach (var issue in IssueHelper.IssueList)
                {
                    var affectedClientRequestIdInfos = ClientRequestIdHelper.GetAffectedClientRequestInfos(issue);
                    if (affectedClientRequestIdInfos != null && affectedClientRequestIdInfos.Count > 0)
                    {
                        file.WriteLine("Issue: " + issue.Type + ", Bug: " + issue.BugId + ", Affected ClientRequestId Count: " + PrintClientRequestIdsByIssuesBetweenMonths(file, issue, DateTime.MinValue, threeMonthsAgo, false));
                        file.WriteLine();
                    }
                    else
                    {
                        continue;
                    }
                }
            }
        }