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

@@ -16,16 +16,19 @@ impl SpacetimeClient {
created_at_micros: input.created_at_micros,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.create_square_hole_agent_session_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
});
})
self.call_after_connect(
"create_square_hole_agent_session",
move |connection, sender| {
connection
.procedures()
.create_square_hole_agent_session_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
});
},
)
.await
}
@@ -39,17 +42,20 @@ impl SpacetimeClient {
owner_user_id,
};
self.call_after_connect(move |connection, sender| {
connection.procedures().get_square_hole_agent_session_then(
procedure_input,
move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
},
);
})
self.call_after_connect(
"get_square_hole_agent_session",
move |connection, sender| {
connection.procedures().get_square_hole_agent_session_then(
procedure_input,
move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
},
);
},
)
.await
}
@@ -65,16 +71,19 @@ impl SpacetimeClient {
submitted_at_micros: input.submitted_at_micros,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.submit_square_hole_agent_message_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
});
})
self.call_after_connect(
"submit_square_hole_agent_message",
move |connection, sender| {
connection
.procedures()
.submit_square_hole_agent_message_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
});
},
)
.await
}
@@ -94,16 +103,22 @@ impl SpacetimeClient {
error_message: input.error_message,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.finalize_square_hole_agent_message_turn_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
});
})
self.call_after_connect(
"finalize_square_hole_agent_message_turn",
move |connection, sender| {
connection
.procedures()
.finalize_square_hole_agent_message_turn_then(
procedure_input,
move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_square_hole_agent_session_procedure_result);
send_once(&sender, mapped);
},
);
},
)
.await
}
@@ -123,7 +138,7 @@ impl SpacetimeClient {
compiled_at_micros: input.compiled_at_micros,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("compile_square_hole_draft", move |connection, sender| {
connection.procedures().compile_square_hole_draft_then(
procedure_input,
move |_, result| {
@@ -159,7 +174,7 @@ impl SpacetimeClient {
updated_at_micros: input.updated_at_micros,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("update_square_hole_work", move |connection, sender| {
connection.procedures().update_square_hole_work_then(
procedure_input,
move |_, result| {
@@ -185,7 +200,7 @@ impl SpacetimeClient {
published_at_micros,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("publish_square_hole_work", move |connection, sender| {
connection.procedures().publish_square_hole_work_then(
procedure_input,
move |_, result| {
@@ -225,7 +240,7 @@ impl SpacetimeClient {
&self,
procedure_input: SquareHoleWorksListInput,
) -> Result<Vec<SquareHoleWorkProfileRecord>, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| {
self.call_after_connect("list_square_hole_works", move |connection, sender| {
connection.procedures().list_square_hole_works_then(
procedure_input,
move |_, result| {
@@ -249,7 +264,7 @@ impl SpacetimeClient {
owner_user_id,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("get_square_hole_work_detail", move |connection, sender| {
connection.procedures().get_square_hole_work_detail_then(
procedure_input,
move |_, result| {
@@ -273,7 +288,7 @@ impl SpacetimeClient {
owner_user_id,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("delete_square_hole_work", move |connection, sender| {
connection.procedures().delete_square_hole_work_then(
procedure_input,
move |_, result| {
@@ -298,7 +313,7 @@ impl SpacetimeClient {
started_at_ms: input.started_at_ms,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("start_square_hole_run", move |connection, sender| {
connection.procedures().start_square_hole_run_then(
procedure_input,
move |_, result| {
@@ -322,7 +337,7 @@ impl SpacetimeClient {
owner_user_id,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("get_square_hole_run", move |connection, sender| {
connection
.procedures()
.get_square_hole_run_then(procedure_input, move |_, result| {
@@ -349,7 +364,7 @@ impl SpacetimeClient {
dropped_at_ms: input.dropped_at_ms,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("drop_square_hole_shape", move |connection, sender| {
connection.procedures().drop_square_hole_shape_then(
procedure_input,
move |_, result| {
@@ -379,7 +394,7 @@ impl SpacetimeClient {
stopped_at_ms: input.stopped_at_ms,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("stop_square_hole_run", move |connection, sender| {
connection
.procedures()
.stop_square_hole_run_then(procedure_input, move |_, result| {
@@ -403,7 +418,7 @@ impl SpacetimeClient {
restarted_at_ms: input.restarted_at_ms,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("restart_square_hole_run", move |connection, sender| {
connection.procedures().restart_square_hole_run_then(
procedure_input,
move |_, result| {
@@ -427,7 +442,7 @@ impl SpacetimeClient {
finished_at_ms: input.finished_at_ms,
};
self.call_after_connect(move |connection, sender| {
self.call_after_connect("finish_square_hole_time_up", move |connection, sender| {
connection.procedures().finish_square_hole_time_up_then(
procedure_input,
move |_, result| {