Ejemplo n.º 1
0
        private DatabaseReadResource(Guid mdbGuid, WorkloadType workloadType) : base(mdbGuid, workloadType)
        {
            MDBPerfCounterHelper mdbhelper       = MDBPerfCounterHelperCollection.GetMDBHelper(mdbGuid, true);
            WorkloadType         wlmWorkloadType = base.WlmWorkloadType;

            if (wlmWorkloadType != WorkloadType.MailboxReplicationService)
            {
                if (wlmWorkloadType != WorkloadType.MailboxReplicationServiceHighPriority)
                {
                    switch (wlmWorkloadType)
                    {
                    case WorkloadType.MailboxReplicationServiceInternalMaintenance:
                        base.UtilizationPerfCounter = mdbhelper.PerfCounter.UtilizationReadInternalMaintenance;
                        break;

                    case WorkloadType.MailboxReplicationServiceInteractive:
                        base.UtilizationPerfCounter = mdbhelper.PerfCounter.UtilizationReadCustomerExpectation;
                        break;
                    }
                }
                else
                {
                    base.UtilizationPerfCounter = mdbhelper.PerfCounter.UtilizationReadHiPri;
                }
            }
            else
            {
                base.UtilizationPerfCounter = mdbhelper.PerfCounter.UtilizationRead;
            }
            base.TransferRatePerfCounter = mdbhelper.ReadTransferRate;
        }
Ejemplo n.º 2
0
        private static bool ShouldRemovePerfCounter(Guid mdbGuid, MDBPerfCounterHelper perfCounter)
        {
            bool result = false;

            CommonUtils.CatchKnownExceptions(delegate
            {
                DatabaseInformation databaseInformation = MapiUtils.FindServerForMdb(mdbGuid, null, null, FindServerFlags.AllowMissing);
                result = (databaseInformation.IsMissing || !databaseInformation.IsOnThisServer);
            }, null);
            return(result);
        }
Ejemplo n.º 3
0
        public static MDBPerfCounterHelper GetMDBHelper(Guid mdbGuid, bool createIfNotPresent)
        {
            MDBPerfCounterHelper mdbperfCounterHelper = null;
            MDBPerfCounterHelper result;

            lock (MDBPerfCounterHelperCollection.locker)
            {
                if (!MDBPerfCounterHelperCollection.data.TryGetValue(mdbGuid, out mdbperfCounterHelper) && createIfNotPresent)
                {
                    DatabaseInformation databaseInformation = MapiUtils.FindServerForMdb(mdbGuid, null, null, FindServerFlags.AllowMissing);
                    mdbperfCounterHelper = new MDBPerfCounterHelper(databaseInformation.DatabaseName ?? MrsStrings.MissingDatabaseName2(mdbGuid, databaseInformation.ForestFqdn));
                    MDBPerfCounterHelperCollection.data.TryInsertSliding(mdbGuid, mdbperfCounterHelper, MDBPerfCounterHelperCollection.RefreshInterval);
                }
                result = mdbperfCounterHelper;
            }
            return(result);
        }
Ejemplo n.º 4
0
 private static void RemovePerfCounter(Guid mdbGuid, MDBPerfCounterHelper perfCounter, RemoveReason reason)
 {
     perfCounter.RemovePerfCounter();
 }
Ejemplo n.º 5
0
 internal void AttachPerfCounters(MDBPerfCounterHelper pcHelper)
 {
     this.pcHelper = pcHelper;
     this.UpdateActiveCounts(this.CurrentState, 1L);
 }