[Test] //Keep for debugging until everything is crawled.
        public void RunQueueLocally()
        {
            var indexingCore = new IndexingCore(
                GalleryAwsCredentialsFactory.ProductionDbClient,
                GalleryAwsCredentialsFactory.S3Client,
                GalleryAwsCredentialsFactory.ElasticSearchClient);
            var queueIndexer = new QueueIndexer(GalleryAwsCredentialsFactory.SqsClient,
                                                new HttpClient(),
                                                indexingCore,
                                                new ConsoleLogging());

            queueIndexer.ProcessAllInQueue(99999);            dotMemory.Check(memory =>
            {
                Console.WriteLine("bytes persisting: " + memory.SizeInBytes / 1024 / 1024 + "MB");
                Console.WriteLine("Array MB in memory: " + memory.GetObjects(where => where.Type.Is <byte[]>()).ObjectsCount);
                dotMemory.Check(memory => Assert.AreEqual(0, memory.GetObjects(where => where.Type.Is <IndexResult>()).ObjectsCount));
                dotMemory.Check(memory => Assert.AreEqual(1, memory.GetObjects(where => where.Type.Is <MemoryStream>()).ObjectsCount));
                dotMemory.Check(memory => Assert.AreEqual(0, memory.GetObjects(where => where.Type.Is <TileImage>()).ObjectsCount));
                dotMemory.Check(memory => Assert.AreEqual(0, memory.GetObjects(where => where.Type.Is <Image <Rgba64> >()).ObjectsCount));
                dotMemory.Check(memory => Assert.AreEqual(0, memory.GetObjects(where => where.Type.Is <Image <Rgba32> >()).ObjectsCount));
                dotMemory.Check(memory => Assert.AreEqual(1, memory.GetObjects(where => where.Type.Is <ArrayPoolMemoryAllocator>()).ObjectsCount));
                Assert.LessOrEqual(memory.SizeInBytes, 512 * 1024 * 1024);
                // when memory is high, uncomment to throw error and then you can use the .dmw file in the UI to investigate.
                dotMemory.Check(memory => Assert.AreEqual(1, 2));
            });
        }
示例#2
0
        public string FunctionHandler(ILambdaContext context)
        {
            var queueIndexer = new QueueIndexer(QueueClient, HttpClient, IndexingCore, new ConsoleLogging());

            return(queueIndexer.ProcessAllInQueue());
        }