mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Add document database stats
This commit is contained in:
parent
5e7803632d
commit
22bdec7e74
9 changed files with 145 additions and 6 deletions
|
@ -494,6 +494,12 @@ pub async fn delete_index(
|
|||
pub struct IndexStats {
|
||||
/// Number of documents in the index
|
||||
pub number_of_documents: u64,
|
||||
/// Size of the documents database, in bytes.
|
||||
pub raw_document_db_size: u64,
|
||||
/// Maximum size of a document in the documents database.
|
||||
pub max_document_size: u64,
|
||||
/// Average size of a document in the documents database.
|
||||
pub avg_document_size: u64,
|
||||
/// Whether or not the index is currently ingesting document
|
||||
pub is_indexing: bool,
|
||||
/// Number of embeddings in the index
|
||||
|
@ -510,7 +516,10 @@ pub struct IndexStats {
|
|||
impl From<index_scheduler::IndexStats> for IndexStats {
|
||||
fn from(stats: index_scheduler::IndexStats) -> Self {
|
||||
IndexStats {
|
||||
number_of_documents: stats.inner_stats.number_of_documents,
|
||||
number_of_documents: stats.inner_stats.documents_database_stats.number_of_entries(),
|
||||
raw_document_db_size: stats.inner_stats.documents_database_stats.total_value_size(),
|
||||
max_document_size: stats.inner_stats.documents_database_stats.max_value_size(),
|
||||
avg_document_size: stats.inner_stats.documents_database_stats.average_value_size(),
|
||||
is_indexing: stats.is_indexing,
|
||||
number_of_embeddings: stats.inner_stats.number_of_embeddings,
|
||||
number_of_embedded_documents: stats.inner_stats.number_of_embedded_documents,
|
||||
|
|
|
@ -160,6 +160,9 @@ async fn delete_document_by_filter() {
|
|||
snapshot!(json_string!(stats), @r###"
|
||||
{
|
||||
"numberOfDocuments": 4,
|
||||
"rawDocumentDbSize": 42,
|
||||
"maxDocumentSize": 13,
|
||||
"avgDocumentSize": 10,
|
||||
"isIndexing": false,
|
||||
"numberOfEmbeddings": 0,
|
||||
"numberOfEmbeddedDocuments": 0,
|
||||
|
@ -209,6 +212,9 @@ async fn delete_document_by_filter() {
|
|||
snapshot!(json_string!(stats), @r###"
|
||||
{
|
||||
"numberOfDocuments": 2,
|
||||
"rawDocumentDbSize": 16,
|
||||
"maxDocumentSize": 12,
|
||||
"avgDocumentSize": 8,
|
||||
"isIndexing": false,
|
||||
"numberOfEmbeddings": 0,
|
||||
"numberOfEmbeddedDocuments": 0,
|
||||
|
@ -277,6 +283,9 @@ async fn delete_document_by_filter() {
|
|||
snapshot!(json_string!(stats), @r###"
|
||||
{
|
||||
"numberOfDocuments": 1,
|
||||
"rawDocumentDbSize": 12,
|
||||
"maxDocumentSize": 12,
|
||||
"avgDocumentSize": 12,
|
||||
"isIndexing": false,
|
||||
"numberOfEmbeddings": 0,
|
||||
"numberOfEmbeddedDocuments": 0,
|
||||
|
|
|
@ -187,6 +187,9 @@ async fn import_dump_v1_movie_with_settings() {
|
|||
@r###"
|
||||
{
|
||||
"numberOfDocuments": 53,
|
||||
"rawDocumentDbSize": 21965,
|
||||
"maxDocumentSize": 743,
|
||||
"avgDocumentSize": 414,
|
||||
"isIndexing": false,
|
||||
"numberOfEmbeddings": 0,
|
||||
"numberOfEmbeddedDocuments": 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue