35 #ifndef _uhal_tests_tools_hpp_ 36 #define _uhal_tests_tools_hpp_ 45 #include <boost/scoped_ptr.hpp> 46 #include <boost/thread/thread.hpp> 57 class DummyHardwareInterface;
64 void setReplyDelay (
const boost::chrono::microseconds& aDelay);
67 boost::scoped_ptr<DummyHardwareInterface>
mHw;
79 gettimeofday ( &m_start, NULL );
86 gettimeofday ( &now, NULL );
87 time_t
sec = now.tv_sec - m_start.tv_sec;
88 suseconds_t
usec = now.tv_usec - m_start.tv_usec;
89 return static_cast<double> ( sec + usec/1000000. );
100 double measureReadLatency(
const std::vector<ClientInterface*>& aClients, uint32_t aBaseAddr, uint32_t aDepth,
size_t aNrIterations,
bool aDispatchEachIteration,
bool aVerbose);
104 double measureWriteLatency(
const std::vector<ClientInterface*>& aClients, uint32_t aBaseAddr, uint32_t aDepth,
size_t aNrIterations,
bool aDispatchEachIteration,
bool aVerbose);
106 double measureFileReadLatency(
const std::string& aFilePath, uint32_t aBaseAddr, uint32_t aDepth,
size_t aNrIterations,
bool aVerbose);
108 double measureFileWriteLatency(
const std::string& aFilePath, uint32_t aBaseAddr, uint32_t aDepth,
size_t aNrIterations,
bool aVerbose);
DummyHardwareRunner(DummyHardwareInterface *aHw)
double measureFileReadLatency(const std::string &aFilePath, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aVerbose)
double measureReadLatency(ClientInterface &aClient, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aDispatchEachIteration, bool aVerbose)
boost::scoped_ptr< DummyHardwareInterface > mHw
double measureWriteLatency(ClientInterface &aClient, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aDispatchEachIteration, bool aVerbose)
Common abstract base class for IPbus 1.3 and 2.0 dummy hardware.
void setReplyDelay(const boost::chrono::microseconds &aDelay)
seconds past the minute formatted as two digits e.g.
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
microseconds past the second formatted as exactly six digits e.g.
double measureFileWriteLatency(const std::string &aFilePath, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aVerbose)
double elapsedSeconds()
Returns number of elapsed seconds since the timer was instantiated.