public void SetThrottleState(TenantThrottleInfo throttleInfo)
 {
     if (throttleInfo == null)
     {
         throw new ArgumentNullException("throttleInfo");
     }
     this.SaveTenantThrottleInfo(new List <TenantThrottleInfo>
     {
         throttleInfo
     }, 0);
 }
示例#2
0
        protected override void InternalProcessRecord()
        {
            base.InternalProcessRecord();
            TenantThrottleState tenantThrottleState = this.Throttle ? TenantThrottleState.Throttled : TenantThrottleState.Unthrottled;
            TenantThrottleInfo  throttleState       = base.Session.GetThrottleState(this.ExternalDirectoryOrganizationId);

            if (throttleState == null || throttleState.ThrottleState != tenantThrottleState)
            {
                base.Session.SetThrottleState(new TenantThrottleInfo
                {
                    TenantId      = this.ExternalDirectoryOrganizationId,
                    ThrottleState = tenantThrottleState
                });
            }
        }
        protected override void InternalProcessRecord()
        {
            base.InternalProcessRecord();
            TenantThrottleInfo throttleState = base.Session.GetThrottleState(this.ExternalDirectoryOrganizationId);

            if (throttleState != null && throttleState.ThrottleState != TenantThrottleState.Auto)
            {
                base.Session.SetThrottleState(new TenantThrottleInfo
                {
                    TenantId      = this.ExternalDirectoryOrganizationId,
                    ThrottleState = TenantThrottleState.Auto
                });
                return;
            }
            this.WriteWarning(Strings.ErrorObjectNotFound("TransportProcessingQuotaOverride"));
        }
 internal static TransportProcessingQuotaDigest Create(TenantThrottleInfo tenantThrottleInfo)
 {
     return(new TransportProcessingQuotaDigest
     {
         ExternalDirectoryOrganizationId = tenantThrottleInfo.TenantId,
         Throttled = tenantThrottleInfo.IsThrottled,
         Source = ((tenantThrottleInfo.ThrottleState == TenantThrottleState.Auto) ? ThrottlingSource.Calculated : ThrottlingSource.Override),
         Cost = tenantThrottleInfo.AverageMessageCostMs,
         MessageCount = tenantThrottleInfo.MessageCount,
         MessageAverageSizeKb = tenantThrottleInfo.AverageMessageSizeKb,
         StandardDeviation = tenantThrottleInfo.StandardDeviation,
         ThrottlingFactor = tenantThrottleInfo.ThrottlingFactor,
         PartitionCost = tenantThrottleInfo.PartitionAverageMessageCostMs,
         PartitionMessageCount = tenantThrottleInfo.PartitionMessageCount,
         PartitionMessageAverageSizeKb = tenantThrottleInfo.PartitionAverageMessageSizeKb,
         PartitionTenantCount = tenantThrottleInfo.PartitionTenantCount
     });
 }