summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/customEvictor/Client.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-03-20 18:27:21 +0000
committerBernard Normier <bernard@zeroc.com>2007-03-20 18:27:21 +0000
commitaaa75d85cd5e17da09f38d81bc9d3ca0a2472eff (patch)
treef0984b3c4682abdabd00ee9fab9b5dd078b8ca6f /cpp/demo/Freeze/customEvictor/Client.cpp
parent- Remove bogus commented out code from LoggerI.java (diff)
downloadice-aaa75d85cd5e17da09f38d81bc9d3ca0a2472eff.tar.bz2
ice-aaa75d85cd5e17da09f38d81bc9d3ca0a2472eff.tar.xz
ice-aaa75d85cd5e17da09f38d81bc9d3ca0a2472eff.zip
customeEvictor
Diffstat (limited to 'cpp/demo/Freeze/customEvictor/Client.cpp')
-rw-r--r--cpp/demo/Freeze/customEvictor/Client.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/cpp/demo/Freeze/customEvictor/Client.cpp b/cpp/demo/Freeze/customEvictor/Client.cpp
index ff795c08d54..37fe8a6a01e 100644
--- a/cpp/demo/Freeze/customEvictor/Client.cpp
+++ b/cpp/demo/Freeze/customEvictor/Client.cpp
@@ -14,6 +14,9 @@
using namespace std;
using namespace Warehouse;
+const int readCount = 15000;
+const int writeCount = 1500;
+
const int objectCount = 10000;
class WarehouseClient : public Ice::Application
@@ -73,16 +76,14 @@ public:
virtual void run()
{
//
- // Measures how long it takes to read 'count' items at random
+ // Measures how long it takes to read 'readCount' items at random
//
- const int count = 50000;
-
StopWatch stopWatch;
stopWatch.start();
try
{
- for(int i = 0; i < count; ++i)
+ for(int i = 0; i < readCount; ++i)
{
int id = IceUtil::random(objectCount);
ostringstream os;
@@ -93,7 +94,7 @@ public:
ItemPrx item = ItemPrx::uncheckedCast(_anItem->ice_identity(identity));
item->getDescription();
}
- _requestsPerSecond = static_cast<int>(count / stopWatch.stop().toSecondsDouble());
+ _requestsPerSecond = static_cast<int>(readCount / stopWatch.stop().toSecondsDouble());
}
catch(const IceUtil::Exception& e)
{
@@ -128,16 +129,14 @@ public:
virtual void run()
{
//
- // Measure how long it takes to write 'count' items at random
+ // Measure how long it takes to write 'writeCount' items at random
//
- const int count = 5000;
-
StopWatch stopWatch;
stopWatch.start();
try
{
- for(int i = 0; i < count; ++i)
+ for(int i = 0; i < writeCount; ++i)
{
int id = IceUtil::random(objectCount);
@@ -150,7 +149,7 @@ public:
item->adjustStock(1);
}
- _requestsPerSecond = static_cast<int>(count / stopWatch.stop().toSecondsDouble());
+ _requestsPerSecond = static_cast<int>(writeCount / stopWatch.stop().toSecondsDouble());
}
catch(const IceUtil::Exception& e)
{