Skip to content

Commit

Permalink
fix benches broken with 0282435
Browse files Browse the repository at this point in the history
  • Loading branch information
scottlamb committed Oct 16, 2023
1 parent 1944f95 commit 33e6a18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/src/mp4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3070,7 +3070,7 @@ mod bench {
#[bench]
fn serve_generated_bytes(b: &mut test::Bencher) {
testutil::init();
let server = server.get_or_init(BenchServer::new);
let server = SERVER.get_or_init(BenchServer::new);
let p = server.generated_len;
b.bytes = p;
let client = reqwest::Client::new();
Expand Down
6 changes: 3 additions & 3 deletions server/src/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ mod bench {

use db::testutil::{self, TestDb};
use hyper;
use std::sync::Arc;
use std::sync::{Arc, OnceLock};
use uuid::Uuid;

struct Server {
Expand Down Expand Up @@ -840,12 +840,12 @@ mod bench {
}
}

static SERVER: once_cell::sync::Lazy<Server> = once_cell::sync::Lazy::new(Server::new);
static SERVER: OnceLock<Server> = OnceLock::new();

#[bench]
fn serve_stream_recordings(b: &mut test::Bencher) {
testutil::init();
let server = &*SERVER;
let server = SERVER.get_or_init(Server::new);
let url = reqwest::Url::parse(&format!(
"{}/api/cameras/{}/main/recordings",
server.base_url, server.test_camera_uuid
Expand Down

0 comments on commit 33e6a18

Please sign in to comment.