示例#1
0
        public void DoPuts()
        {
            FwkInfo("In DoPuts()");
            try
            {
                IRegion <TKey, TVal> region = GetRegion();
                int    numClients           = GetUIntValue(ClientCount);
                string label = CacheHelper <TKey, TVal> .RegionTag(region.Attributes);

                int timedInterval = GetTimeValue(TimedInterval) * 1000;
                if (timedInterval <= 0)
                {
                    timedInterval = 5000;
                }
                int maxTime = 10 * timedInterval;

                // Loop over key set sizes
                ResetKey(DistinctKeys);
                int numKeys;
                while ((numKeys = InitKeys(false)) > 0)
                { // keys loop
                  // Loop over value sizes

                    ResetKey(NumThreads);
                    int numThreads;
                    while ((numThreads = GetUIntValue(NumThreads)) > 0)
                    {
                        PutTask <TKey, TVal> puts = new PutTask <TKey, TVal>(region, numKeys / numThreads, mapList, true);
                        FwkInfo("Running timed task ");
                        try
                        {
                            RunTask(puts, numThreads, -1, timedInterval, maxTime, null);
                        }
                        catch (ClientTimeoutException)
                        {
                            FwkException("In DoPuts()  Timed run timed out.");
                        }
                        puts.dumpToBB();
                        Thread.Sleep(3000); // Put a marker of inactivity in the stats
                    }
                    Thread.Sleep(3000);     // Put a marker of inactivity in the stats
                } // keys loop
            }
            catch (Exception ex)
            {
                FwkException("DoPuts() Caught Exception: {0}", ex);
            }
            Thread.Sleep(3000); // Put a marker of inactivity in the stats
            FwkInfo("DoPuts() complete.");
        }
示例#2
0
        public void DoEntryOperation()
        {
            FwkInfo("In DoEntryOperation");
            try
            {
                IRegion <TKey, TVal> region = GetRegion();
                int    numClients           = GetUIntValue(ClientCount);
                string label = CacheHelper <TKey, TVal> .RegionTag(region.Attributes);

                int timedInterval = GetTimeValue(TimedInterval) * 1000;
                {
                    timedInterval = 5000;
                }
                int maxTime = 10 * timedInterval;

                // Loop over key set sizes
                ResetKey(DistinctKeys);
                int numKeys = GetUIntValue(DistinctKeys);
                ResetKey(NumThreads);
                int numThreads;
                while ((numThreads = GetUIntValue(NumThreads)) > 0)
                {
                    EntryTask <TKey, TVal> entrytask = new EntryTask <TKey, TVal>(region, numKeys / numThreads, mapList);
                    FwkInfo("Running timed task ");
                    try
                    {
                        RunTask(entrytask, numThreads, -1, timedInterval, maxTime, null);
                    }
                    catch (ClientTimeoutException)
                    {
                        FwkException("In DoPuts()  Timed run timed out.");
                    }
                    Thread.Sleep(3000);
                    entrytask.dumpToBB();
                }
            }
            catch (Exception ex)
            {
                FwkException("DoEntryOperation() Caught Exception: {0}", ex);
            }
            FwkInfo("DoEntryOperation() complete.");
        }