From 3fe218a14adaca07da20fbfdac84e91b35afac92 Mon Sep 17 00:00:00 2001 From: sage Date: Mon, 11 Jul 2005 21:08:32 +0000 Subject: [PATCH] client logs git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@448 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/client/Client.cc | 10 ++++++++++ ceph/client/Client.h | 4 ++++ ceph/tcpsyn.cc | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/ceph/client/Client.cc b/ceph/client/Client.cc index 64680dec00d9c..497e1f0241b47 100644 --- a/ceph/client/Client.cc +++ b/ceph/client/Client.cc @@ -18,6 +18,7 @@ #include "common/Cond.h" #include "common/Mutex.h" +#include "common/Logger.h" #include "include/config.h" #undef dout @@ -26,6 +27,9 @@ #define tout if (g_conf.client_trace) cout << "trace: " +// static logger +LogType client_logtype; +Logger *client_logger = 0; @@ -359,9 +363,15 @@ MClientReply *Client::make_request(MClientRequest *req, // drop mutex for duration of call client_lock.Unlock(); + timepair_t start = g_clock.gettimepair(); MClientReply *reply = (MClientReply*)messenger->sendrecv(req, MSG_ADDR_MDS(mds), MDS_PORT_SERVER); + timepair_t end = g_clock.gettimepair(); + timepair_t lat = end - start; + client_logger->finc("lsum",timepair_to_double(lat)); + client_logger->inc("lnum"); + client_lock.Lock(); return reply; } diff --git a/ceph/client/Client.h b/ceph/client/Client.h index e038b12b26592..169562514d079 100644 --- a/ceph/client/Client.h +++ b/ceph/client/Client.h @@ -33,6 +33,10 @@ using namespace __gnu_cxx; class Filer; +extern class LogType client_logtype; +extern class Logger *client_logger; + + // ============================================ // types for my local metadata cache diff --git a/ceph/tcpsyn.cc b/ceph/tcpsyn.cc index a1e7dec2a8767..f6476a1d19a42 100644 --- a/ceph/tcpsyn.cc +++ b/ceph/tcpsyn.cc @@ -181,6 +181,13 @@ int main(int oargc, char **oargv) { for (int i=0; iinit(); // use my argc, argv (make sure you pass a mount point!) -- 2.39.5