struct req_state *s;
string req_str;
RGWOp *op;
+ utime_t ts;
- RGWRequest() : id(0), s(NULL), op(NULL) {}
+ RGWRequest() : id(0), s(NULL), op(NULL) {
+ ts = ceph_clock_now(g_ceph_context);
+ }
~RGWRequest() {
delete s;
log(s, buf);
}
+ uint64_t timestamp() {
+ utime_t t = ceph_clock_now(g_ceph_context) - ts;
+ return t.sec() * (1000000LL) + t.usec();
+ }
void log(struct req_state *s, const char *msg) {
if (s->method && req_str.size() == 0) {
}
req_str.append(s->request_uri);
}
- dout(1) << "r" << id << ":" << s->dialect << ":" << req_str << ":" << (op ? op->name() : "") << ":" << msg << dendl;
+ utime_t t = ceph_clock_now(g_ceph_context) - ts;
+ dout(1) << "req " << id << ":" << t << ":" << s->dialect << ":" << req_str << ":" << (op ? op->name() : "") << ":" << msg << dendl;
}
};