mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-23 13:16:27 +00:00
Update movies workload
This commit is contained in:
@ -20,7 +20,7 @@ use crate::common::process::{self, delete_db, start_meili};
|
|||||||
|
|
||||||
/// A bench workload.
|
/// A bench workload.
|
||||||
/// Not to be confused with [a test workload](crate::test::workload::Workload).
|
/// Not to be confused with [a test workload](crate::test::workload::Workload).
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct BenchWorkload {
|
pub struct BenchWorkload {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub run_count: u16,
|
pub run_count: u16,
|
||||||
|
@ -8,7 +8,7 @@ use sha2::Digest;
|
|||||||
|
|
||||||
use super::client::Client;
|
use super::client::Client;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||||
pub struct Asset {
|
pub struct Asset {
|
||||||
pub local_location: Option<String>,
|
pub local_location: Option<String>,
|
||||||
pub remote_location: Option<String>,
|
pub remote_location: Option<String>,
|
||||||
@ -18,7 +18,7 @@ pub struct Asset {
|
|||||||
pub sha256: Option<String>,
|
pub sha256: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Default, Copy, Clone)]
|
#[derive(Serialize, Deserialize, Default, Copy, Clone, Debug)]
|
||||||
pub enum AssetFormat {
|
pub enum AssetFormat {
|
||||||
#[default]
|
#[default]
|
||||||
Auto,
|
Auto,
|
||||||
|
@ -12,7 +12,7 @@ use similar_asserts::SimpleDiff;
|
|||||||
use crate::common::assets::{fetch_asset, Asset};
|
use crate::common::assets::{fetch_asset, Asset};
|
||||||
use crate::common::client::{Client, Method};
|
use crate::common::client::{Client, Method};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Command {
|
pub struct Command {
|
||||||
pub route: String,
|
pub route: String,
|
||||||
@ -27,7 +27,7 @@ pub struct Command {
|
|||||||
synchronous: SyncMode,
|
synchronous: SyncMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Clone, Serialize, Deserialize)]
|
#[derive(Default, Clone, Serialize, Deserialize, Debug)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum Body {
|
pub enum Body {
|
||||||
Inline {
|
Inline {
|
||||||
|
@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
use crate::{bench::BenchWorkload, test::TestWorkload};
|
use crate::{bench::BenchWorkload, test::TestWorkload};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub enum Workload {
|
pub enum Workload {
|
||||||
|
@ -55,11 +55,11 @@ async fn run_inner(args: TestDeriveArgs) -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let asset_folder = args.common.asset_folder.clone().leak();
|
let asset_folder = args.common.asset_folder.clone().leak();
|
||||||
for workload_file in &args.common.workload_file {
|
for workload_file in &args.common.workload_file {
|
||||||
let workload: Workload = serde_json::from_reader(
|
let string = tokio::fs::read_to_string(workload_file)
|
||||||
std::fs::File::open(workload_file)
|
.await
|
||||||
.with_context(|| format!("error opening {}", workload_file.display()))?,
|
.with_context(|| format!("error reading {}", workload_file.display()))?;
|
||||||
)
|
let workload: Workload = serde_json::from_str(string.trim())
|
||||||
.with_context(|| format!("error parsing {} as JSON", workload_file.display()))?;
|
.with_context(|| format!("error parsing {} as JSON", workload_file.display()))?;
|
||||||
|
|
||||||
let Workload::Test(workload) = workload else {
|
let Workload::Test(workload) = workload else {
|
||||||
bail!("workload file {} is not a test workload", workload_file.display());
|
bail!("workload file {} is not a test workload", workload_file.display());
|
||||||
|
@ -5,7 +5,7 @@ use anyhow::Context;
|
|||||||
use cargo_metadata::semver::Version;
|
use cargo_metadata::semver::Version;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum VersionOrLatest {
|
pub enum VersionOrLatest {
|
||||||
Version(Version),
|
Version(Version),
|
||||||
Latest,
|
Latest,
|
||||||
|
@ -19,7 +19,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum CommandOrUpgrade {
|
pub enum CommandOrUpgrade {
|
||||||
Command(Command),
|
Command(Command),
|
||||||
@ -52,8 +52,8 @@ fn produce_reference_value(value: &mut Value) {
|
|||||||
"processingTimeMs" => {
|
"processingTimeMs" => {
|
||||||
*value = Value::String(String::from("[duration]"));
|
*value = Value::String(String::from("[duration]"));
|
||||||
continue;
|
continue;
|
||||||
},
|
}
|
||||||
_ => produce_reference_value(value)
|
_ => produce_reference_value(value),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ fn produce_reference_value(value: &mut Value) {
|
|||||||
|
|
||||||
/// A test workload.
|
/// A test workload.
|
||||||
/// Not to be confused with [a bench workload](crate::bench::workload::Workload).
|
/// Not to be confused with [a bench workload](crate::bench::workload::Workload).
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct TestWorkload {
|
pub struct TestWorkload {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
@ -54,6 +54,9 @@
|
|||||||
},
|
},
|
||||||
"synchronous": "WaitForTask"
|
"synchronous": "WaitForTask"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"upgrade": "latest"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/search?q=bitcoin",
|
"route": "indexes/movies/search?q=bitcoin",
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
@ -128,7 +131,7 @@
|
|||||||
],
|
],
|
||||||
"limit": 20,
|
"limit": 20,
|
||||||
"offset": 0,
|
"offset": 0,
|
||||||
"processingTimeMs": 1,
|
"processingTimeMs": "[duration]",
|
||||||
"query": "bitcoin"
|
"query": "bitcoin"
|
||||||
},
|
},
|
||||||
"synchronous": "DontWait"
|
"synchronous": "DontWait"
|
||||||
@ -139,6 +142,7 @@
|
|||||||
"body": null,
|
"body": null,
|
||||||
"expectedStatus": 200,
|
"expectedStatus": 200,
|
||||||
"expectedResponse": {
|
"expectedResponse": {
|
||||||
|
"avgDocumentSize": 499,
|
||||||
"fieldDistribution": {
|
"fieldDistribution": {
|
||||||
"genres": 31944,
|
"genres": 31944,
|
||||||
"id": 31944,
|
"id": 31944,
|
||||||
@ -148,7 +152,10 @@
|
|||||||
"title": 31944
|
"title": 31944
|
||||||
},
|
},
|
||||||
"isIndexing": false,
|
"isIndexing": false,
|
||||||
"numberOfDocuments": 31944
|
"numberOfDocuments": 31944,
|
||||||
|
"numberOfEmbeddedDocuments": 0,
|
||||||
|
"numberOfEmbeddings": 0,
|
||||||
|
"rawDocumentDbSize": 16220160
|
||||||
},
|
},
|
||||||
"synchronous": "DontWait"
|
"synchronous": "DontWait"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user