示例#1
0
文件: Program.cs 项目: nemanjazz/iog
        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;
        }
示例#2
0
文件: Program.cs 项目: nemanjazz/iog
        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);
        }
示例#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();
     }
 }
示例#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);
 }