Beispiel #1
0
        public void CreateReport()
        {
            UpdateProgress2("Creating primary_log_flush page");
            Logger.LogMessage("Creating primary_log_flush page");

            primary_log_flush.CreatePages();
            UpdateProgress2("Creating secondary_log_flush page");
            Logger.LogMessage("Creating secondary_log_flush page");
            secondary_log_flush.CreatePages();
            UpdateProgress2("Creating primary_secondary page");
            Logger.LogMessage("Creating primary_secondary page");
            primary_secondary.CreatePages();
            UpdateProgress2("Creating logCapturePrimary page");
            Logger.LogMessage("Creating logCapturePrimary page");
            logCapturePrimary.CreatePages();

            UpdateProgress2("Creating syncReceiveNetLatency page");
            Logger.LogMessage("Creating syncReceiveNetLatency page");
            syncReceiveNetLatency.CreatePages();

            UpdateProgress2("Creating DBFlowControlPage page");
            Logger.LogMessage("Creating DBFlowControlPage page");
            dbFlowControl.CreatePages();


            UpdateProgress2("Creating Summary page");
            Logger.LogMessage("Creating Summary page");

            Pages.AGLatencySummaryPage sum = new Pages.AGLatencySummaryPage(Latency.NetworkLatency.replicaId, "Summary", "");
            sum.SavePageToDisk();

            //Now save other pages,this way, the summayr page will be the first page
            foreach (PageTemplate.PageObject pg in Controller.pageObjs)
            {
                pg.page.SavePageToDisk();
            }
        }
