From: sage Date: Mon, 13 Jun 2005 15:25:21 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.1~2077 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d2197ce79e4567879ed8334fb1f1521a243e64f3;p=ceph.git *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@304 29311d96-e01e-0410-9327-a35deaab8ce9 --- diff --git a/ceph/Makefile b/ceph/Makefile index 27e7ebba588..011828d92bd 100644 --- a/ceph/Makefile +++ b/ceph/Makefile @@ -51,6 +51,8 @@ all: depend ${TARGETS} test: depend ${TEST_TARGETS} +gprof-helper.so: test/gprof-helper.c + gcc -shared -fPIC test/gprof-helper.c -o gprof-helper.so -lpthread -ldl import: mds/allmds.o osd/OSD.o msg/FakeMessenger.o import.cc ${COMMON_OBJS} ${CC} ${CFLAGS} ${LIBS} $^ -o $@ diff --git a/ceph/TODO b/ceph/TODO index eca841465b9..4a586285a17 100644 --- a/ceph/TODO +++ b/ceph/TODO @@ -1,7 +1,7 @@ !!! -- make mds shut down with mds_commit_on_shutdown=0 and/or mds_log_flush_on_shutdown=0. - test mds scaling w/ makedirs, vs mds_log_on_request +- client needs to choose MDS intelligently - finish osd replication MOSDOp groundwork diff --git a/ceph/client/SyntheticClient.cc b/ceph/client/SyntheticClient.cc index 5129a36d9ed..8e9ad174866 100644 --- a/ceph/client/SyntheticClient.cc +++ b/ceph/client/SyntheticClient.cc @@ -169,7 +169,7 @@ int SyntheticClient::write_file(string& fn, int size, int wrsize) // size is i { //__uint64_t wrsize = 1024*256; char *buf = new char[wrsize]; // 1 MB - __uint64_t chunks = (__uint64_t)size * (uint64_t)(1024*1024) / (__uint64_t)wrsize; + __uint64_t chunks = (__uint64_t)size * (__uint64_t)(1024*1024) / (__uint64_t)wrsize; int fd = client->open(fn.c_str(), O_WRONLY|O_CREAT); dout(5) << "writing to " << fn << " fd " << fd << endl; diff --git a/ceph/common/DecayCounter.h b/ceph/common/DecayCounter.h index 9b8878d0133..e5cb69ee693 100644 --- a/ceph/common/DecayCounter.h +++ b/ceph/common/DecayCounter.h @@ -16,11 +16,11 @@ class DecayCounter { timepair_t last_decay; // time of last decay public: - DecayCounter() { + DecayCounter() : val(0) { set_halflife( 10.0 ); reset(); } - DecayCounter(double hl) { + DecayCounter(double hl) : val(0) { set_halflife(hl); reset(); } @@ -46,12 +46,13 @@ class DecayCounter { } void decay(const timepair_t& now) { - double el = timepair_to_double(now) - timepair_to_double(last_decay); - if (el > .5) { - val = val * exp(el * k); + timepair_t el = now; + el -= last_decay; + if (el.first > 1) { + val = val * exp(timepair_to_double(el) * k); + if (val < .01) val = 0; last_decay = now; } - if (val < .01) val = 0; } double get(const timepair_t& now) { diff --git a/ceph/common/Logger.cc b/ceph/common/Logger.cc index 8d847d8a02a..1e1749ca3d4 100644 --- a/ceph/common/Logger.cc +++ b/ceph/common/Logger.cc @@ -18,7 +18,7 @@ Logger::Logger(string fn, LogType *type) filename += "/"; } filename += fn; - cout << "log " << filename << endl; + //cout << "log " << filename << endl; interval = g_conf.log_interval; start = g_clock.gettimepair(); // time 0! last_logged = 0; @@ -75,10 +75,10 @@ long Logger::get(string& key) void Logger::flush(bool force) { timepair_t now = g_clock.gettimepair(); - double fromstart = timepair_to_double(now - start); + timepair_t fromstart = now - start; while (force || - fromstart - last_logged >= interval) { + fromstart.first - last_logged >= interval) { last_logged += interval; force = false; diff --git a/ceph/common/Logger.h b/ceph/common/Logger.h index e9bb0ad3245..b2b9d815018 100644 --- a/ceph/common/Logger.h +++ b/ceph/common/Logger.h @@ -18,8 +18,8 @@ class Logger { LogType *type; timepair_t start; - double last_logged; - double interval; + int last_logged; + int interval; int wrote_header; string filename; diff --git a/ceph/config.cc b/ceph/config.cc index db30f6014cf..8e29c998249 100644 --- a/ceph/config.cc +++ b/ceph/config.cc @@ -18,7 +18,7 @@ md_config_t g_conf = { // profiling and debugging log_messages: true, - log_interval: 10.0, + log_interval: 10, log_name: 0, fake_clock: false, diff --git a/ceph/config.h b/ceph/config.h index 81ffc80ff58..80e05573a51 100644 --- a/ceph/config.h +++ b/ceph/config.h @@ -9,7 +9,7 @@ struct md_config_t { // profiling bool log_messages; - float log_interval; + int log_interval; char *log_name; bool fake_clock;