private static double TestInsert(IKeyValueStorage<Guid, object> storage, Stopwatch sw, Collection<Guid> ids) { var startTicks = sw.ElapsedTicks; for (int inner = 0; inner < reportingFrequency; inner++) { storage.AddOrUpdate(ids[inner], testBuffer); } return (double)1000 * (sw.ElapsedTicks - startTicks) / Stopwatch.Frequency / reportingFrequency; }
private static double TestInsert(IKeyValueStorage <Guid, object> storage, Stopwatch sw, Collection <Guid> ids) { var startTicks = sw.ElapsedTicks; for (int inner = 0; inner < reportingFrequency; inner++) { storage.AddOrUpdate(ids[inner], testBuffer); } return((double)1000 * (sw.ElapsedTicks - startTicks) / Stopwatch.Frequency / reportingFrequency); }
/// <summary> /// Adds node to collection /// </summary> /// <param name="identifier">Node identifier</param> /// <param name="node">Node to add</param> public void SetNode(TIdentifier identifier, Node <TIdentifier, TNodeData, TEdgeData> node) { rwLock.AcquireWriterLock(-1); try { storage.AddOrUpdate(identifier, node); } finally { rwLock.ReleaseLock(); } }
/// <summary> /// Adds node to collection /// </summary> /// <param name="identifier">Node identifier</param> /// <param name="node">Node to add</param> public void SetNode(TIdentifier identifier, Node <TIdentifier, TNodeData, TEdgeData> node) { storage.AddOrUpdate(identifier, node); }