Skip to content

Add usedDatabaseSize to stats, document and embeddings database metrics to index stats #830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/main/java/com/meilisearch/sdk/model/IndexStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,27 @@ public class IndexStats {
protected long numberOfDocuments;
protected boolean isIndexing;
protected Map<String, Integer> fieldDistribution;
protected long rawDocumentDbSize;
protected long avgDocumentSize;
protected long numberOfEmbeddedDocuments;
protected long numberOfEmbeddings;

public IndexStats() {}

public IndexStats(
long numberOfDocuments, boolean isIndexing, Map<String, Integer> fieldDistribution) {
long numberOfDocuments,
boolean isIndexing,
Map<String, Integer> fieldDistribution,
long rawDocumentDbSize,
long avgDocumentSize,
long numberOfEmbeddedDocuments,
long numberOfEmbeddings) {
this.numberOfDocuments = numberOfDocuments;
this.isIndexing = isIndexing;
this.fieldDistribution = fieldDistribution;
this.rawDocumentDbSize = rawDocumentDbSize;
this.avgDocumentSize = avgDocumentSize;
this.numberOfEmbeddedDocuments = numberOfEmbeddedDocuments;
this.numberOfEmbeddings = numberOfEmbeddings;
}
}
8 changes: 7 additions & 1 deletion src/main/java/com/meilisearch/sdk/model/Stats.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ public class Stats {
protected long databaseSize;
protected Date lastUpdate;
protected Map<String, IndexStats> indexes;
protected long usedDatabaseSize;

public Stats(long databaseSize, Date lastUpdate, Map<String, IndexStats> indexes) {
public Stats(
long databaseSize,
Date lastUpdate,
Map<String, IndexStats> indexes,
long usedDatabaseSize) {
this.databaseSize = databaseSize;
this.lastUpdate = lastUpdate;
this.indexes = indexes;
this.usedDatabaseSize = usedDatabaseSize;
}

public Stats() {}
Expand Down