Beispiel #2
0
        public void CreateReport()
        {
            /*
             *
             * UpdateProgress2("Creating Transaction Processing page");
             * Logger.LogMessage("Creating Transaction Processing page");
             * tranProcessing.CreatePages();
             *
             * UpdateProgress2("Creating primary_log_flush page");
             * Logger.LogMessage("Creating primary_log_flush page");
             * primary_log_flush.CreatePages();
             *
             * UpdateProgress2("Creating Transaction Remote Commit page");
             * Logger.LogMessage("Creating Transaction Remote Commit page");
             * tranRemoteCommit.CreatePages();
             *
             *
             *
             * UpdateProgress2("Creating secondary_log_flush page");
             * Logger.LogMessage("Creating secondary_log_flush page");
             * secondary_log_flush.CreatePages();
             */
            /*
             * Don't get network latency becuase it is not accurate
             * UpdateProgress2("Creating primary_secondary page");
             * Logger.LogMessage("Creating primary_secondary page");
             * primary_secondary.CreatePages();
             */

            /*
             * UpdateProgress2("Creating logCapturePrimary page");
             * Logger.LogMessage("Creating logCapturePrimary page");
             * logCapturePrimary.CreatePages();
             */
            /*
             * * Don't get network latency becuase it is not accurate
             * UpdateProgress2("Creating syncReceiveNetLatency page");
             * Logger.LogMessage("Creating syncReceiveNetLatency page");
             * syncReceiveNetLatency.CreatePages();
             *
             *
             * UpdateProgress2("Creating DBFlowControlPage page");
             * Logger.LogMessage("Creating DBFlowControlPage page");
             * dbFlowControl.CreatePages();
             */
            /*************************/
            UpdateProgress2("Creating hadr_log_block_send_complete page");
            Logger.LogMessage("Creating hadr_log_block_send_complete page");
            var list = hadr_log_block_send_complete.GetPerfPointData();

            Pages.ProcessingTimePageTemplate sendPage = new Pages.ProcessingTimePageTemplate
                                                            (list, "Send", "Primary Statistics", "Primary-Send", 11);
            sendPage.GetData();
            sendPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Primary_Send);
            PageTemplate.PageObject pageObj = new PageTemplate.PageObject("SEND", sendPage, PageTemplate.PageObjState.SaveToDiskOnly, 11);
            Controller.pageObjs.Add(pageObj);

            /*************************/


            /*************************/
            UpdateProgress2("Creating hadr_db_commit_mgr_harden page");
            Logger.LogMessage("Creating hadr_db_commit_mgr_harden page");
            var list2 = hadr_db_commit_mgr_harden.GetPerfPointData();

            Pages.ProcessingTimePageTemplate mgrPage = new Pages.ProcessingTimePageTemplate
                                                           (list2, "Remote Harden", "Primary Statistics", "Primary-RemoteHarden", 13);
            mgrPage.GetData();

            mgrPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Primary_RemoteHarden);
            mgrPage.page.pageSummary     = "<br>Here is the xevent of <b>hadr_db_commit_mgr_harden:</b><br><br><img src='../images/hadr_db_commit_mgr_harden.png' height='300'/>";


            PageTemplate.PageObject pageObj2 = new PageTemplate.PageObject("RemoteHarden", mgrPage, PageTemplate.PageObjState.SaveToDiskOnly, 13);
            Controller.pageObjs.Add(pageObj2);


            //Time to get uniqueu database IDs for latter use

            // Controller.databaseIds = hadr_db_commit_mgr_harden.GetDatabaseIDs(hadr_db_commit_mgr_harden.eventLatency.eventDB.SQLiteDBFile);

            /*************************/


            /*************************/
            UpdateProgress2("Creating log_flush_complete page");
            Logger.LogMessage("Creating log_flush_complete page");
            log_flush_complete.preprocessingQueries = new List <string>();
            if (Controller.primaryInfo != null && Controller.primaryInfo.database_id != null &&
                Controller.primaryInfo.database_id.Count > 0)
            //if (Controller.databaseIds != null && Controller.databaseIds.Count > 0)
            {
                string dbstr            = " (" + String.Join(", ", Controller.primaryInfo.database_id.ToArray()) + ")";
                string exclude_NonAG_db = "DELETE FROM log_flush_complete WHERE database_id NOT IN " + dbstr;

                log_flush_complete.preprocessingQueries.Add(exclude_NonAG_db);
            }

            //for log flush, need to *1000=microseconds
            string multiply1000 = "UPDATE log_flush_complete SET duration=duration*1000";

            log_flush_complete.preprocessingQueries.Add(multiply1000);

            var list4 = log_flush_complete.GetPerfPointData();

            Pages.ProcessingTimePageTemplate flushPage = new Pages.ProcessingTimePageTemplate
                                                             (list4, "Local Flush", "Primary Statistics", "Primary-LocalFlush", 14);
            flushPage.GetData();

            flushPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Primary_LocalFlush);

            PageTemplate.PageObject pageObj4 = new PageTemplate.PageObject("LocalFlush", flushPage, PageTemplate.PageObjState.SaveToDiskOnly, 14);
            Controller.pageObjs.Add(pageObj4);

            /*************************/



            /*************************/
            UpdateProgress2("Creating recovery_unit_harden_log_timestamps page");
            Logger.LogMessage("Creating recovery_unit_harden_log_timestamps page");

            if (Controller.primaryInfo != null && Controller.primaryInfo.database_id != null &&
                Controller.primaryInfo.database_id.Count > 0)
            //if (Controller.databaseIds != null && Controller.databaseIds.Count > 0)
            {
                string dbstr            = " (" + String.Join(", ", Controller.primaryInfo.database_id.ToArray()) + ")";
                string exclude_NonAG_db = "DELETE FROM recovery_unit_harden_log_timestamps WHERE database_id NOT IN " + dbstr;
                recovery_unit_harden_log_timestamps.preprocessingQueries = new List <string>();
                recovery_unit_harden_log_timestamps.preprocessingQueries.Add(exclude_NonAG_db);
            }

            var list3 = recovery_unit_harden_log_timestamps.GetPerfPointData();

            Pages.ProcessingTimePageTemplate commitPage = new Pages.ProcessingTimePageTemplate
                                                              (list3, "Commit", "Primary Statistics", "Primary-Commit", 15);
            commitPage.GetData();


            commitPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Primary_Commit);
            commitPage.page.pageSummary     = "<br>Here is the xevent of <b>recovery_unit_harden_log_timestamps:</b><br><br><img src='../images/recovery_unit_harden_log_timestamps.png' height='300'/>";

            PageTemplate.PageObject pageObj3 = new PageTemplate.PageObject("Commit", commitPage, PageTemplate.PageObjState.SaveToDiskOnly, 15);
            Controller.pageObjs.Add(pageObj3);

            /*************************/



            /*************************/
            UpdateProgress2("Creating hadr_log_block_compression page");
            Logger.LogMessage("Creating hadr_log_block_compression page");
            if (Controller.primaryInfo != null && Controller.primaryInfo.database_id != null &&
                Controller.primaryInfo.database_id.Count > 0)
            //if (Controller.databaseIds != null && Controller.databaseIds.Count > 0)
            {
                string dbstr            = " (" + String.Join(", ", Controller.primaryInfo.database_id.ToArray()) + ")";
                string exclude_NonAG_db = "DELETE FROM hadr_log_block_compression WHERE database_id NOT IN " + dbstr;
                hadr_log_block_compression.preprocessingQueries = new List <string>();
                hadr_log_block_compression.preprocessingQueries.Add(exclude_NonAG_db);
            }

            var list5 = hadr_log_block_compression.GetPerfPointData();

            Pages.ProcessingTimePageTemplate compressionPage = new Pages.ProcessingTimePageTemplate
                                                                   (list5, "Compression", "Primary Statistics", "Primary-Compression", 10);
            compressionPage.GetData();

            compressionPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Primary_Compression);

            PageTemplate.PageObject pageObj5 = new PageTemplate.PageObject("primaryCompression", compressionPage, PageTemplate.PageObjState.SaveToDiskOnly, 10);
            Controller.pageObjs.Add(pageObj5);

            /*************************/

            /*************************/
            UpdateProgress2("Creating hadr_receive_harden_lsn_message page");
            Logger.LogMessage("Creating hadr_receive_harden_lsn_message page");



            var list7 = hadr_receive_harden_lsn_message.GetPerfPointData();

            Pages.ProcessingTimePageTemplate recPage = new Pages.ProcessingTimePageTemplate
                                                           (list7, "Receive", "Primary Statistics", "Primary-Receive", 12);
            recPage.GetData();

            recPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Primary_Receive);
            PageTemplate.PageObject pageObj7 = new PageTemplate.PageObject("PrimaryReceive", recPage, PageTemplate.PageObjState.SaveToDiskOnly, 12);
            Controller.pageObjs.Add(pageObj7);

            /*************************/

            /*************************/
            UpdateProgress2("Creating hadr_database_flow_control_action page");
            Logger.LogMessage("Creating hadr_database_flow_control_action page");

            hadr_database_flow_control_action.preprocessingQueries.Add("DELETE from hadr_database_flow_control_action where control_action='Set'");

            var list74 = hadr_database_flow_control_action.GetPerfPointData();

            Pages.ProcessingTimePageTemplate flowPage = new Pages.ProcessingTimePageTemplate
                                                            (list74, "Flow Control", "Primary Statistics", "Primary-FlowControl", 19);//last section, so set it to 19
            flowPage.GetData();


            flowPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Primary_FlowControl);
            PageTemplate.PageObject pageObj74 = new PageTemplate.PageObject("PrimaryFlowControl", flowPage, PageTemplate.PageObjState.SaveToDiskOnly, 19);
            Controller.pageObjs.Add(pageObj74);

            /*************************/



            /*************************/
            UpdateProgress2("Creating hadr_log_block_decompression page");
            Logger.LogMessage("Creating hadr_log_block_decompression page");

            if (Controller.secondaryInfo != null && Controller.secondaryInfo.database_id != null &&
                Controller.secondaryInfo.database_id.Count > 0)

            //if (Controller.databaseIds != null && Controller.databaseIds.Count > 0)
            {
                string dbstr            = " (" + String.Join(", ", Controller.secondaryInfo.database_id.ToArray()) + ")";
                string exclude_NonAG_db = "DELETE FROM hadr_log_block_decompression WHERE database_id NOT IN " + dbstr;
                hadr_log_block_decompression.preprocessingQueries = new List <string>();
                hadr_log_block_decompression.preprocessingQueries.Add(exclude_NonAG_db);
            }

            var list6 = hadr_log_block_decompression.GetPerfPointData();

            Pages.ProcessingTimePageTemplate decompressionPage = new Pages.ProcessingTimePageTemplate
                                                                     (list6, "Decompression", "Secondary Statistics", "Secondary-Decompression", 22);
            decompressionPage.GetData();

            decompressionPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Secondary_Decompression);

            PageTemplate.PageObject pageObj6 = new PageTemplate.PageObject("SecondaryDescompression", decompressionPage, PageTemplate.PageObjState.SaveToDiskOnly, 22);
            Controller.pageObjs.Add(pageObj6);

            /*************************/



            /*************************/
            UpdateProgress2("Creating hadr_transport_receive_log_block_message page");
            Logger.LogMessage("Creating hadr_transport_receive_log_block_message page");



            var list8 = hadr_transport_receive_log_block_message.GetPerfPointData();

            Pages.ProcessingTimePageTemplate secReceivePage = new Pages.ProcessingTimePageTemplate
                                                                  (list8, "Receive", "Secondary Statistics", "Secondary-Receive", 21);
            secReceivePage.GetData();

            secReceivePage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Secondary_Receive);
            PageTemplate.PageObject pageObj8 = new PageTemplate.PageObject("SecondaryReceive", secReceivePage, PageTemplate.PageObjState.SaveToDiskOnly, 21);
            Controller.pageObjs.Add(pageObj8);

            /*************************/



            /*************************/
            UpdateProgress2("Creating secondary log_flush_complete page");
            Logger.LogMessage("Creating secondary log_flush_complete page");
            log_flush_complete_secondary.preprocessingQueries = new List <string>();
            if (Controller.secondaryInfo != null && Controller.secondaryInfo.database_id != null &&
                Controller.secondaryInfo.database_id.Count > 0)

            {
                string dbstr            = " (" + String.Join(", ", Controller.secondaryInfo.database_id.ToArray()) + ")";
                string exclude_NonAG_db = "DELETE FROM log_flush_complete WHERE database_id NOT IN " + dbstr;

                log_flush_complete_secondary.preprocessingQueries.Add(exclude_NonAG_db);

                //for log flush, need to *1000=microseconds
            }
            multiply1000 = "UPDATE log_flush_complete SET duration=duration*1000";
            log_flush_complete_secondary.preprocessingQueries.Add(multiply1000);

            var list9 = log_flush_complete_secondary.GetPerfPointData();

            Pages.ProcessingTimePageTemplate flushSecPage = new Pages.ProcessingTimePageTemplate
                                                                (list9, "Local Flush", "Secondary Statistics", "Secondary-LocalFlush", 23);
            flushSecPage.GetData();

            flushSecPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Secondary_LocalFlush);
            PageTemplate.PageObject pageObj9 = new PageTemplate.PageObject("LocalFlushSecondary", flushSecPage, PageTemplate.PageObjState.SaveToDiskOnly, 23);
            Controller.pageObjs.Add(pageObj9);

            /*************************/



            /*************************/
            UpdateProgress2("Creating hadr_lsn_send_complete page");
            Logger.LogMessage("Creating hadr_lsn_send_complete page");



            var list10 = hadr_lsn_send_complete.GetPerfPointData();

            Pages.ProcessingTimePageTemplate lsnSendPage = new Pages.ProcessingTimePageTemplate
                                                               (list10, "Send", "Secondary Statistics", "Secondary-Send", 24);
            lsnSendPage.GetData();

            lsnSendPage.page.pageDescription = Annotation.GetExplain(LatencyEvent.Secondary_Send);
            PageTemplate.PageObject pageObj10 = new PageTemplate.PageObject("SecondarySend", lsnSendPage, PageTemplate.PageObjState.SaveToDiskOnly, 24);
            Controller.pageObjs.Add(pageObj10);

            /*************************/


            /*************************/
            UpdateProgress2("Creating hadr_lsn_send_complete2 page");
            Logger.LogMessage("Creating hadr_lsn_send_complete2 page");



            var list11 = hadr_lsn_send_complete2.GetPerfPointData();

            Pages.ProcessingTimePageTemplate lsnSendPage2 = new Pages.ProcessingTimePageTemplate
                                                                (list11, "Processing", "Secondary Statistics", "Secondary-Processing", 25);
            lsnSendPage2.GetData();
            lsnSendPage2.page.pageDescription = Annotation.GetExplain(LatencyEvent.Secondary_Processing);
            lsnSendPage2.page.pageSummary     = "<br>Here is the xevent of <b>hadr_lsn_send_complete:</b><br><br><img src='../images/hadr_lsn_send_complete.png' height='300'/>";

            PageTemplate.PageObject pageObj11 = new PageTemplate.PageObject("SecondaryProcessing", lsnSendPage2, PageTemplate.PageObjState.SaveToDiskOnly, 25);
            Controller.pageObjs.Add(pageObj11);

            /*************************/



            UpdateProgress2("Creating Summary page");
            Logger.LogMessage("Creating Summary page");

            Pages.AGLatencySummaryPage sum = new Pages.AGLatencySummaryPage(Latency.NetworkLatency.replicaId, "Summary", "");
            sum.SavePageToDisk();


            Controller.pageObjs = Controller.pageObjs.OrderBy(p => p.outputOrder).ToList();
            //Now save other pages,this way, the summayr page will be the first page
            foreach (PageTemplate.PageObject pg in Controller.pageObjs)
            {
                pg.page.SavePageToDisk();
            }
        }