Storage Engine API
health_log.h
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include "mongo/base/disallow_copying.h"
33 #include "mongo/db/service_context.h"
34 
35 namespace mongo {
36 
37 class HealthLogEntry;
38 
46 class HealthLog {
48 
49 public:
55  HealthLog();
56 
60  static const int64_t kMaxBufferSize = 25'000'000;
61 
65  void startup(void);
66 
70  void shutdown(void);
71 
75  static const NamespaceString nss;
76 
80  static HealthLog& get(ServiceContext* ctx);
81  static HealthLog& get(OperationContext* ctx);
82 
88  bool log(const HealthLogEntry& entry);
89 
90 private:
92 };
93 }
void shutdown(void)
Stop the worker thread.
Definition: health_log.cpp:58
The interface to the local healthlog.
Definition: health_log.h:46
HealthLog()
Required to use HealthLog as a ServiceContext decorator.
Definition: health_log.cpp:52
DeferredWriter _writer
Definition: health_log.h:91
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
bool log(const HealthLogEntry &entry)
Asynchronously insert the given entry.
Definition: health_log.cpp:70
Provides an interface for asynchronously adding to a collection.
Definition: deferred_writer.h:58
static const int64_t kMaxBufferSize
The maximum size of the in-memory buffer of health-log entries, in bytes.
Definition: health_log.h:60
void startup(void)
Start the worker thread writing the buffer to the collection.
Definition: health_log.cpp:54
static const NamespaceString nss
The name of the collection.
Definition: health_log.h:75
MONGO_DISALLOW_COPYING(HealthLog)