public static void Test1() { FileSystemEmulatorHandler handler = new FileSystemEmulatorHandler { BaseAddress = new Uri("http://*****:*****@"c:\data\site", InnerHandler = new HttpClientHandler() }; DateTime minDownloadTimeStamp = DateTime.Parse("2014-07-20"); //DateTime minDownloadTimeStamp = DateTime.MinValue; StatsCountCollector collector = new StatsGreaterThanCountCollector(minDownloadTimeStamp); //StatsCountCollector collector = new StatsLessThanCountCollector(minDownloadTimeStamp); Uri index = new Uri("http://localhost:8000/stats/index.json"); collector.Run(index, DateTime.MinValue, handler).Wait(); Console.WriteLine("count = {0}", collector.Count); }
public static async Task Test6Async() { FileSystemEmulatorHandler handler = new FileSystemEmulatorHandler { BaseAddress = new Uri("http://*****:*****@"c:\data\site", InnerHandler = new HttpClientHandler() }; Storage storage = new FileStorage("http://*****:*****@"c:\data\site\resolver"); ResolverCollector collector = new ResolverCollector(storage, 200); await collector.Run(new Uri("http://localhost:8000/full/index.json"), DateTime.MinValue, handler); Console.WriteLine("http requests: {0} batch count: {1}", collector.RequestCount, collector.BatchCount); }