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

@@ -11,7 +11,7 @@ impl SpacetimeClient {
&self,
input: BarkBattleDraftCreateRecordInput,
) -> Result<BarkBattleDraftConfigRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
self.call_after_connect("create_bark_battle_draft", move |connection, sender| {
connection
.procedures()
.create_bark_battle_draft_then(input, move |_, result| {
@@ -28,16 +28,19 @@ impl SpacetimeClient {
&self,
input: BarkBattleDraftConfigUpsertRecordInput,
) -> Result<BarkBattleDraftConfigRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.update_bark_battle_draft_config_then(input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_bark_battle_draft_config_procedure_result);
send_once(&sender, mapped);
});
})
self.call_after_connect(
"update_bark_battle_draft_config",
move |connection, sender| {
connection
.procedures()
.update_bark_battle_draft_config_then(input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_bark_battle_draft_config_procedure_result);
send_once(&sender, mapped);
});
},
)
.await
}
@@ -45,7 +48,7 @@ impl SpacetimeClient {
&self,
input: BarkBattleWorkPublishRecordInput,
) -> Result<BarkBattleRuntimeConfigRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
self.call_after_connect("publish_bark_battle_work", move |connection, sender| {
connection
.procedures()
.publish_bark_battle_work_then(input, move |_, result| {
@@ -67,16 +70,20 @@ impl SpacetimeClient {
work_id,
owner_user_id,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.get_bark_battle_runtime_config_then(input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_bark_battle_runtime_config_procedure_result);
send_once(&sender, mapped);
});
})
self.call_after_connect(
"get_bark_battle_runtime_config",
move |connection, sender| {
connection.procedures().get_bark_battle_runtime_config_then(
input,
move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_bark_battle_runtime_config_procedure_result);
send_once(&sender, mapped);
},
);
},
)
.await
}
@@ -84,7 +91,7 @@ impl SpacetimeClient {
&self,
input: BarkBattleRunStartRecordInput,
) -> Result<BarkBattleRunRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
self.call_after_connect("start_bark_battle_run", move |connection, sender| {
connection
.procedures()
.start_bark_battle_run_then(input, move |_, result| {
@@ -101,7 +108,7 @@ impl SpacetimeClient {
&self,
input: BarkBattleRunFinishRecordInput,
) -> Result<BarkBattleRunRecord, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
self.call_after_connect("finish_bark_battle_run", move |connection, sender| {
connection
.procedures()
.finish_bark_battle_run_then(input, move |_, result| {
@@ -123,7 +130,7 @@ impl SpacetimeClient {
run_id,
owner_user_id,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("get_bark_battle_run", move |connection, sender| {
connection
.procedures()
.get_bark_battle_run_then(input, move |_, result| {