From f324f676d37ae5d330beedc77268bbb954fe2cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 26 Nov 2019 13:14:53 +0100 Subject: [PATCH] EventIndex: Add a method to get the current disk usage of the index. --- src/indexing/BaseEventIndexManager.js | 7 +++++++ src/indexing/EventIndex.js | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/indexing/BaseEventIndexManager.js b/src/indexing/BaseEventIndexManager.js index 5e8ca668ad..733dc05dd6 100644 --- a/src/indexing/BaseEventIndexManager.js +++ b/src/indexing/BaseEventIndexManager.js @@ -117,6 +117,13 @@ export default class BaseEventIndexManager { throw new Error("Unimplemented"); } + /** + * Get the disk usage of the index + */ + async indexSize(): Promise { + throw new Error("Unimplemented"); + } + /** * Commit the previously queued up events to the index. * diff --git a/src/indexing/EventIndex.js b/src/indexing/EventIndex.js index c912e31fa5..ae738e5d4d 100644 --- a/src/indexing/EventIndex.js +++ b/src/indexing/EventIndex.js @@ -406,4 +406,9 @@ export default class EventIndex { const indexManager = PlatformPeg.get().getEventIndexingManager(); return indexManager.searchEventIndex(searchArgs); } + + async indexSize() { + const indexManager = PlatformPeg.get().getEventIndexingManager(); + return indexManager.indexSize(); + } }