Commit a54e06e8 authored by Chris Toshok's avatar Chris Toshok

add a timer for the active lifetime of an unwind session, and a number of unwind sessions

parent 21ccf4c9
......@@ -479,11 +479,12 @@ class PythonUnwindSession : public Box {
ExcInfo exc_info;
bool skip;
bool is_active;
Timer t;
public:
DEFAULT_CLASS_SIMPLE(unwind_session_cls);
PythonUnwindSession() : exc_info(NULL, NULL, NULL), skip(false), is_active(false) {}
PythonUnwindSession() : exc_info(NULL, NULL, NULL), skip(false), is_active(false), t(/*min_usec=*/10000) {}
ExcInfo* getExcInfoStorage() {
RELEASE_ASSERT(is_active, "");
......@@ -498,10 +499,17 @@ public:
exc_info = ExcInfo(NULL, NULL, NULL);
skip = false;
is_active = true;
t.restart();
static StatCounter stat("unwind_sessions");
stat.log();
}
void end() {
RELEASE_ASSERT(is_active, "");
is_active = false;
static StatCounter stat("us_unwind_session");
stat.log(t.end());
}
void addTraceback(const LineInfo& line_info) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment