feat: add multimodal search and granular performance diagnostics
Core CI / core (ubuntu-latest) (push) Failing after 3m31s
Core CI / core (macos-latest) (push) Canceled after 0s
Core CI / core (windows-latest) (push) Canceled after 0s
Core CI / desktop (ubuntu-latest) (push) Successful in 5m39s
Core CI / desktop (macos-latest) (push) Canceled after 0s
Core CI / desktop (windows-latest) (push) Canceled after 0s
Core CI / core (ubuntu-latest) (push) Failing after 3m31s
Core CI / core (macos-latest) (push) Canceled after 0s
Core CI / core (windows-latest) (push) Canceled after 0s
Core CI / desktop (ubuntu-latest) (push) Successful in 5m39s
Core CI / desktop (macos-latest) (push) Canceled after 0s
Core CI / desktop (windows-latest) (push) Canceled after 0s
This commit is contained in:
1 parent
d3bb8c7618
commit
b8400c4fbf
110 files changed
+79395
-250
No files matched your search
@@ -68,6 +68,36 @@ fn indexes_persists_and_returns_search_and_stats_json() {
|
||||
.unwrap()
|
||||
.contains("termination"));
|
||||
|
||||
for flag in ["--performance", "--debug-performance"] {
|
||||
let measured = fixture.run(&["search", "--db", "index.db", "termination", "--json", flag]);
|
||||
assert!(
|
||||
measured.status.success(),
|
||||
"{}",
|
||||
String::from_utf8_lossy(&measured.stderr)
|
||||
);
|
||||
let envelope: serde_json::Value = serde_json::from_slice(&measured.stdout).unwrap();
|
||||
assert_eq!(
|
||||
envelope["results"],
|
||||
serde_json::Value::Array(results.clone())
|
||||
);
|
||||
assert_eq!(envelope["metrics"]["result_count"], 1);
|
||||
let total = envelope["metrics"]["total_ms"].as_f64().unwrap();
|
||||
assert!(total.is_finite() && total >= 0.0);
|
||||
if flag == "--performance" {
|
||||
assert!(envelope["metrics"]["trace"].is_null());
|
||||
} else {
|
||||
let spans = envelope["metrics"]["trace"].as_array().unwrap();
|
||||
assert!(spans.iter().any(|span| span["name"] == "cli.index_open"));
|
||||
assert!(spans.len() > 2);
|
||||
for span in spans {
|
||||
let start = span["start_ms"].as_f64().unwrap();
|
||||
let duration = span["duration_ms"].as_f64().unwrap();
|
||||
assert!(start >= 0.0 && duration >= 0.0 && start + duration <= total + 0.001);
|
||||
assert!(!span["name"].as_str().unwrap().contains("termination"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let stats = fixture.run(&["stats", "--db", "index.db", "--json"]);
|
||||
assert!(stats.status.success());
|
||||
let stats: serde_json::Value = serde_json::from_slice(&stats.stdout).unwrap();
|
||||
|
||||
Reference in new issue
Block a user