Skip to content

Commit 05b1b2b

Browse files
meili-bors[bot]consoleLogItflevi29
authored
Merge #1890
1890: Add usedDatabaseSize field to stats type r=flevi29 a=consoleLogIt # Pull Request ## Related issue Fixes #1873 ## What does this PR do? Adds usedDatabaseSize metric to `Stats` type. - [x] Modify the stats API to include the usedDatabaseSize ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: consoleLogIt <[email protected]> Co-authored-by: F. Levi <[email protected]>
2 parents 4ccda00 + df7eb47 commit 05b1b2b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ export type IndexStats = {
791791

792792
export type Stats = {
793793
databaseSize: number;
794+
usedDatabaseSize: number;
794795
lastUpdate: string;
795796
indexes: {
796797
[index: string]: IndexStats;

tests/client.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
547547
const client = await getClient(permission);
548548
const response: Stats = await client.getStats();
549549
expect(response).toHaveProperty("databaseSize", expect.any(Number));
550+
expect(response).toHaveProperty("usedDatabaseSize", expect.any(Number));
550551
expect(response).toHaveProperty("lastUpdate"); // TODO: Could be null, find out why
551552
expect(response).toHaveProperty("indexes", expect.any(Object));
552553
});

0 commit comments

Comments
 (0)