chore: add loadtest observability setup

This commit is contained in:
kdletters
2026-05-16 22:44:30 +08:00
parent 7f16e88e57
commit 0305b79440
55 changed files with 2867 additions and 1622 deletions

View File

@@ -4,23 +4,26 @@ impl SpacetimeClient {
pub async fn export_auth_store_snapshot_from_tables(
&self,
) -> Result<AuthStoreSnapshotRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.export_auth_store_snapshot_from_tables_then(move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_auth_store_snapshot_procedure_result);
send_once(&sender, mapped);
});
})
self.call_after_connect(
"export_auth_store_snapshot_from_tables",
move |connection, sender| {
connection
.procedures()
.export_auth_store_snapshot_from_tables_then(move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_auth_store_snapshot_procedure_result);
send_once(&sender, mapped);
});
},
)
.await
}
pub async fn get_auth_store_snapshot(
&self,
) -> Result<AuthStoreSnapshotRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
self.call_after_connect("get_auth_store_snapshot", move |connection, sender| {
connection
.procedures()
.get_auth_store_snapshot_then(move |_, result| {
@@ -43,7 +46,7 @@ impl SpacetimeClient {
updated_at_micros,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("upsert_auth_store_snapshot", move |connection, sender| {
connection.procedures().upsert_auth_store_snapshot_then(
procedure_input,
move |_, result| {
@@ -67,23 +70,26 @@ impl SpacetimeClient {
updated_at_micros,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.import_auth_store_snapshot_json_then(procedure_input, move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_auth_store_snapshot_import_procedure_result);
send_once(&sender, mapped);
});
})
self.call_after_connect(
"import_auth_store_snapshot_json",
move |connection, sender| {
connection
.procedures()
.import_auth_store_snapshot_json_then(procedure_input, move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_auth_store_snapshot_import_procedure_result);
send_once(&sender, mapped);
});
},
)
.await
}
pub async fn import_auth_store_snapshot(
&self,
) -> Result<AuthStoreSnapshotImportRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
self.call_after_connect("import_auth_store_snapshot", move |connection, sender| {
connection
.procedures()
.import_auth_store_snapshot_then(move |_, result| {