Skip to content

Add documents and embbedings database metrics to IndexStats #635

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
31 changes: 30 additions & 1 deletion src/Meilisearch/IndexStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ namespace Meilisearch
/// </summary>
public class IndexStats
{
public IndexStats(int numberOfDocuments, bool isIndexing, IReadOnlyDictionary<string, int> fieldDistribution)
public IndexStats(int numberOfDocuments, bool isIndexing, IReadOnlyDictionary<string, int> fieldDistribution, long rawDocumentDbSize, long avgDocumentSize, int numberOfEmbeddedDocuments, int numberOfEmbeddings)
{
NumberOfDocuments = numberOfDocuments;
IsIndexing = isIndexing;
FieldDistribution = fieldDistribution;
RawDocumentDbSize = rawDocumentDbSize;
AvgDocumentSize = avgDocumentSize;
NumberOfEmbeddedDocuments = numberOfEmbeddedDocuments;
NumberOfEmbeddings = numberOfEmbeddings;
}

/// <summary>
Expand All @@ -32,5 +36,30 @@ public IndexStats(int numberOfDocuments, bool isIndexing, IReadOnlyDictionary<st
/// </summary>
[JsonPropertyName("fieldDistribution")]
public IReadOnlyDictionary<string, int> FieldDistribution { get; }

/// <summary>
/// Get the total size of the documents stored in Meilisearch
/// </summary>
[JsonPropertyName("rawDocumentDbSize")]
public long RawDocumentDbSize { get; }

/// <summary>
/// Get the total size of the documents stored in Meilisearch divided by the number of documents
/// </summary>
[JsonPropertyName("avgDocumentSize")]
public long AvgDocumentSize { get; }

/// <summary>
/// Get the number of document in index that contains at least one embedded representation
/// </summary>
[JsonPropertyName("numberOfEmbeddedDocuments")]
public int NumberOfEmbeddedDocuments { get; }


/// <summary>
/// Get the total number of embeddings representation that exists in that indexes
/// </summary>
[JsonPropertyName("numberOfEmbeddings")]
public int NumberOfEmbeddings { get; }
}
}
Loading