Similar to XLOG(...) except only log a message every

Synopsis

Declared in <folly/logging/xlog.h>

#define XLOG_EVERY_N_THREAD(level, n, …​)

Description

The internal counter is thread‐local, avoiding the contention which the XLOG_EVERY_N variations which use a global counter may suffer. If a given XLOG_EVERY_N or variation expansion is encountered concurrently by multiple threads in a hot code path and the global counter in the expansion is observed to be contended, then switching to XLOG_EVERY_N_THREAD can help.

Every thread that invokes this expansion has a counter for this expansion. The internal counters are all stored in a single thread‐local map to control TLS overhead, at the cost of a small runtime performance hit.

Parameters

Name

Description

n

invocations per thread.

level

The folly::LogLevel value at which to log.

Created with MrDocs