![]() |
Storage Engine API
|
The interface to the local healthlog. More...
#include <health_log.h>
The interface to the local healthlog.
This class contains facilities for creating and asynchronously writing to the local healthlog collection. There should only be one instance of this class, initialized on startup and cleaned up on shutdown.
Public Member Functions | |
HealthLog () | |
Required to use HealthLog as a ServiceContext decorator. More... | |
void | startup (void) |
Start the worker thread writing the buffer to the collection. More... | |
void | shutdown (void) |
Stop the worker thread. More... | |
bool | log (const HealthLogEntry &entry) |
Asynchronously insert the given entry. More... | |
Static Public Member Functions | |
static HealthLog & | get (ServiceContext *ctx) |
Get the current context's HealthLog. More... | |
static HealthLog & | get (OperationContext *ctx) |
Static Public Attributes | |
static const int64_t | kMaxBufferSize = 25'000'000 |
The maximum size of the in-memory buffer of health-log entries, in bytes. More... | |
static const NamespaceString | nss |
The name of the collection. More... | |
Private Member Functions | |
MONGO_DISALLOW_COPYING (HealthLog) | |
Private Attributes | |
DeferredWriter | _writer |
mongo::HealthLog::HealthLog | ( | ) |
Required to use HealthLog as a ServiceContext decorator.
Should not be used anywhere else.
|
static |
Get the current context's HealthLog.
|
static |
bool mongo::HealthLog::log | ( | const HealthLogEntry & | entry | ) |
Asynchronously insert the given entry.
Return false
iff there is no more space in the buffer.
|
private |
Start the worker thread writing the buffer to the collection.
|
private |
|
static |
The maximum size of the in-memory buffer of health-log entries, in bytes.
|
static |
The name of the collection.