mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-02-02 16:43:34 +01:00
Merge #4624
4624: Add "precommands" to benchmark r=dureuill a=dureuill # Pull Request ## Related issue Helps for https://github.com/meilisearch/meilisearch/issues/4493 ## What does this PR do? - Add support for precommands for cargo xtask bench - update benchmark docs - update workload files Co-authored-by: Louis Dureuil <louis@meilisearch.com>
This commit is contained in:
commit
76bb6d565c
@ -187,8 +187,8 @@ They are JSON files with the following structure (comments are not actually supp
|
|||||||
},
|
},
|
||||||
// Core of the workload.
|
// Core of the workload.
|
||||||
// A list of commands to run sequentially.
|
// A list of commands to run sequentially.
|
||||||
// A command is a request to the Meilisearch instance that is executed while the profiling runs.
|
// Optional: A precommand is a request to the Meilisearch instance that is executed before the profiling runs.
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
// Meilisearch route to call. `http://localhost:7700/` will be prepended.
|
// Meilisearch route to call. `http://localhost:7700/` will be prepended.
|
||||||
"route": "indexes/movies/settings",
|
"route": "indexes/movies/settings",
|
||||||
@ -224,8 +224,11 @@ They are JSON files with the following structure (comments are not actually supp
|
|||||||
// - DontWait: run the next command without waiting the response to this one.
|
// - DontWait: run the next command without waiting the response to this one.
|
||||||
// - WaitForResponse: run the next command as soon as the response from the server is received.
|
// - WaitForResponse: run the next command as soon as the response from the server is received.
|
||||||
// - WaitForTask: run the next command once **all** the Meilisearch tasks created up to now have finished processing.
|
// - WaitForTask: run the next command once **all** the Meilisearch tasks created up to now have finished processing.
|
||||||
"synchronous": "DontWait"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
// A command is a request to the Meilisearch instance that is executed while the profiling runs.
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/documents",
|
"route": "indexes/movies/documents",
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
"sha256": "27e25efd0b68b159b8b21350d9af76938710cb29ce0393fa71b41c4f3c630ffe"
|
"sha256": "27e25efd0b68b159b8b21350d9af76938710cb29ce0393fa71b41c4f3c630ffe"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/settings",
|
"route": "indexes/movies/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -78,8 +78,10 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"synchronous": "DontWait"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/documents",
|
"route": "indexes/movies/documents",
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"sha256": "5b6e4cb660bc20327776e8a33ea197b43d9ec84856710ead1cc87ab24df77de1"
|
"sha256": "5b6e4cb660bc20327776e8a33ea197b43d9ec84856710ead1cc87ab24df77de1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/settings",
|
"route": "indexes/movies/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -30,8 +30,10 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"synchronous": "DontWait"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/documents",
|
"route": "indexes/movies/documents",
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"sha256": "d215e395e4240f12f03b8f1f68901eac82d9e7ded5b462cbf4a6b8efde76c6c6"
|
"sha256": "d215e395e4240f12f03b8f1f68901eac82d9e7ded5b462cbf4a6b8efde76c6c6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "experimental-features",
|
"route": "experimental-features",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -55,7 +55,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"synchronous": "WaitForTask"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/documents",
|
"route": "indexes/movies/documents",
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"sha256": "d215e395e4240f12f03b8f1f68901eac82d9e7ded5b462cbf4a6b8efde76c6c6"
|
"sha256": "d215e395e4240f12f03b8f1f68901eac82d9e7ded5b462cbf4a6b8efde76c6c6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "experimental-features",
|
"route": "experimental-features",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -49,7 +49,9 @@
|
|||||||
"asset": "movies-100.json"
|
"asset": "movies-100.json"
|
||||||
},
|
},
|
||||||
"synchronous": "WaitForTask"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/movies/settings",
|
"route": "indexes/movies/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -59,7 +59,9 @@
|
|||||||
"asset": "150k-people.json"
|
"asset": "150k-people.json"
|
||||||
},
|
},
|
||||||
"synchronous": "WaitForTask"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -61,7 +61,9 @@
|
|||||||
"asset": "150k-people.json"
|
"asset": "150k-people.json"
|
||||||
},
|
},
|
||||||
"synchronous": "WaitForTask"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -61,7 +61,9 @@
|
|||||||
"asset": "150k-people.json"
|
"asset": "150k-people.json"
|
||||||
},
|
},
|
||||||
"synchronous": "WaitForTask"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
"sha256": "28c359a0956958af0ba204ec11bad3045a0864a10b4838914fea25a01724f84b"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commands": [
|
"precommands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
@ -62,14 +62,18 @@
|
|||||||
"asset": "150k-people.json"
|
"asset": "150k-people.json"
|
||||||
},
|
},
|
||||||
"synchronous": "WaitForTask"
|
"synchronous": "WaitForTask"
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
{
|
{
|
||||||
"route": "indexes/peoples/settings",
|
"route": "indexes/peoples/settings",
|
||||||
"method": "PATCH",
|
"method": "PATCH",
|
||||||
"body": {
|
"body": {
|
||||||
"inline": {
|
"inline": {
|
||||||
"typoTolerance": {
|
"typoTolerance": {
|
||||||
"disableOnAttributes": ["featured_job_organization_name"]
|
"disableOnAttributes": [
|
||||||
|
"featured_job_organization_name"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -93,7 +97,22 @@
|
|||||||
"body": {
|
"body": {
|
||||||
"inline": {
|
"inline": {
|
||||||
"typoTolerance": {
|
"typoTolerance": {
|
||||||
"disableOnWords": ["Ben","Elowitz","Kevin","Flaherty", "Ron", "Dustin", "Owen", "Chris", "Mark", "Matt", "Peter", "Van", "Head", "of"]
|
"disableOnWords": [
|
||||||
|
"Ben",
|
||||||
|
"Elowitz",
|
||||||
|
"Kevin",
|
||||||
|
"Flaherty",
|
||||||
|
"Ron",
|
||||||
|
"Dustin",
|
||||||
|
"Owen",
|
||||||
|
"Chris",
|
||||||
|
"Mark",
|
||||||
|
"Matt",
|
||||||
|
"Peter",
|
||||||
|
"Van",
|
||||||
|
"Head",
|
||||||
|
"of"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -22,6 +22,8 @@ pub struct Workload {
|
|||||||
pub run_count: u16,
|
pub run_count: u16,
|
||||||
pub extra_cli_args: Vec<String>,
|
pub extra_cli_args: Vec<String>,
|
||||||
pub assets: BTreeMap<String, Asset>,
|
pub assets: BTreeMap<String, Asset>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub precommands: Vec<super::command::Command>,
|
||||||
pub commands: Vec<super::command::Command>,
|
pub commands: Vec<super::command::Command>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,6 +39,15 @@ async fn run_commands(
|
|||||||
let report_folder = &args.report_folder;
|
let report_folder = &args.report_folder;
|
||||||
let workload_name = &workload.name;
|
let workload_name = &workload.name;
|
||||||
|
|
||||||
|
for batch in workload
|
||||||
|
.precommands
|
||||||
|
.as_slice()
|
||||||
|
.split_inclusive(|command| !matches!(command.synchronous, SyncMode::DontWait))
|
||||||
|
{
|
||||||
|
super::command::run_batch(meili_client, batch, &workload.assets, &args.asset_folder)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
std::fs::create_dir_all(report_folder)
|
std::fs::create_dir_all(report_folder)
|
||||||
.with_context(|| format!("could not create report directory at {report_folder}"))?;
|
.with_context(|| format!("could not create report directory at {report_folder}"))?;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user