예제 #1
0
        public void RunTest()
        {
            using (var testFolder = new TestFolder())
            {
                var factory        = new LoggerFactory();
                var logger         = factory.CreateLogger <RocksGraphProvider>();
                var storeLogger    = factory.CreateLogger <StoreProcessor>();
                var provider       = new RocksGraphProvider(logger, testFolder);
                var storeProvider  = new SetProvider(provider);
                var storeProcessor = new StoreProcessor(storeProvider, new Reasoner(), storeLogger);


                var storeId    = "test";
                var points     = new Dictionary <string, double>();
                var pointCount = 0;
                foreach (var pointId in _dataPoints)
                {
                    pointCount++;
                    points.Add(pointId, pointCount + 0.234);
                }

                foreach (var id in _ids)
                {
                    var json = JsonGenerator.GenerateTelemetry(id, points);
                    storeProcessor.PatchJson(storeId, json);
                }
            }
        }
예제 #2
0
        public RocksFixture()
        {
            const string testDirectory = "./testdata";

            if (Directory.Exists(testDirectory))
            {
                Directory.Delete(testDirectory, true);
            }
            Directory.CreateDirectory(testDirectory);
            GraphProvider         = new RocksGraphProvider(Mock.Of <ILogger <RocksGraphProvider> >(), testDirectory);
            StoreProvider         = new SetProvider(GraphProvider);
            StoreOperationFactory = new StoreOperationFactory();
            StoreProcessor        = new StoreProcessor(StoreProvider, new Reasoner(), StoreOperationFactory, Mock.Of <ILogger <StoreProcessor> >());
            SetId = "testset";
        }
예제 #3
0
        public void Setup()
        {
            _testFolder = new TestFolder();

            while (_ids.Count < _maxIds)
            {
                _ids.Add(Guid.NewGuid().ToString());
            }

            while (_dataPoints.Count < _maxPoints)
            {
                _dataPoints.Add(Guid.NewGuid().ToString());
            }

            var factory       = new LoggerFactory();
            var logger        = factory.CreateLogger <RocksGraphProvider>();
            var storeLogger   = factory.CreateLogger <StoreProcessor>();
            var provider      = new RocksGraphProvider(logger, _testFolder);
            var storeProvider = new SetProvider(provider);

            _storeProcessor = new StoreProcessor(storeProvider, new Reasoner(), storeLogger);
        }