MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / seed_fallback_analytics

Function seed_fallback_analytics

tests/dashboard_api_test/analytics.rs:233–260  ·  view source on GitHub ↗
(db_path: &Path, project_root: &Path)

Source from the content-addressed store, hash-verified

231}
232
233async fn seed_fallback_analytics(db_path: &Path, project_root: &Path) {
234 let gdb = GlobalDb::open_at(db_path).await.expect("open session db");
235 let project_id = GlobalDb::canonical_project_key(project_root);
236 let rows = [
237 AnalyticsEventInsert {
238 hint_category: Some("search".to_string()),
239 hint_id: Some("hint-search".to_string()),
240 outcome: Some("shown".to_string()),
241 ..analytics_event(&project_id, 1_760_000_200, "hint")
242 },
243 AnalyticsEventInsert {
244 skill_name: Some("superpowers:test-driven-development".to_string()),
245 outcome: Some("used".to_string()),
246 ..analytics_event(&project_id, 1_760_000_201, "skill")
247 },
248 AnalyticsEventInsert {
249 tool_name: Some("mcp__tracedecay__tracedecay_context".to_string()),
250 tool_category: Some("mcp".to_string()),
251 outcome: Some("success".to_string()),
252 ..analytics_event("other-project", 1_760_000_202, "mcp_tool_call")
253 },
254 ];
255 for row in rows {
256 gdb.append_analytics_event(&row)
257 .await
258 .expect("append fallback analytics event");
259 }
260}
261
262async fn start_fixture(seed_durable_events: bool) -> Fixture {
263 let tmp = TempDir::new().expect("temp dir");

Calls 2

analytics_eventFunction · 0.70