public EHPurgeLogicTests() { //an mock eh settings this.ehSettings = new EventHubPartitionSettings { Hub = new EventHubOptions(), Partition = "MockPartition", ReceiverOptions = new EventHubReceiverOptions() }; //set up cache pressure monitor and purge predicate this.cachePressureInjectionMonitor = new CachePressureInjectionMonitor(); this.purgePredicate = new PurgeDecisionInjectionPredicate(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(30)); //set up serialization env var environment = SerializationTestEnvironment.InitializeWithDefaults(); this.serializationManager = environment.SerializationManager; //set up buffer pool, small buffer size make it easy for cache to allocate multiple buffers var oneKB = 1024; this.bufferPool = new ObjectPool <FixedSizeBuffer>(() => new FixedSizeBuffer(oneKB)); this.telemetryProducer = NullTelemetryProducer.Instance; }
public EHPurgeLogicTests() { //an mock eh settings this.ehSettings = new EventHubPartitionSettings(); ehSettings.Hub = new EventHubSettings(); ehSettings.Partition = "MockPartition"; //set up cache pressure monitor and purge predicate this.cachePressureInjectionMonitor = new CachePressureInjectionMonitor(); this.purgePredicate = new PurgeDecisionInjectionPredicate(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(30)); //set up serialization env var environment = SerializationTestEnvironment.InitializeWithDefaults(); this.serializationManager = environment.SerializationManager; //set up buffer pool, small buffer size make it easy for cache to allocate multiple buffers this.bufferPoolSizeInMB = EventHubStreamProviderSettings.DefaultCacheSizeMb; var oneKB = 1024; this.bufferPool = new FixedSizeObjectPool <FixedSizeBuffer>(this.bufferPoolSizeInMB, () => new FixedSizeBuffer(oneKB)); //set up logger this.logger = new NoOpTestLogger().GetLogger(this.GetType().Name); }