diff options
Diffstat (limited to 'src/mongo/db/storage/recovery_unit.h')
| -rw-r--r-- | src/mongo/db/storage/recovery_unit.h | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/src/mongo/db/storage/recovery_unit.h b/src/mongo/db/storage/recovery_unit.h index a67d1f090f5..eb032f73d4e 100644 --- a/src/mongo/db/storage/recovery_unit.h +++ b/src/mongo/db/storage/recovery_unit.h @@ -37,6 +37,7 @@ #include "mongo/bson/timestamp.h" #include "mongo/db/repl/read_concern_level.h" #include "mongo/db/storage/snapshot.h" +#include "mongo/db/storage/storage_stats.h" #include "mongo/util/decorable.h" namespace mongo { @@ -76,37 +77,6 @@ enum class PrepareConflictBehavior { }; /** - * Storage statistics management class, with interfaces to provide the statistics in the BSON format - * and an operator to add the statistics values. - */ -class StorageStats { - StorageStats(const StorageStats&) = delete; - StorageStats& operator=(const StorageStats&) = delete; - -public: - StorageStats() = default; - - virtual ~StorageStats(){}; - - /** - * Provides the storage statistics in the form of a BSONObj. - */ - virtual BSONObj toBSON() = 0; - - /** - * Add the statistics values. - */ - virtual StorageStats& operator+=(const StorageStats&) = 0; - - /** - * Provides the ability to create an instance of this class outside of the storage integration - * layer. - */ - virtual std::shared_ptr<StorageStats> getCopy() = 0; -}; - - -/** * A RecoveryUnit is responsible for ensuring that data is persisted. * All on-disk information must be mutated through this interface. */ @@ -406,9 +376,10 @@ public: } /** - * Fetches the storage level statistics. + * Computes the storage level statistics accrued since the last call to this function, or + * since the recovery unit was instantiated. Should be called at the end of each operation. */ - virtual std::shared_ptr<StorageStats> getOperationStatistics() const { + virtual std::unique_ptr<StorageStats> computeOperationStatisticsSinceLastCall() { return (nullptr); } |
