#
39206c2e |
| 08-May-2018 |
Dave Rigby <daver@couchbase.com> |
Add timed lockguard support Add support for recording mutex wait and held times; but *only* if either time exceeds a given threshold. Identifying mutex contention (where one thr
Add timed lockguard support Add support for recording mutex wait and held times; but *only* if either time exceeds a given threshold. Identifying mutex contention (where one thread is waiting a long time) is extremely useful in tracking down performance issues, however the median times are typically fast, and so if we logged events for all mutex locks we'd quickly consume the whole trace log. Instead, if we only record trace events for locks which are slower than some limit, we can discount much of the "noise" and focus on the signal. This patch also renames "lock.acquire" to "lock.wait" as IMHO that's a clearer (and more concise) name for that the span represents. Note that care must still be taken in using these macros, as each one requires 3x calls to steady_clock::now(); even if no trace_event is recorded. As such, consider adding to a non-default category, and only enabling on-demand. Change-Id: I4884cd8a2e4381ab16fb9ecfab0478546d52f0ef Reviewed-on: http://review.couchbase.org/93889 Reviewed-by: Trond Norbye <trond.norbye@gmail.com> Tested-by: Build Bot <build@couchbase.com>
show more ...
|
#
195e116e |
| 08-May-2018 |
Dave Rigby <daver@couchbase.com> |
Use Complete event type for scoped events Use the new Complete trace type to implement the scoped (TRACE_EVENT* / TRACE_FUNCTION*) event macros. This reduces the number of TraceEvent
Use Complete event type for scoped events Use the new Complete trace type to implement the scoped (TRACE_EVENT* / TRACE_FUNCTION*) event macros. This reduces the number of TraceEvent objects needed for these events by half; well worth the modest (1 word) increase in size to support Complete events (needed to add 64bit duration field). Implemented by adding a RAII-style ScopedEventGuard class; which captures the arguments for a trace event, and if enabled logs the event in it's destructor. Note this change required the removal of the TRACE_EVENT() (varargs) macro; as we now need to capture the types of the args (as the call to logEvent() happens at the end of the scope). Change-Id: I975927385616887a26ea8f894a1d06c08e322ecf Reviewed-on: http://review.couchbase.org/93879 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Tim Bradgate <tim.bradgate@couchbase.com>
show more ...
|