summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2004-10-06 14:21:31 +0000
committerMarc Laukien <marc@zeroc.com>2004-10-06 14:21:31 +0000
commitd028d803f9faec8ae3dcaabc266b4df9fcb760d4 (patch)
tree41af99797cec464e4cfdbe4e2b5178fb290a92f5
parentFix (diff)
downloadice-d028d803f9faec8ae3dcaabc266b4df9fcb760d4.tar.bz2
ice-d028d803f9faec8ae3dcaabc266b4df9fcb760d4.tar.xz
ice-d028d803f9faec8ae3dcaabc266b4df9fcb760d4.zip
IceUtil::Time fixes ; glacier fixes
-rw-r--r--cpp/demo/Freeze/bench/Client.cpp123
-rw-r--r--cpp/demo/Ice/latency/Client.cpp10
-rw-r--r--cpp/demo/Ice/throughput/Client.cpp11
-rw-r--r--cpp/include/IceUtil/GC.h2
-rw-r--r--cpp/include/IceUtil/Time.h33
-rw-r--r--cpp/src/Glacier2/Blobject.cpp1
-rw-r--r--cpp/src/Glacier2/Glacier2Router.cpp12
-rw-r--r--cpp/src/Glacier2/RequestQueue.cpp16
-rw-r--r--cpp/src/Glacier2/RouterI.cpp7
-rw-r--r--cpp/src/Glacier2/SessionRouterI.cpp4
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp12
-rw-r--r--cpp/src/IceUtil/GC.cpp2
-rw-r--r--cpp/src/IceUtil/Time.cpp5
13 files changed, 142 insertions, 96 deletions
diff --git a/cpp/demo/Freeze/bench/Client.cpp b/cpp/demo/Freeze/bench/Client.cpp
index 26f5823ac54..60e4a675add 100644
--- a/cpp/demo/Freeze/bench/Client.cpp
+++ b/cpp/demo/Freeze/bench/Client.cpp
@@ -42,7 +42,7 @@ public:
_start = IceUtil::Time::now();
}
- double
+ IceUtil::Time
stop()
{
if(!_stopped)
@@ -51,7 +51,7 @@ public:
_stop = IceUtil::Time::now();
}
- return (_stop - _start) * 1000.0;
+ return _stop - _start;
}
private:
@@ -176,11 +176,11 @@ private:
}
txHolder.commit();
}
- double total = _watch.stop();
- double perRecord = total / _repetitions;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total << "ms" << endl;
- cout << "\ttime per write: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Read each record.
@@ -195,8 +195,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total << "ms" << endl;
- cout << "\ttime per read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Optional index sub-test
@@ -218,8 +218,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total << "ms" << endl;
- cout << "\ttime per remove: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
@@ -236,11 +236,12 @@ private:
test(p != m.end());
test(p->second == key);
}
- double total = _watch.stop();
- double perRecord = total / reads;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / reads;
- cout << "\ttime for " << reads << " reads of " << gen->toString() << " records: " << total << "ms" << endl;
- cout << "\ttime per read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << reads << " reads of " << gen->toString() << " records: "
+ << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
generatedReadWithIndex(m, reads, gen);
}
@@ -278,11 +279,11 @@ private:
}
txHolder.commit();
}
- double total = _watch.stop();
- double perRecord = total / _repetitions;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total << "ms" << endl;
- cout << "\ttime per write: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Read each record.
@@ -300,8 +301,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total << "ms" << endl;
- cout << "\ttime per read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Optional index test
@@ -324,8 +325,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total << "ms" << endl;
- cout << "\ttime per remove: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
@@ -359,11 +360,11 @@ private:
}
txHolder.commit();
}
- double total = _watch.stop();
- double perRecord = total / _repetitions;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total << "ms" << endl;
- cout << "\ttime per write: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Read each record.
@@ -381,8 +382,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total << "ms" << endl;
- cout << "\ttime per read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Optional index test
@@ -406,8 +407,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total << "ms" << endl;
- cout << "\ttime per remove: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
void IntIntMapReadIndexTest(IntIntMap&)
@@ -434,11 +435,11 @@ private:
}
txHolder.commit();
}
- double total = _watch.stop();
- double perRecord = total / _repetitions;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total << "ms" << endl;
- cout << "\ttime per write: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Do some read tests.
@@ -468,8 +469,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total << "ms" << endl;
- cout << "\ttime per remove: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
*/
}
@@ -501,11 +502,12 @@ TestApp::IntIntMapIndexTest(IndexedIntIntMap& m)
test(p != m.end());
test(p->second == i);
}
- double total = _watch.stop();
- double perRecord = total / _repetitions;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reverse (indexed) reads: " << total << "ms" << endl;
- cout << "\ttime per reverse read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reverse (indexed) reads: " << total.toMicroSeconds() / 1000.0 << "ms"
+ << endl;
+ cout << "\ttime per reverse read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
void
@@ -519,11 +521,12 @@ TestApp::generatedReadWithIndex(IndexedIntIntMap& m, int reads, const GeneratorP
test(p != m.end());
test(p->second == value);
}
- double total = _watch.stop();
- double perRecord = total / reads;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / reads;
- cout << "\ttime for " << reads << " reverse (indexed) reads of " << gen->toString() << " records: " << total << "ms" << endl;
- cout << "\ttime per reverse read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << reads << " reverse (indexed) reads of " << gen->toString() << " records: "
+ << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per reverse read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
@@ -553,11 +556,11 @@ TestApp::Struct1Struct2MapIndexTest(IndexedStruct1Struct2Map& m)
test(p->second.s1.l == i);
}
- double total = _watch.stop();
- double perRecord = total / (2 *_repetitions);
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / (2 *_repetitions);
- cout << "\ttime for " << 2 *_repetitions << " indexed reads: " << total << "ms" << endl;
- cout << "\ttime per indexed read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << 2 *_repetitions << " indexed reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per indexed read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
void
@@ -576,11 +579,11 @@ TestApp::Struct1Class1MapIndexTest(IndexedStruct1Class1Map& m)
test(p != m.end());
test(p->first.l == i);
}
- double total = _watch.stop();
- double perRecord = total / _repetitions;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " indexed reads: " << total << "ms" << endl;
- cout << "\ttime per indexed read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " indexed reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per indexed read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
@@ -621,11 +624,11 @@ TestApp::Struct1ObjectMapTest()
}
txHolder.commit();
}
- double total = _watch.stop();
- double perRecord = total / _repetitions;
+ IceUtil::Time total = _watch.stop();
+ IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total << "ms" << endl;
- cout << "\ttime per write: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Read each record.
@@ -658,8 +661,8 @@ TestApp::Struct1ObjectMapTest()
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total << "ms" << endl;
- cout << "\ttime per read: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
//
// Remove each record.
@@ -677,8 +680,8 @@ TestApp::Struct1ObjectMapTest()
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total << "ms" << endl;
- cout << "\ttime per remove: " << perRecord << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
}
class MyFactory : public Ice::ObjectFactory
diff --git a/cpp/demo/Ice/latency/Client.cpp b/cpp/demo/Ice/latency/Client.cpp
index 0e304efdedb..14dbf3de6c5 100644
--- a/cpp/demo/Ice/latency/Client.cpp
+++ b/cpp/demo/Ice/latency/Client.cpp
@@ -36,7 +36,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
// Initial ping to setup the connection.
ping->ice_ping();
- IceUtil::Time tsec = IceUtil::Time::now();
+ IceUtil::Time tm = IceUtil::Time::now();
const int repetitions = 100000;
cout << "pinging server " << repetitions << " times (this may take a while)" << endl;
@@ -45,12 +45,10 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
ping->ice_ping();
}
- tsec = IceUtil::Time::now() - tsec;
+ tm = IceUtil::Time::now() - tm;
- double tmsec = tsec * 1000.0L;
-
- cout << "time for " << repetitions << " pings: " << tmsec << "ms" << endl;
- cout << "time per ping: " << tmsec / repetitions << "ms" << endl;
+ cout << "time for " << repetitions << " pings: " << tm.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "time per ping: " << tm.toMicroSeconds() / 1000.0 / repetitions << "ms" << endl;
return EXIT_SUCCESS;
}
diff --git a/cpp/demo/Ice/throughput/Client.cpp b/cpp/demo/Ice/throughput/Client.cpp
index c117be492fe..03e10c4ea1f 100644
--- a/cpp/demo/Ice/throughput/Client.cpp
+++ b/cpp/demo/Ice/throughput/Client.cpp
@@ -61,7 +61,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
throughput->ice_ping(); // Initial ping to setup the connection.
- IceUtil::Time tsec = IceUtil::Time::now();
+ IceUtil::Time tm = IceUtil::Time::now();
const int repetitions = 100;
if(c == 's' || c == 'o' || c == 'r' || c == 'e')
@@ -127,11 +127,10 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
}
- tsec = IceUtil::Time::now() - tsec;
- double tmsec = tsec * 1000.0L;
- cout << "time for " << repetitions << " sequences: " << tmsec << "ms" << endl;
- cout << "time per sequence: " << tmsec / repetitions << "ms" << endl;
- double mbit = repetitions * seqSize * 8.0 / tsec / 1000000.0;
+ tm = IceUtil::Time::now() - tm;
+ cout << "time for " << repetitions << " sequences: " << tm.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "time per sequence: " << tm.toMicroSeconds() / 1000.0 / repetitions << "ms" << endl;
+ double mbit = repetitions * seqSize * 8.0 / tm.toMicroSeconds();
if(c == 'e')
{
mbit *= 2;
diff --git a/cpp/include/IceUtil/GC.h b/cpp/include/IceUtil/GC.h
index ab89572850d..9c41c83fd7e 100644
--- a/cpp/include/IceUtil/GC.h
+++ b/cpp/include/IceUtil/GC.h
@@ -22,7 +22,7 @@ struct ICE_UTIL_API GCStats
{
int examined;
int collected;
- double msec;
+ Time time;
};
class GC : public ::IceUtil::Thread, public ::IceUtil::Monitor< ::IceUtil::Mutex>
diff --git a/cpp/include/IceUtil/Time.h b/cpp/include/IceUtil/Time.h
index 776e6c56354..a2a49b09ee7 100644
--- a/cpp/include/IceUtil/Time.h
+++ b/cpp/include/IceUtil/Time.h
@@ -31,7 +31,6 @@ public:
static Time microSeconds(Int64);
operator timeval() const;
- operator double() const;
Int64 toSeconds() const;
Int64 toMilliSeconds() const;
@@ -96,6 +95,20 @@ public:
return _usec != rhs._usec;
}
+ template<typename T>
+ Time& operator*=(T rhs)
+ {
+ _usec *= rhs;
+ return *this;
+ }
+
+ template<typename T>
+ Time& operator/=(T rhs)
+ {
+ _usec /= rhs;
+ return *this;
+ }
+
private:
Time(Int64);
@@ -103,6 +116,24 @@ private:
Int64 _usec;
};
+template<typename T>
+Time operator*(const Time& lhs, T rhs)
+{
+ return Time::microSeconds(static_cast<Int64>(lhs.toMicroSeconds() * rhs));
+}
+
+template<typename T>
+Time operator*(T rhs, const Time& lhs)
+{
+ return Time::microSeconds(static_cast<Int64>(lhs * rhs.toMicroSeconds()));
+}
+
+template<typename T>
+Time operator/(const Time& lhs, T rhs)
+{
+ return Time::microSeconds(static_cast<Int64>(lhs.toMicroSeconds() / rhs));
+}
+
} // End namespace IceUtil
#endif
diff --git a/cpp/src/Glacier2/Blobject.cpp b/cpp/src/Glacier2/Blobject.cpp
index 57bf70e55dd..9b19c3ef0a2 100644
--- a/cpp/src/Glacier2/Blobject.cpp
+++ b/cpp/src/Glacier2/Blobject.cpp
@@ -37,7 +37,6 @@ Glacier2::Blobject::destroy()
{
assert(_requestQueue); // Destroyed?
_requestQueue->destroy();
- _requestQueue->getThreadControl().join();
_requestQueue = 0;
}
diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp
index 413d4ad76af..05d77e09018 100644
--- a/cpp/src/Glacier2/Glacier2Router.cpp
+++ b/cpp/src/Glacier2/Glacier2Router.cpp
@@ -224,6 +224,18 @@ Glacier2::RouterService::initializeCommunicator(int& argc, char* argv[])
{
defaultProperties->setProperty("Ice.MonitorConnections", "60");
}
+
+ //
+ // If we have a session timeout, then we must use the same value
+ // also for request timeouts, otherwise sessions might expire, but
+ // sending of requests that are already queued for this session
+ // block indefinitely.
+ //
+ if(!defaultProperties->getProperty("Glacier2.SessionTimeout").empty())
+ {
+ defaultProperties->setProperty("Ice.Override.Timeout",
+ defaultProperties->getProperty("Glacier2.SessionTimeout"));
+ }
//
// We do not need to set Ice.RetryIntervals to -1, i.e., we do
diff --git a/cpp/src/Glacier2/RequestQueue.cpp b/cpp/src/Glacier2/RequestQueue.cpp
index 7b5ded132f9..3696a3ae0b1 100644
--- a/cpp/src/Glacier2/RequestQueue.cpp
+++ b/cpp/src/Glacier2/RequestQueue.cpp
@@ -146,13 +146,17 @@ Glacier2::RequestQueue::~RequestQueue()
void
Glacier2::RequestQueue::destroy()
{
- IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
-
- assert(!_destroy);
- _destroy = true;
- notify();
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
+
+ assert(!_destroy);
+ _destroy = true;
+ notify();
+
+ _requests.clear();
+ }
- _requests.clear();
+ getThreadControl().join();
}
void
diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp
index d47ef9f8609..9a87fe4d814 100644
--- a/cpp/src/Glacier2/RouterI.cpp
+++ b/cpp/src/Glacier2/RouterI.cpp
@@ -64,7 +64,9 @@ Glacier2::RouterI::destroy()
if(_serverBlobject)
{
+ cout << "xxxxx" << endl;
_serverBlobject->destroy();
+ cout << "yyyyy" << endl;
}
if(_session)
@@ -150,7 +152,10 @@ Glacier2::RouterI::getServerBlobject() const
throw ObjectNotExistException(__FILE__, __LINE__);
}
- _timestamp = IceUtil::Time::now();
+ //
+ // We do not update the timestamp for callbacks from the
+ // server. We only update the timestamp for client activity.
+ //
return _serverBlobject;
}
diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp
index ee6239c67e8..55c7133147f 100644
--- a/cpp/src/Glacier2/SessionRouterI.cpp
+++ b/cpp/src/Glacier2/SessionRouterI.cpp
@@ -439,7 +439,7 @@ Glacier2::SessionRouterI::run()
}
assert(_sessionTimeout > IceUtil::Time());
- timedWait(_sessionTimeout);
+ timedWait(_sessionTimeout / 4);
if(_destroy)
{
@@ -452,7 +452,7 @@ Glacier2::SessionRouterI::run()
while(p != _routersByConnection.end())
{
- if(minTimestamp < p->second->getTimestamp())
+ if(p->second->getTimestamp() < minTimestamp)
{
RouterIPtr router = p->second;
routers.push_back(router);
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index 98f283273dc..518784fac28 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -34,13 +34,13 @@ IceUtil::Handle<IceUtil::GC> theCollector = 0;
struct GarbageCollectorStats
{
GarbageCollectorStats() :
- runs(0), examined(0), collected(0), msec(0.0)
+ runs(0), examined(0), collected(0)
{
}
int runs;
int examined;
int collected;
- double msec;
+ IceUtil::Time time;
};
static int communicatorCount = 0;
@@ -52,19 +52,19 @@ static LoggerPtr gcLogger;
static int gcInterval;
static void
-printGCStats(const ::IceUtil::GCStats& stats)
+printGCStats(const IceUtil::GCStats& stats)
{
if(gcTraceLevel)
{
if(gcTraceLevel > 1)
{
Trace out(gcLogger, gcTraceCat);
- out << stats.collected << "/" << stats.examined << ", " << stats.msec << "ms";
+ out << stats.collected << "/" << stats.examined << ", " << stats.time.toMilliSeconds() << "ms";
}
++gcStats.runs;
gcStats.examined += stats.examined;
gcStats.collected += stats.collected;
- gcStats.msec += stats.msec;
+ gcStats.time += stats.time;
}
}
@@ -108,7 +108,7 @@ Ice::CommunicatorI::destroy()
{
Trace out(gcLogger, gcTraceCat);
out << "totals: " << gcStats.collected << "/" << gcStats.examined << ", "
- << gcStats.msec << "ms" << ", " << gcStats.runs << " run";
+ << gcStats.time.toMilliSeconds() << "ms" << ", " << gcStats.runs << " run";
if(gcStats.runs != 1)
{
out << "s";
diff --git a/cpp/src/IceUtil/GC.cpp b/cpp/src/IceUtil/GC.cpp
index f616f344d13..736fa490202 100644
--- a/cpp/src/IceUtil/GC.cpp
+++ b/cpp/src/IceUtil/GC.cpp
@@ -240,7 +240,7 @@ IceUtil::GC::collectGarbage()
if(_statsCallback)
{
- stats.msec = (Time::now() - t) * 1000.0L;
+ stats.time = Time::now() - t;
stats.collected = counts.size();
_statsCallback(stats);
}
diff --git a/cpp/src/IceUtil/Time.cpp b/cpp/src/IceUtil/Time.cpp
index 9e3a1bbde93..934012f16bc 100644
--- a/cpp/src/IceUtil/Time.cpp
+++ b/cpp/src/IceUtil/Time.cpp
@@ -63,11 +63,6 @@ IceUtil::Time::operator timeval() const
return tv;
}
-IceUtil::Time::operator double() const
-{
- return _usec / 1000000.0L;
-}
-
Int64
IceUtil::Time::toSeconds() const
{