store/info: Gather some usage statistics

Keep track of the latest-change/latest-index.
This commit is contained in:
Dirk-Jan C. Binnema
2022-05-10 08:16:47 +03:00
parent c8e995ed15
commit 2e9666af0b
5 changed files with 117 additions and 59 deletions

View File

@ -138,6 +138,27 @@ public:
* @return the metadata
*/
const Properties& properties() const;
/**
* Store statistics. Unlike the properties, these can change
* during the lifetime of a store.
*
*/
struct Statistics {
size_t size; /**< number of messages in store */
::time_t last_change; /**< last time any update happened */
::time_t last_index; /**< last time an indexing op was performed */
};
/**
* Get store statistics
*
* @return statistics
*/
Statistics statistics() const;
/**
* Get the ContactsCache object for this store
*
@ -434,6 +455,13 @@ private:
const StringVec& personal_addresses,
const Config& conf);
/**
* Call with indexing has completed to update metadata.
*/
friend class Indexer;
void index_complete();
std::unique_ptr<Private> priv_;
};