From 5711b3a2b708a2edff7709c88b900374847b1477 Mon Sep 17 00:00:00 2001 From: sage Date: Wed, 13 Jul 2005 19:38:02 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@461 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/client/Client.cc | 21 +++++++++++++++++++++ ceph/client/SyntheticClient.cc | 20 +++++++++++++++++++- ceph/mds/IdAllocator.cc | 4 ++-- ceph/mds/MDBalancer.cc | 4 ++-- ceph/script/sum.pl | 17 ++++++++++------- 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/ceph/client/Client.cc b/ceph/client/Client.cc index 8e115f318071..9dde53e0af22 100644 --- a/ceph/client/Client.cc +++ b/ceph/client/Client.cc @@ -364,15 +364,36 @@ MClientReply *Client::make_request(MClientRequest *req, // drop mutex for duration of call client_lock.Unlock(); timepair_t start = g_clock.gettimepair(); + + + bool nojournal = false; + if (req->get_op() == MDS_OP_STAT || + req->get_op() == MDS_OP_LSTAT || + req->get_op() == MDS_OP_READDIR || + req->get_op() == MDS_OP_OPEN || // not quite true! a lie actually! + req->get_op() == MDS_OP_CLOSE) + nojournal = true; + MClientReply *reply = (MClientReply*)messenger->sendrecv(req, MSG_ADDR_MDS(mds), MDS_PORT_SERVER); + + if (client_logger) { timepair_t end = g_clock.gettimepair(); timepair_t lat = end - start; client_logger->finc("lsum",timepair_to_double(lat)); client_logger->inc("lnum"); + + if (nojournal) { + client_logger->finc("lrsum",timepair_to_double(lat)); + client_logger->inc("lrnum"); + } else { + client_logger->finc("lwsum",timepair_to_double(lat)); + client_logger->inc("lwnum"); + } } + client_lock.Lock(); return reply; } diff --git a/ceph/client/SyntheticClient.cc b/ceph/client/SyntheticClient.cc index 9b02c8237e68..5abc34ccc382 100644 --- a/ceph/client/SyntheticClient.cc +++ b/ceph/client/SyntheticClient.cc @@ -148,10 +148,24 @@ int SyntheticClient::run() client->mkdir(prefix.c_str(), 0755); for (int i=0; i 0 + && i < iarg1-1 + ) { + client_logger->finc("trsum", timepair_to_double(lat)); + client_logger->inc("trnum"); + } } } break; @@ -211,6 +225,7 @@ int SyntheticClient::run() play_trace(t, prefix); if (time_to_stop()) break; clean_dir(prefix); + cerr << "LOOP" << endl; } } break; @@ -288,6 +303,8 @@ int SyntheticClient::play_trace(Trace& t, string& prefix) dout(4) << "play trace" << endl; t.start(); + timepair_t start = g_clock.gettimepair(); + const char *p = prefix.c_str(); map<__int64_t, __int64_t> open_files; @@ -398,8 +415,9 @@ int SyntheticClient::play_trace(Trace& t, string& prefix) fi != open_files.end(); fi++) { dout(1) << "leftover close " << fi->second << endl; - client->close(fi->second); + if (fi->second > 0) client->close(fi->second); } + } diff --git a/ceph/mds/IdAllocator.cc b/ceph/mds/IdAllocator.cc index 3fcce8515e5e..0e2432bb5d3b 100644 --- a/ceph/mds/IdAllocator.cc +++ b/ceph/mds/IdAllocator.cc @@ -107,8 +107,8 @@ void IdAllocator::reset() (long long)100000000LL * (mds->get_nodeid()+2) - 1); //free[ID_INO].dump(); - free[ID_FH].map_insert(1000000LL * (mds->get_nodeid()+1), - 1000000LL * (mds->get_nodeid()+2) - 1); + free[ID_FH].map_insert(10000000LL * (mds->get_nodeid()+1), + 10000000LL * (mds->get_nodeid()+2) - 1); //free[ID_FH].dump(); opened = true; diff --git a/ceph/mds/MDBalancer.cc b/ceph/mds/MDBalancer.cc index 2e7b82b7478c..cf4a5a0bc951 100644 --- a/ceph/mds/MDBalancer.cc +++ b/ceph/mds/MDBalancer.cc @@ -577,7 +577,7 @@ void MDBalancer::hit_recursive(CDir *dir, timepair_t& now) if (!dir->is_rep() && dir_pop >= g_conf.mds_bal_replicate_threshold) { // replicate - dout(5) << "replicating dir " << *dir << " pop " << dir_pop << endl; + dout(1) << "replicating dir " << *dir << " pop " << dir_pop << endl; dir->dir_rep = CDIR_REP_ALL; mds->mdcache->send_dir_updates(dir, true); @@ -586,7 +586,7 @@ void MDBalancer::hit_recursive(CDir *dir, timepair_t& now) if (dir->is_rep() && dir_pop < g_conf.mds_bal_unreplicate_threshold) { // unreplicate - dout(5) << "unreplicating dir " << *dir << " pop " << dir_pop << endl; + dout(1) << "unreplicating dir " << *dir << " pop " << dir_pop << endl; dir->dir_rep = CDIR_REP_NONE; mds->mdcache->send_dir_updates(dir); diff --git a/ceph/script/sum.pl b/ceph/script/sum.pl index 5ca093112a3e..d4ff59f4589f 100755 --- a/ceph/script/sum.pl +++ b/ceph/script/sum.pl @@ -79,7 +79,8 @@ print join("\t",'#', map { $col{$_} } @c) . "\n"; my $n = 0; for my $k (sort {$a <=> $b} keys %sum) { if ($avgrows) { - print join("\t",$k, map int, map { $sum{$k}->{$col{$_}}/$tcount{$k} } @c ) . "\n"; + print join("\t",$k, #map int, + map { $sum{$k}->{$col{$_}}/$tcount{$k} } @c ) . "\n"; } else { print join("\t",$k, map { $sum{$k}->{$col{$_}} } @c ) . "\n"; } @@ -90,9 +91,11 @@ my $rows = $n; my $files = $tcount{$starttime}; print "\n"; -print join("\t", 'minval', map { $min{$col{$_}} } @c ) . "\n"; -print join("\t", 'maxval', map { $max{$col{$_}} } @c ) . "\n"; -print join("\t", 'rows', map { $rows } @c) . "\n"; -print join("\t", 'files', map { $files } @c) . "\n"; -print join("\t", 'avgval', map int, map { $_ / ($rows*$files) } map { $avg{$col{$_}} } @c ) . "\n"; -print join("\t", 'avgsum', map int, map { $_ / $rows } map { $avg{$col{$_}} } @c ) . "\n"; +print join("\t", '#minval', map { $min{$col{$_}} } @c ) . "\n"; +print join("\t", '#maxval', map { $max{$col{$_}} } @c ) . "\n"; +print join("\t", '#rows', map { $rows } @c) . "\n"; +print join("\t", '#files', map { $files } @c) . "\n"; +print join("\t", '#avgval', #map int, + map { $_ / ($rows*$files) } map { $avg{$col{$_}} } @c ) . "\n"; +print join("\t", '#avgsum', #map int, + map { $_ / $rows } map { $avg{$col{$_}} } @c ) . "\n"; -- 2.47.3