Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 /// <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();
     }
 }
Exemplo n.º 4
0
 /// <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);
 }