public async Task DataSourceHandlerCacheCloneToMemoryTest() { string GhcnFullName = typeof(HandlerStubSyncroNoContext).AssemblyQualifiedName; var ds = await DataSourceHandlerCache.GetInstanceAsync(GhcnFullName, "msds:nc?file=GHCNv2_part.nc&openMode=readOnly"); Assert.IsTrue(ds.Storage.GetType().ToString().ToLower().Contains("netcdf")); var ds2 = await DataSourceHandlerCache.GetInstanceAsync(GhcnFullName, "msds:nc?file=GHCNv2_part.nc&openMode=readOnly&cloneToMemory=true"); Assert.IsTrue(ds2.Storage.GetType().ToString().ToLower().Contains("memory")); }
public async Task DataSourceHandlerCacheLoadHandlerAsyncAPI() { string StubFullName = typeof(HandlerStubAsyncWithContext).AssemblyQualifiedName; string StubFullName2 = typeof(HandlerStubAsyncNoContext).AssemblyQualifiedName; var dh = await DataSourceHandlerCache.GetInstanceAsync(StubFullName, "msds:memory"); Assert.IsNotNull(dh); dh = await DataSourceHandlerCache.GetInstanceAsync(StubFullName2, "msds:memory"); Assert.IsNotNull(dh); }
public void DataSourceHandlerCacheMemoryLoadTest() { string WorldClimFullName = typeof(Microsoft.Research.Science.FetchClimate2.WorldClim14DataSource).AssemblyQualifiedName; string CruFullName = typeof(Microsoft.Research.Science.FetchClimate2.DataSources.CruCl20DataHandler).AssemblyQualifiedName; Trace.WriteLine("Total memory before test: " + GC.GetTotalMemory(true)); for (int i = 0; i < 10000; i++) { DataSourceHandlerCache.GetInstanceAsync( WorldClimFullName, "msds:az?name=WorldClimCurrent&DefaultEndpointsProtocol=http&AccountName=fc2chunkedstorage&AccountKey=dnPQl1Zjwpzm2qLPW/J9MFrhPWYocz3h/2zzuQ+RxCTE+ClFfKIriu4aCwJpPt+P6sU8hJfiWfQaBYc4nDSY/Q==").Wait(); DataSourceHandlerCache.GetInstanceAsync( CruFullName, "msds:az?name=CRU_CL_2_0&DefaultEndpointsProtocol=http&AccountName=fc2chunkedstorage&AccountKey=dnPQl1Zjwpzm2qLPW/J9MFrhPWYocz3h/2zzuQ+RxCTE+ClFfKIriu4aCwJpPt+P6sU8hJfiWfQaBYc4nDSY/Q==").Wait(); if (i % 100 == 0) { Trace.WriteLine("Iteration " + i.ToString() + ": " + GC.GetTotalMemory(true)); } } }