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

Function seed_durable_analytics

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

Source from the content-addressed store, hash-verified

145}
146
147async fn seed_durable_analytics(db_path: &Path, project_root: &Path) {
148 let gdb = GlobalDb::open_at(db_path).await.expect("open global db");
149 let project_id = GlobalDb::canonical_project_key(project_root);
150 let rows = [
151 AnalyticsEventInsert {
152 hint_category: Some("search".to_string()),
153 hint_id: Some("hint-search".to_string()),
154 outcome: Some("shown".to_string()),
155 ..analytics_event(&project_id, 1_760_000_100, "hint")
156 },
157 AnalyticsEventInsert {
158 tool_name: Some("mcp__tracedecay__tracedecay_context".to_string()),
159 tool_category: Some("mcp".to_string()),
160 outcome: Some("success".to_string()),
161 ..analytics_event(&project_id, 1_760_000_101, "mcp_tool_call")
162 },
163 AnalyticsEventInsert {
164 skill_name: Some("superpowers:test-driven-development".to_string()),
165 outcome: Some("used".to_string()),
166 ..analytics_event(&project_id, 1_760_000_102, "skill")
167 },
168 AnalyticsEventInsert {
169 tool_name: Some("mcp__tracedecay__tracedecay_context".to_string()),
170 tool_category: Some("mcp".to_string()),
171 outcome: Some("success".to_string()),
172 ..analytics_event("other-project", 1_760_000_103, "mcp_tool_call")
173 },
174 ];
175 for row in rows {
176 gdb.append_analytics_event(&row)
177 .await
178 .expect("append durable analytics event");
179 }
180}
181
182fn seed_hook_analytics(project_root: &Path) {
183 let layout = resolve_layout_for_current_profile(project_root).expect("resolve store layout");

Callers 1

start_fixtureFunction · 0.85

Calls 2

analytics_eventFunction · 0.70

Tested by

no test coverage detected