示例#1
0
        private static void PrintErrorDetailsForClientRequestIds(StreamWriter file)
        {
            foreach (var clientRequestInfo in ClientRequestIdHelper.clientRequestInfoList)
            {
                file.WriteLine("*************************************************** Error details of ClientRequestID: " + clientRequestInfo.Id + "***************************************************");

                var machingIssues = IssueHelper.GetMachingIssues(clientRequestInfo.ErrorContent.ToString());

                string clientRequestInfoStatement = "ObjectType: " + clientRequestInfo.ObjectType + ", ObjectId: " + clientRequestInfo.ObjectId +
                                                    ", ScenarioName: " + clientRequestInfo.ScenarioName + ", ReplicationProvider: " + Utility.GetReplicationProviderName(clientRequestInfo.ReplicationProviderId) +
                                                    ", Region: " + clientRequestInfo.Region + ", ResourceId: " + clientRequestInfo.ResourceId + ", StampName: " + clientRequestInfo.StampName;
                string subscriptionInfoStatement = "SubscriptionId: " + clientRequestInfo.SubscriptionInfo.Id + ", SubscriptionName: " + clientRequestInfo.SubscriptionInfo.SubscriptionName +
                                                   ", CustomerName: " + clientRequestInfo.SubscriptionInfo.CustomerName + ", BillingType: " + clientRequestInfo.SubscriptionInfo.BillingType +
                                                   ", OfferType: " + clientRequestInfo.SubscriptionInfo.OfferType;
                file.WriteLine("------- Details:");
                file.WriteLine(clientRequestInfoStatement);
                file.WriteLine(subscriptionInfoStatement);
                file.WriteLine();

                foreach (var issue in machingIssues)
                {
                    file.WriteLine("Issue: " + issue.Type + ", Bug: " + issue.BugId);
                }

                file.WriteLine();
                file.WriteLine();
                file.WriteLine("------- SRSOperationEvent:");
                file.WriteLine();
                foreach (var srsOperationEvent in clientRequestInfo.SRSOperationEvents)
                {
                    file.WriteLine(srsOperationEvent.PreciseTimeStamp + "   " + srsOperationEvent.ServiceActivityId + "     " + srsOperationEvent.State + "   " + srsOperationEvent.SRSOperationName + "   " + srsOperationEvent.ScenarioName);
                }
                file.WriteLine();
                file.WriteLine("------- SRSDataEvents:");
                file.WriteLine();
                file.WriteLine(clientRequestInfo.SRSErrorContent.ToString());
                file.WriteLine();

                if (clientRequestInfo.DRAContent.Length > 1)
                {
                    file.WriteLine();
                    file.WriteLine("------- DRAEvents:");
                    file.WriteLine();
                    file.WriteLine(clientRequestInfo.DRAContent.ToString());
                    file.WriteLine();
                }

                if (clientRequestInfo.CBEngineTraceMessagesErrorContent.Length > 1)
                {
                    file.WriteLine();
                    file.WriteLine("------- CBEngineTraceMessagesErrorContent:");
                    file.WriteLine();
                    file.WriteLine(clientRequestInfo.CBEngineTraceMessagesErrorContent.ToString());
                    file.WriteLine();
                }

                if (clientRequestInfo.RCMErrorContent.Length > 1)
                {
                    file.WriteLine();
                    file.WriteLine("------- RcmDiagnosticEvent:");
                    file.WriteLine();
                    file.WriteLine(clientRequestInfo.RCMErrorContent.ToString());
                    file.WriteLine();
                }

                if (clientRequestInfo.GatewayErrorContent.Length > 1)
                {
                    file.WriteLine();
                    file.WriteLine("------- GatewayDiagnosticEvent:");
                    file.WriteLine();
                    file.WriteLine(clientRequestInfo.GatewayErrorContent.ToString());
                    file.WriteLine();
                }
            }
        }
示例#2
0
        public bool IfAffectedByIssue(Issue issue)
        {
            var temp = this.SRSErrorContent.ToString() + this.DRAContent.ToString() + this.GatewayErrorContent.ToString() + this.RCMErrorContent.ToString() + this.CBEngineTraceMessagesErrorContent.ToString();

            return(this.issueList.Contains(issue) || IssueHelper.GetMachingIssues(temp).Contains(issue));
        }
示例#3
0
        static void Main(string[] args)
        {
            var watch = System.Diagnostics.Stopwatch.StartNew();

            currentForgroundColor = Console.ForegroundColor;

            var commandLineOptions      = new CommandLineOptions();
            var commandLineParsingState = CommandLine.Parser.Default.ParseArguments(args, commandLineOptions);

            if (commandLineParsingState)
            {
                Console.ForegroundColor = ConsoleColor.DarkCyan;

                if (!string.IsNullOrEmpty(commandLineOptions.InputFile))
                {
                    clientRequestIdsFilePath = commandLineOptions.InputFile;
                    Console.WriteLine("Reading ClientRequestIds from file: " + clientRequestIdsFilePath);
                    ClientRequestIdHelper.Initialize(clientRequestIdsFilePath);
                }

                if (!string.IsNullOrEmpty(commandLineOptions.InputList))
                {
                    Console.WriteLine("Reading ClientRequestIds from command line list: " + commandLineOptions.InputList);
                    ClientRequestIdHelper.Initialize(commandLineOptions.InputList.Split(',').ToList());
                }

                if (!string.IsNullOrEmpty(commandLineOptions.OutputFile))
                {
                    inMarketResultsFilePath = commandLineOptions.OutputFile;
                }
                else
                {
                    inMarketResultsFilePath = Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "InMarketResultsFilePath" + ".txt");
                }

                if (!string.IsNullOrEmpty(commandLineOptions.IssueMapFile))
                {
                    issueMapFilePath = commandLineOptions.IssueMapFile;
                    IssueHelper.Initialize(issueMapFilePath);
                }
                else
                {
                    issueMapFilePath = Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "IssueMapFilePath" + ".txt");
                }
                Console.WriteLine("Reading IssueMaps from file: " + issueMapFilePath);
                IssueHelper.Initialize(issueMapFilePath);

                needDRALogs    = commandLineOptions.WithDRALogs;
                useSyncCalls   = commandLineOptions.UseAsyncKustoCalls;
                displayByMonth = commandLineOptions.DisplayByMonth;
            }

            if (args.Length == 0 || args[0] == "/?" || (string.IsNullOrEmpty(commandLineOptions.InputFile) && string.IsNullOrEmpty(commandLineOptions.InputList)) || string.IsNullOrEmpty(inMarketResultsFilePath) || string.IsNullOrEmpty(issueMapFilePath))
            {
                Console.WriteLine(commandLineOptions.GetUsage());
                Console.ForegroundColor = currentForgroundColor;
                return;
            }

            if (genericProcess)
            {
                GenericAnalysis();
            }
            else if (displayByMonth)
            {
                DisplayByMonth();
            }
            else
            {
                SpecificAnalysis();
            }

            watch.Stop();
            var elapsedMs = watch.ElapsedMilliseconds;

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("Total time taken for analysis: " + Math.Ceiling((double)elapsedMs / 1000) + " seconds");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Analysis is complete and output is generated at: " + inMarketResultsFilePath);
            Console.ForegroundColor = currentForgroundColor;
        }