protected override void RunCore()
        {
            ResolverCollector collector = new ResolverCollector(Config.PackageRegistrations.Storage, 1000);
            collector.GalleryBaseAddress = Config.Gallery.BaseAddress.AbsoluteUri.TrimEnd('/');
            collector.ContentBaseAddress = Config.Packages.BaseAddress.AbsoluteUri.TrimEnd('/');

            var indexUri = new Uri(Config.Catalog.BaseAddress + "index.json");
            var task = collector.Run(indexUri, _cursor, Config.Catalog.FileSystemEmulator);
            task.Wait();
        }
        public static async Task Test0Async()
        {
            Storage storage = new FileStorage("http://*****:*****@"c:\data\site\resolver");

            FileSystemEmulatorHandler handler = new VerboseHandler
            {
                BaseAddress = new Uri("http://*****:*****@"c:\data\site",
                InnerHandler = new HttpClientHandler()
            };

            ResolverCollector collector = new ResolverCollector(storage, 200);

            //await collector.Run(new Uri("http://localhost:8000/full/index.json"), DateTime.MinValue);
            //await collector.Run(new Uri("http://partitions.blob.core.windows.net/partition0/index.json"), DateTime.MinValue);
            await collector.Run(new Uri("http://localhost:8000/partition/partition0/index.json"), DateTime.MinValue, handler);
            Console.WriteLine("http requests: {0} batch count: {1}", collector.RequestCount, collector.BatchCount);
        }
        public static async Task Test0Async()
        {
            //Storage storage = new AzureStorage
            //{
            //    AccountName = "nuget3",
            //    AccountKey = "",
            //    Container = "feed",
            //    BaseAddress = "http://nuget3.blob.core.windows.net"
            //};

            Storage storage = new FileStorage
            {
                Path = @"c:\data\site\export2",
                Container = "export2",
                BaseAddress = "http://localhost:8000/"
            };

            ResolverCollector collector = new ResolverCollector(storage, 200);

            await collector.Run(new Uri("http://localhost:8000/export/catalog/index.json"), DateTime.MinValue);
            Console.WriteLine("http requests: {0} batch count: {1}", collector.RequestCount, collector.BatchCount);
        }
        public static async Task Test5Async()
        {
            Storage storage = new FileStorage("http://*****:*****@"c:\data\site\resolver");

            TimeSpan prev = TimeSpan.MinValue;
            Uri longest = null;

            for (int i = 0; i < 100; i++)
            {
                Uri indexUri = new Uri(string.Format("http://localhost:8000/partition/partition{0}/index.json", i));

                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();
                
                ResolverCollector collector = new ResolverCollector(storage, 200);
                await collector.Run(indexUri, DateTime.MinValue);
                Console.WriteLine("http requests: {0} batch count: {1}", collector.RequestCount, collector.BatchCount);
                
                stopwatch.Stop();

                TimeSpan current = stopwatch.Elapsed;

                if (longest == null || current > prev)
                {
                    longest = indexUri;
                    prev = current;
                }

                Console.WriteLine("{0} {1} seconds", indexUri, current.TotalSeconds);
            }

            Console.WriteLine("the winner is {0}", longest);
        }
        public static async Task Test4Async()
        {
            //Storage storage = new AzureStorage
            //{
            //    AccountName = "nuget3",
            //    AccountKey = "",
            //    Container = "feed",
            //    BaseAddress = "http://nuget3.blob.core.windows.net"
            //};

            // Storage storage = new FileStorage("http://*****:*****@"c:\data\site\test");
            Storage storage = new AzureStorage(
                CloudStorageAccount.Parse("AccountName=nugetdev0;AccountKey=;DefaultEndpointsProtocol=https"),
                "cdn-public",
                "v3/resolver",
                new Uri("http://preview-api.dev.nugettest.org/v3/resolver/"));

            ResolverCollector collector = new ResolverCollector(storage, 200);

            await collector.Run(new Uri("http://localhost:8000/test/catalog/index.json"), DateTime.MinValue);
            Console.WriteLine("http requests: {0} batch count: {1}", collector.RequestCount, collector.BatchCount);
        }