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

Method record_hook_route_analytics

src/mcp/server.rs:2735–2757  ·  view source on GitHub ↗
(
        &self,
        project_root: &std::path::Path,
        event: &hook_events::HookEvent,
        current_branch: Option<&str>,
    )

Source from the content-addressed store, hash-verified

2733 }
2734
2735 fn record_hook_route_analytics(
2736 &self,
2737 project_root: &std::path::Path,
2738 event: &hook_events::HookEvent,
2739 current_branch: Option<&str>,
2740 ) {
2741 let Some(event) = hook_route_analytics_event(
2742 project_root,
2743 event,
2744 current_branch,
2745 crate::tracedecay::current_timestamp(),
2746 ) else {
2747 return;
2748 };
2749 let Some(gdb) = self.global_db.clone() else {
2750 return;
2751 };
2752 self.spawn_observed_ledger_write(async move {
2753 if let Err(e) = gdb.append_analytics_event(&event).await {
2754 eprintln!("[tracedecay] hook route analytics insert failed: {e}");
2755 }
2756 });
2757 }
2758
2759 /// Records a live session↔git span from one hook route notification.
2760 ///

Callers 1

Calls 4

current_timestampFunction · 0.85

Tested by

no test coverage detected