/*
         * public static string getTimeDeltaUpdateSQL =
         * "update log_flush_complete set TimeDelta="
         + "(select log_flush_complete.EventTimeStamp - log_flush_start.EventTimeStamp "
         + "   from log_flush_start where log_flush_start.log_block_id=log_flush_complete.log_block_id)"
         + " WHERE EXISTS (select * from log_flush_start where log_flush_start.log_block_id = log_flush_complete.log_block_id)";
         +
         + SELECT log_flush_start.EventTimeStamp,  log_flush_start.log_block_id,log_flush_complete.database_id,log_flush_complete.file_id,log_flush_complete.duration,  (log_flush_complete.EventTimeStamp-log_flush_start.EventTimeStamp) AS TimeDelta
         + FROM log_flush_start
         + INNER JOIN log_flush_complete
         + ON log_flush_start.log_block_id=log_flush_complete.log_block_id
         +
         */
        //Multiple database, need to take care of that.
        //but I assume the log block is unique across the database (Can I assume this way?)
        public void Register()
        {
            if (server == Replica.Primary)
            {
                eventLatency = new EventLatency("LocalHarden_Primary");

                //   eventLatency.primaryEvents.
                //   Add(new EventWithMode(EventMetaData.xEvent.log_flush_start));

                //In log_flush_complete, there is "durataion" column, use that as the flush delta time (start to complete)
                eventLatency.primaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.log_flush_complete));


                //Add it to xeloader
                XELoader.AddEventLatency(eventLatency);
            }

            else

            {
                eventLatency = new EventLatency("LocalHarden_Secondary");


                eventLatency.secondaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.log_flush_complete));


                //Add it to xeloader
                XELoader.AddEventLatency(eventLatency);
            }
        }
Beispiel #2
0
        public void Register()
        {
            eventLatency = new EventLatency("Hadr_capture_log_block_primary");


            eventLatency.primaryEvents.
            Add(new EventWithMode(EventMetaData.xEvent.hadr_capture_log_block, 1));


            eventLatency.primaryEvents.
            Add(new EventWithMode(EventMetaData.xEvent.hadr_capture_log_block, 4));


            //Add it to xeloader
            XELoader.AddEventLatency(eventLatency);
        }
Beispiel #3
0
        public void Register()
        {
            eventLatency = new EventLatency("hadr_database_flow_control_action");


            eventLatency.primaryEvents.
            Add(new EventWithMode(EventMetaData.xEvent.hadr_database_flow_control_action));


            // eventLatency.primaryEvents.
            //       Add(new EventWithMode(EventMetaData.xEvent.hadr_capture_log_block, 4));


            //Add it to xeloader
            XELoader.AddEventLatency(eventLatency);
        }
        public void Register()
        {
            if (networkDir == NetworkDirection.Secondary_To_Primary)
            {
                networkLatency = new EventLatency(networkDir.ToString());

                /*
                 * mode 4:Occurs after the dequeued message reaches Replica layer and before sending to transport (UCS). Only message routing actions between mode 3 and 4
                 */
                networkLatency.primaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.hadr_receive_harden_lsn_message, 1));

                //mode=1 or 2. 1 means Occurs when receiving new log block message from transport (UCS)
                networkLatency.secondaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.hadr_send_harden_lsn_message, 3));


                //Add it to xeloader
                XELoader.AddEventLatency(networkLatency);
            }
        }
        //Multiple database, need to take care of that.

        public void Register()
        {
            if (server == Replica.Primary)
            {
                eventLatency = new EventLatency("TranProcessingTime_Primary");


                eventLatency.primaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.recovery_unit_harden_log_timestamps));


                //Add it to xeloader
                XELoader.AddEventLatency(eventLatency);
            }

            else

            {
                Logger.LogMessage("[ERROR]Secondary doesn't have recovery_unit_harden_log_timestamps event. ");
            }
        }
Beispiel #6
0
        //Multiple database, need to take care of that.

        public void Register()
        {
            if (server == Replica.Primary)
            {
                eventLatency = new EventLatency("TranRemoteCommit_Primary");


                eventLatency.primaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.hadr_db_commit_mgr_harden));


                //Add it to xeloader
                XELoader.AddEventLatency(eventLatency);
            }

            else

            {
                Logger.LogMessage("[ERROR]Secondary doesn't have hadr_db_commit_mgr_harden event. ");
            }
        }
Beispiel #7
0
        //Multiple database, need to take care of that.

        public void Register(EventMetaData.xEvent evt, int mode)
        {
            string tag = "_primary";

            if (!isPrimary)
            {
                tag = "_secondary";
            }
            eventLatency = new EventLatency(eventName + tag);

            if (isPrimary)
            {
                eventLatency.primaryEvents.Add(new EventWithMode(evt, mode));
            }

            else
            {
                eventLatency.secondaryEvents.Add(new EventWithMode(evt, mode));
            }

            XELoader.AddEventLatency(eventLatency);
        }
Beispiel #8
0
        public void Register()
        {
            if (networkDir == NetworkDirection.Primary_To_Secondary)
            {
                networkLatency = new EventLatency(networkDir.ToString());

                /*
                 * mode 4:Occurs after the dequeued message reaches Replica layer and before sending to transport (UCS). Only message routing actions between mode 3 and 4
                 * using 2 because some xevent doesn't have mode=4
                 */
                networkLatency.primaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.hadr_capture_log_block, 2));

                //mode=1 or 2. 1 means Occurs when receiving new log block message from transport (UCS)
                networkLatency.secondaryEvents.
                Add(new EventWithMode(EventMetaData.xEvent.hadr_transport_receive_log_block_message, 1));


                //Add it to xeloader
                XELoader.AddEventLatency(networkLatency);
            }
        }