chore: add loadtest observability setup
This commit is contained in:
@@ -59,7 +59,7 @@ impl SpacetimeClient {
|
||||
created_at_micros: input.created_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("create_puzzle_agent_session", move |connection, sender| {
|
||||
connection.procedures().create_puzzle_agent_session_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -83,7 +83,7 @@ impl SpacetimeClient {
|
||||
owner_user_id,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("get_puzzle_agent_session", move |connection, sender| {
|
||||
connection.procedures().get_puzzle_agent_session_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -108,7 +108,7 @@ impl SpacetimeClient {
|
||||
saved_at_micros: input.saved_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("save_puzzle_form_draft", move |connection, sender| {
|
||||
connection.procedures().save_puzzle_form_draft_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -134,7 +134,7 @@ impl SpacetimeClient {
|
||||
submitted_at_micros: input.submitted_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("submit_puzzle_agent_message", move |connection, sender| {
|
||||
connection.procedures().submit_puzzle_agent_message_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -164,16 +164,19 @@ impl SpacetimeClient {
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.finalize_puzzle_agent_message_turn_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_puzzle_agent_session_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
})
|
||||
self.call_after_connect(
|
||||
"finalize_puzzle_agent_message_turn",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.finalize_puzzle_agent_message_turn_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_puzzle_agent_session_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -189,7 +192,7 @@ impl SpacetimeClient {
|
||||
compiled_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("compile_puzzle_agent_draft", move |connection, sender| {
|
||||
connection.procedures().compile_puzzle_agent_draft_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -216,7 +219,7 @@ impl SpacetimeClient {
|
||||
saved_at_micros: input.saved_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("save_puzzle_generated_images", move |connection, sender| {
|
||||
connection.procedures().save_puzzle_generated_images_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -245,7 +248,7 @@ impl SpacetimeClient {
|
||||
saved_at_micros: input.saved_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("save_puzzle_ui_background", move |connection, sender| {
|
||||
connection.procedures().save_puzzle_ui_background_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -271,7 +274,7 @@ impl SpacetimeClient {
|
||||
selected_at_micros: input.selected_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("select_puzzle_cover_image", move |connection, sender| {
|
||||
connection.procedures().select_puzzle_cover_image_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -304,7 +307,7 @@ impl SpacetimeClient {
|
||||
published_at_micros: input.published_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("publish_puzzle_work", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.publish_puzzle_work_then(procedure_input, move |_, result| {
|
||||
@@ -323,7 +326,7 @@ impl SpacetimeClient {
|
||||
) -> Result<Vec<PuzzleWorkProfileRecord>, SpacetimeClientError> {
|
||||
let procedure_input = PuzzleWorksListInput { owner_user_id };
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("list_puzzle_works", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.list_puzzle_works_then(procedure_input, move |_, result| {
|
||||
@@ -342,7 +345,7 @@ impl SpacetimeClient {
|
||||
) -> Result<PuzzleWorkProfileRecord, SpacetimeClientError> {
|
||||
let procedure_input = PuzzleWorkGetInput { profile_id };
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("get_puzzle_work_detail", move |connection, sender| {
|
||||
connection.procedures().get_puzzle_work_detail_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -374,7 +377,7 @@ impl SpacetimeClient {
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("update_puzzle_work", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.update_puzzle_work_then(procedure_input, move |_, result| {
|
||||
@@ -397,7 +400,7 @@ impl SpacetimeClient {
|
||||
owner_user_id,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("delete_puzzle_work", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.delete_puzzle_work_then(procedure_input, move |_, result| {
|
||||
@@ -420,16 +423,19 @@ impl SpacetimeClient {
|
||||
claimed_at_micros: input.claimed_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.claim_puzzle_work_point_incentive_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||
.and_then(map_puzzle_work_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
})
|
||||
self.call_after_connect(
|
||||
"claim_puzzle_work_point_incentive",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.claim_puzzle_work_point_incentive_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||
.and_then(map_puzzle_work_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -443,7 +449,7 @@ impl SpacetimeClient {
|
||||
Ok(items
|
||||
.into_iter()
|
||||
.map(|item| {
|
||||
let mut record = map_puzzle_work_profile(item);
|
||||
let mut record = map_puzzle_work_profile(item.into());
|
||||
record.recent_play_count_7d = recent_play_counts
|
||||
.get(&record.profile_id)
|
||||
.copied()
|
||||
@@ -461,7 +467,7 @@ impl SpacetimeClient {
|
||||
) -> Result<PuzzleWorkProfileRecord, SpacetimeClientError> {
|
||||
let procedure_input = PuzzleWorkGetInput { profile_id };
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("get_puzzle_gallery_detail", move |connection, sender| {
|
||||
connection.procedures().get_puzzle_gallery_detail_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -485,7 +491,7 @@ impl SpacetimeClient {
|
||||
liked_at_micros: input.liked_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("record_puzzle_work_like", move |connection, sender| {
|
||||
connection.procedures().record_puzzle_work_like_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -514,7 +520,7 @@ impl SpacetimeClient {
|
||||
remixed_at_micros: input.remixed_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("remix_puzzle_work", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.remix_puzzle_work_then(procedure_input, move |_, result| {
|
||||
@@ -539,7 +545,7 @@ impl SpacetimeClient {
|
||||
started_at_micros: input.started_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("start_puzzle_run", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.start_puzzle_run_then(procedure_input, move |_, result| {
|
||||
@@ -562,7 +568,7 @@ impl SpacetimeClient {
|
||||
owner_user_id,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("get_puzzle_run", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.get_puzzle_run_then(procedure_input, move |_, result| {
|
||||
@@ -587,7 +593,7 @@ impl SpacetimeClient {
|
||||
swapped_at_micros: input.swapped_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("swap_puzzle_pieces", move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.swap_puzzle_pieces_then(procedure_input, move |_, result| {
|
||||
@@ -613,7 +619,7 @@ impl SpacetimeClient {
|
||||
dragged_at_micros: input.dragged_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("drag_puzzle_piece_or_group", move |connection, sender| {
|
||||
connection.procedures().drag_puzzle_piece_or_group_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -638,7 +644,7 @@ impl SpacetimeClient {
|
||||
advanced_at_micros: input.advanced_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("advance_puzzle_next_level", move |connection, sender| {
|
||||
connection.procedures().advance_puzzle_next_level_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -663,7 +669,7 @@ impl SpacetimeClient {
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("update_puzzle_run_pause", move |connection, sender| {
|
||||
connection.procedures().update_puzzle_run_pause_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -689,7 +695,7 @@ impl SpacetimeClient {
|
||||
spent_points: input.spent_points,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
self.call_after_connect("use_puzzle_runtime_prop", move |connection, sender| {
|
||||
connection.procedures().use_puzzle_runtime_prop_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
@@ -717,16 +723,19 @@ impl SpacetimeClient {
|
||||
submitted_at_micros: input.submitted_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.submit_puzzle_leaderboard_entry_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_puzzle_run_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
})
|
||||
self.call_after_connect(
|
||||
"submit_puzzle_leaderboard_entry",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.submit_puzzle_leaderboard_entry_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_puzzle_run_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user