Skip to content

Commit 4ccda00

Browse files
Merge #1889
1889: Add documents database metrics to indexStats type r=flevi29 a=consoleLogIt # Pull Request ## Related issue Fixes #1875 ## What does this PR do? adds the documents database metrics to `indexStats` type. - [x] Modify the stats API to include indexes.INDEXNAME.rawDocumentDbSize - [x] Modify the stats API to include indexes.INDEXNAME.avgDocumentSize ## 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]>
2 parents 0a0217e + ad9939c commit 4ccda00

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,8 @@ export type IndexStats = {
785785
fieldDistribution: FieldDistribution;
786786
numberOfEmbeddedDocuments: number;
787787
numberOfEmbeddings: number;
788+
rawDocumentDbSize: number;
789+
avgDocumentSize: number;
788790
};
789791

790792
export type Stats = {

tests/index.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
367367
expect(response).toHaveProperty("fieldDistribution", {});
368368
expect(response).toHaveProperty("numberOfEmbeddedDocuments", 0);
369369
expect(response).toHaveProperty("numberOfEmbeddings", 0);
370+
expect(response).toHaveProperty("rawDocumentDbSize", 0);
371+
expect(response).toHaveProperty("avgDocumentSize", 0);
370372
});
371373

372374
test(`${permission} key: Get updatedAt and createdAt through fetch info`, async () => {

0 commit comments

Comments
 (0)