summaryrefslogtreecommitdiffstats
path: root/rasmgr
diff options
context:
space:
mode:
authorPeter Baumann <p.baumann@jacobs-university.de>2010-07-27 08:59:55 +0200
committerwww-data <www-data@ubuntu.localdomain>2010-07-30 11:08:03 +0200
commit437ff942525f86a36655519cea0f5a03da319cd7 (patch)
treee8b29697ca4561311fbec58d5f71f7ee521c2533 /rasmgr
parent18b61341d3c0f597ef71af2dc33769277defe9d5 (diff)
downloadrasdaman-upstream-437ff942525f86a36655519cea0f5a03da319cd7.tar.gz
rasdaman-upstream-437ff942525f86a36655519cea0f5a03da319cd7.tar.xz
rasdaman-upstream-437ff942525f86a36655519cea0f5a03da319cd7.zip
PB: improved benchmark output
Diffstat (limited to 'rasmgr')
-rw-r--r--rasmgr/Makefile.am6
-rw-r--r--rasmgr/rasmgr_config.cc54
-rw-r--r--rasmgr/rasmgr_main.cc6
-rw-r--r--rasmgr/rasmgr_master_nb.cc2
4 files changed, 8 insertions, 60 deletions
diff --git a/rasmgr/Makefile.am b/rasmgr/Makefile.am
index f4b54e0..120d24f 100644
--- a/rasmgr/Makefile.am
+++ b/rasmgr/Makefile.am
@@ -32,8 +32,10 @@ rasmgr_SOURCES=ras_crypto.cc rasmgr_config.cc rasmgr_host.cc rasmgr_main.cc rasm
ras_crypto.hh rasmgr_config.hh rasmgr_host.hh rasmgr_rascontrol.hh rasmgr_srv.hh \
rasmgr_comm.hh rasmgr_dbm.hh \
rasmgr_users.hh rasmgr_comm_nb.hh rasmgr_error.hh rasmgr_localsrv.hh \
- rasmgr.hh rasmgr_protocol.hh rasmgr_master.hh
-rasmgr_LDADD=../network/libnetwork.a ../commline/libcommline.a
+ rasmgr.hh rasmgr_protocol.hh rasmgr_master.hh \
+ ../mymalloc/mymalloc_cln.cc ../mymalloc/mymalloc.h
+
+rasmgr_LDADD= ../raslib/libraslib.a ../network/libnetwork.a ../commline/libcommline.a
SUBDIRS=../network ../commline
diff --git a/rasmgr/rasmgr_config.cc b/rasmgr/rasmgr_config.cc
index 4919975..24d1130 100644
--- a/rasmgr/rasmgr_config.cc
+++ b/rasmgr/rasmgr_config.cc
@@ -508,57 +508,3 @@ void Configuration::printStatus()
return;
}
-//****************************************************************************************************************
-
-// FIXME: this needs refinement -- PB 2003-jun-09
-BenchmarkTimer::BenchmarkTimer(const char *text)
-{
- this->text = (char*)text;
- time_t now = time(NULL);
- char *n = ctime(&now);
- n[strlen(n)-1] = '\0'; // delete trailing newline char
- // cout << "--- rasmgr timer start for \'" << text << "\' at " << n << "." << endl;
- gettimeofday(&start,NULL);
-}
-
-BenchmarkTimer::~BenchmarkTimer()
-{
-}
-
-void BenchmarkTimer::result()
-{
- timeval result;
- gettimeofday(&end,NULL);
- int r=timeval_subtract(&result,&end,&start);
- time_t now = time(NULL);
- char *n = ctime(&now);
- n[strlen(n)-1] = '\0'; // delete trailing newline char
- VLOG << "rasmgr timer stop for \'" << text << "\' at " << n << ": " << result.tv_sec << '.' << std::setw(3) << std::setfill('0') << result.tv_usec << " seconds elapsed." << endl;
-}
-
-int BenchmarkTimer::timeval_subtract(timeval *result,timeval *x,timeval *y)
-{
-#define ONE_MILLION 1000000
- /* Perform the carry for the later subtraction by updating Y. */
- if (x->tv_usec < y->tv_usec)
- {
- int nsec = (y->tv_usec - x->tv_usec) / ONE_MILLION + 1;
- y->tv_usec -= ONE_MILLION * nsec;
- y->tv_sec += nsec;
- }
- if (x->tv_usec - y->tv_usec > ONE_MILLION)
- {
- int nsec = (x->tv_usec - y->tv_usec) / ONE_MILLION;
- y->tv_usec += ONE_MILLION * nsec;
- y->tv_sec -= nsec;
- }
-
- /* Compute the time remaining to wait.
- `tv_usec' is certainly positive. */
- result->tv_sec = x->tv_sec - y->tv_sec;
- result->tv_usec = x->tv_usec - y->tv_usec;
-
- /* Return 1 if result is negative. */
- return x->tv_sec < y->tv_sec;
-}
-
diff --git a/rasmgr/rasmgr_main.cc b/rasmgr/rasmgr_main.cc
index f9b553a..6280cbf 100644
--- a/rasmgr/rasmgr_main.cc
+++ b/rasmgr/rasmgr_main.cc
@@ -57,10 +57,12 @@ and -DCOMPDATE="\"$(COMPDATE)\"" when compiling
*/
#endif
+#include "raslib/rmdebug.hh"
#define DEBUG_MAIN
#undef DEBUG_HH
#include "debug.hh"
+RMINITGLOBALS('S');
Configuration config;
@@ -163,13 +165,9 @@ int main(int argc, char** argv, char** envp)
try
{
- BenchmarkTimer *totalTimePtr = new BenchmarkTimer("Total master time");
-
TALK( "launching masterCommunicator.Run()..." );
masterCommunicator.Run(); // central request handling loop
TALK( "masterCommunicator.Run() done." );
-
- totalTimePtr->result(); // print total time elapsed
}
catch(RCError& e)
{
diff --git a/rasmgr/rasmgr_master_nb.cc b/rasmgr/rasmgr_master_nb.cc
index 42e1cb4..7cedf72 100644
--- a/rasmgr/rasmgr_master_nb.cc
+++ b/rasmgr/rasmgr_master_nb.cc
@@ -48,6 +48,7 @@ rasdaman GmbH.
using namespace std;
+#include "raslib/rmdebug.hh"
#include "debug.hh"
@@ -96,6 +97,7 @@ MasterComm::~MasterComm()
void MasterComm::Run()
{
ENTER("MasterComm::Run: enter." );
+ RMTIMER( "MasterComm", "Run" ); // benchmark this routine, if enabled
initListenSocket(config.getListenPort()); // connect/bind the central listen socket
// using IOSelector level here!