コード例 #1
0
        public BatchAsyncContainerExecutor(
            ContainerInternal cosmosContainer,
            CosmosClientContext cosmosClientContext,
            int maxServerRequestOperationCount,
            int maxServerRequestBodyLength)
        {
            if (maxServerRequestOperationCount < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(maxServerRequestOperationCount));
            }

            if (maxServerRequestBodyLength < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(maxServerRequestBodyLength));
            }

            this.cosmosContainer                = cosmosContainer ?? throw new ArgumentNullException(nameof(cosmosContainer));
            this.cosmosClientContext            = cosmosClientContext;
            this.maxServerRequestBodyLength     = maxServerRequestBodyLength;
            this.maxServerRequestOperationCount = maxServerRequestOperationCount;
            this.timerWheel   = TimerWheel.CreateTimerWheel(BatchAsyncContainerExecutor.TimerWheelResolution, BatchAsyncContainerExecutor.TimerWheelBucketCount);
            this.retryOptions = cosmosClientContext.ClientOptions.GetConnectionPolicy().RetryOptions;
        }
コード例 #2
0
 public void CreatesTimerWheel()
 {
     using TimerWheel wheel = TimerWheel.CreateTimerWheel(TimeSpan.FromMilliseconds(50), 1);
     Assert.IsNotNull(wheel);
 }
コード例 #3
0
        public BatchAsyncStreamer(
            int maxBatchOperationCount,
            int maxBatchByteSize,
            TimerWheel timerWheel,
            SemaphoreSlim limiter,
            int maxDegreeOfConcurrency,
            CosmosSerializerCore serializerCore,
            BatchAsyncBatcherExecuteDelegate executor,
            BatchAsyncBatcherRetryDelegate retrier)
        {
            if (maxBatchOperationCount < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(maxBatchOperationCount));
            }

            if (maxBatchByteSize < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(maxBatchByteSize));
            }

            if (executor == null)
            {
                throw new ArgumentNullException(nameof(executor));
            }

            if (retrier == null)
            {
                throw new ArgumentNullException(nameof(retrier));
            }

            if (serializerCore == null)
            {
                throw new ArgumentNullException(nameof(serializerCore));
            }

            if (limiter == null)
            {
                throw new ArgumentNullException(nameof(limiter));
            }

            if (maxDegreeOfConcurrency < 1)
            {
                throw new ArgumentNullException(nameof(maxDegreeOfConcurrency));
            }

            this.maxBatchOperationCount = maxBatchOperationCount;
            this.maxBatchByteSize       = maxBatchByteSize;
            this.executor       = executor;
            this.retrier        = retrier;
            this.timerWheel     = timerWheel;
            this.serializerCore = serializerCore;
            this.currentBatcher = this.CreateBatchAsyncBatcher();
            this.ResetTimer();

            this.limiter                = limiter;
            this.oldPartitionMetric     = new BatchPartitionMetric();
            this.partitionMetric        = new BatchPartitionMetric();
            this.maxDegreeOfConcurrency = maxDegreeOfConcurrency;

            this.StartCongestionControlTimer();
        }
コード例 #4
0
 /// <summary>
 /// Constructor to create the poller.
 /// </summary>
 /// <param name="endpoint">Endpoint. Cannot be null.</param>
 /// <param name="contactCenterUri">Contact center uri. Cannot be null or empty.</param>
 /// <param name="timerWheel">Timerwheel</param>
 internal ContactCenterServicePoller(LocalEndpoint endpoint, string contactCenterUri, TimerWheel timerWheel)
 {
     Debug.Assert(null != endpoint, "Endpoint is null");
     Debug.Assert(!String.IsNullOrEmpty(contactCenterUri), "Contact center uri is null or empty");
     m_endpoint         = endpoint;
     m_contactCenterUri = contactCenterUri;
     m_timerWheel       = timerWheel;
 }
コード例 #5
0
ファイル: TimerWheelTests.cs プロジェクト: Scooletz/RampUp
 public void SetUp()
 {
     _writer = new GuidMessageReaderWriter();
     _wheel = new TimerWheel(Actor, _pool, _writer, _writer.MessageHandler, TickLength, GetTicks, TicksPerSecond);
 }
コード例 #6
0
 public TimerWheelBenchmark()
 {
     this.timeouts  = TimerUtilities.GenerateTimeoutList(10000, 1000, 50);
     this.mainWheel = TimerWheel.CreateTimerWheel(TimerWheelBenchmark.resolution, 20);
 }
コード例 #7
0
ファイル: TimerWheelTests.cs プロジェクト: zhangz/RampUp
 public void SetUp()
 {
     _writer = new GuidMessageReaderWriter();
     _wheel  = new TimerWheel(Actor, _pool, _writer, _writer.MessageHandler, TickLength, GetTicks, TicksPerSecond);
 }
コード例 #8
0
 public void CreatesTimerWheel()
 {
     Assert.IsNotNull(TimerWheel.CreateTimerWheel(TimeSpan.FromMilliseconds(50), 1));
 }
コード例 #9
0
 /// <summary>
 /// Constructor to create the poller.
 /// </summary>
 internal WebConversationPoller(WebConversationManager webConversationManager, TimerWheel timerWheel)
 {
     m_conversationManager = webConversationManager;
     m_timerWheel          = timerWheel;
 }
コード例 #10
0
 public TimerWheelBenchmark()
 {
     this.timeouts  = TimerUtilities.GenerateTimeoutList(10000, 10000, 1000);
     this.mainWheel = TimerWheel.CreateTimerWheel(TimeSpan.FromMilliseconds(1000), 10);
     this.timerPool = new TimerPool(1);
 }