Storage Engine API
mongo::HealthLog Class Reference

The interface to the local healthlog. More...

#include <health_log.h>

Detailed Description

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 HealthLogget (ServiceContext *ctx)
 Get the current context's HealthLog. More...
 
static HealthLogget (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
 

Constructor & Destructor Documentation

◆ HealthLog()

mongo::HealthLog::HealthLog ( )

Required to use HealthLog as a ServiceContext decorator.

Should not be used anywhere else.

Member Function Documentation

◆ get() [1/2]

HealthLog & mongo::HealthLog::get ( ServiceContext *  ctx)
static

Get the current context's HealthLog.

◆ get() [2/2]

HealthLog & mongo::HealthLog::get ( OperationContext *  ctx)
static

◆ log()

bool mongo::HealthLog::log ( const HealthLogEntry &  entry)

Asynchronously insert the given entry.

Return false iff there is no more space in the buffer.

◆ MONGO_DISALLOW_COPYING()

mongo::HealthLog::MONGO_DISALLOW_COPYING ( HealthLog  )
private

◆ shutdown()

void mongo::HealthLog::shutdown ( void  )

Stop the worker thread.

◆ startup()

void mongo::HealthLog::startup ( void  )

Start the worker thread writing the buffer to the collection.

Member Data Documentation

◆ _writer

DeferredWriter mongo::HealthLog::_writer
private

◆ kMaxBufferSize

const int64_t mongo::HealthLog::kMaxBufferSize = 25'000'000
static

The maximum size of the in-memory buffer of health-log entries, in bytes.

◆ nss

const NamespaceString mongo::HealthLog::nss
static

The name of the collection.


The documentation for this class was generated from the following files: