fix snapshots

This commit is contained in:
ManyTheFish 2025-02-11 10:01:22 +01:00
parent b5dc971afe
commit 077a3a2cb3
2 changed files with 14 additions and 2 deletions

View File

@ -388,6 +388,9 @@ pub struct Stats {
"indexes": { "indexes": {
"movies": { "movies": {
"numberOfDocuments": 10, "numberOfDocuments": 10,
"rawDocumentDbSize": 100,
"maxDocumentSize": 16,
"avgDocumentSize": 10,
"isIndexing": true, "isIndexing": true,
"fieldDistribution": { "fieldDistribution": {
"genre": 10, "genre": 10,

View File

@ -134,6 +134,9 @@ async fn check_the_index_scheduler(server: &Server) {
"indexes": { "indexes": {
"kefir": { "kefir": {
"numberOfDocuments": 1, "numberOfDocuments": 1,
"rawDocumentDbSize": 109,
"maxDocumentSize": 109,
"avgDocumentSize": 109,
"isIndexing": false, "isIndexing": false,
"fieldDistribution": { "fieldDistribution": {
"age": 1, "age": 1,
@ -214,6 +217,9 @@ async fn check_the_index_scheduler(server: &Server) {
"indexes": { "indexes": {
"kefir": { "kefir": {
"numberOfDocuments": 1, "numberOfDocuments": 1,
"rawDocumentDbSize": 109,
"maxDocumentSize": 109,
"avgDocumentSize": 109,
"isIndexing": false, "isIndexing": false,
"fieldDistribution": { "fieldDistribution": {
"age": 1, "age": 1,
@ -228,9 +234,12 @@ async fn check_the_index_scheduler(server: &Server) {
"###); "###);
let index = server.index("kefir"); let index = server.index("kefir");
let (stats, _) = index.stats().await; let (stats, _) = index.stats().await;
snapshot!(stats, @r#" snapshot!(stats, @r###"
{ {
"numberOfDocuments": 1, "numberOfDocuments": 1,
"rawDocumentDbSize": 109,
"maxDocumentSize": 109,
"avgDocumentSize": 109,
"isIndexing": false, "isIndexing": false,
"fieldDistribution": { "fieldDistribution": {
"age": 1, "age": 1,
@ -240,7 +249,7 @@ async fn check_the_index_scheduler(server: &Server) {
"surname": 1 "surname": 1
} }
} }
"#); "###);
// Delete all the tasks of a specific batch // Delete all the tasks of a specific batch
let (task, _) = server.delete_tasks("batchUids=10").await; let (task, _) = server.delete_tasks("batchUids=10").await;