get benchmark to work

This commit is contained in:
Christian Schwarz
2025-06-04 18:28:53 +02:00
parent ee775a24a0
commit e1c1aa74fe
2 changed files with 5 additions and 7 deletions

View File

@@ -2,15 +2,14 @@
use std::time::Instant;
use criterion::Criterion;
use criterion::{criterion_group, criterion_main, Criterion};
use hex::FromHex;
use pprof::criterion::{Output, PProfProfiler};
use sk_ps_discovery::{
AttachmentUpdate, RemoteConsistentLsnAdv, TenantShardAttachmentId, TimelineAttachmentId,
};
use utils::{
generation::Generation,
id::{TenantId, TenantTimelineId, TimelineId},
shard::ShardIndex,
generation::Generation, id::{NodeId, TenantId, TenantTimelineId, TimelineId}, lsn::Lsn, shard::ShardIndex
};
/// Use jemalloc and enable profiling, to mirror bin/safekeeper.rs.
@@ -39,12 +38,12 @@ fn bench_simple(c: &mut Criterion) {
let n_tenants = 400_000;
for t in 1..=n_tenants {
let ps_id = NodeId(23);
let tenant_id = TenantId::from_hex(format!("{t:x}")).unwrap();
let tenant_id = TenantId::generate();
let timeline_id = TimelineId::generate();
let tenant_shard_attachment_id = TenantShardAttachmentId {
tenant_id,
shard_id: ShardIndex::unsharded(),
generation: Generation(0),
generation: Generation::Valid(0),
};
let timeline_attachment = TimelineAttachmentId {
tenant_shard_attachment_id,

View File

@@ -23,7 +23,6 @@ fn basic() {
};
let ps1 = NodeId(0x100);
let ps2 = NodeId(0x200);
// Out of order; in happy path, commit_lsn advances first, but let's test the
// case where safekeeper doesn't know about the attachments yet first, before