MCPcopy Create free account
hub / github.com/1jehuang/jcode / insertSessionDetails

Function insertSessionDetails

telemetry-worker/src/worker.js:1167–1235  ·  view source on GitHub ↗
(env, body, columns)

Source from the content-addressed store, hash-verified

1165}
1166
1167async function insertSessionDetails(env, body, columns) {
1168 if (!columns || columns.size === 0 || !body.event_id || !columns.has("event_id")) {
1169 return;
1170 }
1171 const values = [
1172 ["event_id", body.event_id],
1173 ["session_start_hour_utc", body.session_start_hour_utc ?? null],
1174 ["session_start_weekday_utc", body.session_start_weekday_utc ?? null],
1175 ["session_end_hour_utc", body.session_end_hour_utc ?? null],
1176 ["session_end_weekday_utc", body.session_end_weekday_utc ?? null],
1177 ["previous_session_gap_secs", body.previous_session_gap_secs ?? null],
1178 ["sessions_started_24h", body.sessions_started_24h || 0],
1179 ["sessions_started_7d", body.sessions_started_7d || 0],
1180 ["active_sessions_at_start", body.active_sessions_at_start || 0],
1181 ["other_active_sessions_at_start", body.other_active_sessions_at_start || 0],
1182 ["max_concurrent_sessions", body.max_concurrent_sessions || 0],
1183 ["multi_sessioned", boolToInt(body.multi_sessioned)],
1184 ["first_file_edit_ms", body.first_file_edit_ms || null],
1185 ["first_test_pass_ms", body.first_test_pass_ms || null],
1186 ["tool_cat_read_search", body.tool_cat_read_search || 0],
1187 ["tool_cat_write", body.tool_cat_write || 0],
1188 ["tool_cat_shell", body.tool_cat_shell || 0],
1189 ["tool_cat_web", body.tool_cat_web || 0],
1190 ["tool_cat_memory", body.tool_cat_memory || 0],
1191 ["tool_cat_subagent", body.tool_cat_subagent || 0],
1192 ["tool_cat_swarm", body.tool_cat_swarm || 0],
1193 ["tool_cat_email", body.tool_cat_email || 0],
1194 ["tool_cat_side_panel", body.tool_cat_side_panel || 0],
1195 ["tool_cat_goal", body.tool_cat_goal || 0],
1196 ["tool_cat_mcp", body.tool_cat_mcp || 0],
1197 ["tool_cat_other", body.tool_cat_other || 0],
1198 ["tool_cat_todo", body.tool_cat_todo || 0],
1199 ["feature_todo_used", boolToInt(body.feature_todo_used)],
1200 ["todo_gate_ownership_count", body.todo_gate_ownership_count || 0],
1201 ["todo_gate_hill_count", body.todo_gate_hill_count || 0],
1202 ["todo_gate_completion_count", body.todo_gate_completion_count || 0],
1203 ["todo_gate_spike_count", body.todo_gate_spike_count || 0],
1204 ["command_login_used", boolToInt(body.command_login_used)],
1205 ["command_model_used", boolToInt(body.command_model_used)],
1206 ["command_usage_used", boolToInt(body.command_usage_used)],
1207 ["command_resume_used", boolToInt(body.command_resume_used)],
1208 ["command_memory_used", boolToInt(body.command_memory_used)],
1209 ["command_swarm_used", boolToInt(body.command_swarm_used)],
1210 ["command_goal_used", boolToInt(body.command_goal_used)],
1211 ["command_selfdev_used", boolToInt(body.command_selfdev_used)],
1212 ["command_feedback_used", boolToInt(body.command_feedback_used)],
1213 ["command_other_used", boolToInt(body.command_other_used)],
1214 ["workflow_chat_only", boolToInt(body.workflow_chat_only)],
1215 ["workflow_coding_used", boolToInt(body.workflow_coding_used)],
1216 ["workflow_research_used", boolToInt(body.workflow_research_used)],
1217 ["workflow_tests_used", boolToInt(body.workflow_tests_used)],
1218 ["workflow_background_used", boolToInt(body.workflow_background_used)],
1219 ["workflow_subagent_used", boolToInt(body.workflow_subagent_used)],
1220 ["workflow_swarm_used", boolToInt(body.workflow_swarm_used)],
1221 ["project_repo_present", boolToInt(body.project_repo_present)],
1222 ["project_lang_rust", boolToInt(body.project_lang_rust)],
1223 ["project_lang_js_ts", boolToInt(body.project_lang_js_ts)],
1224 ["project_lang_python", boolToInt(body.project_lang_python)],

Callers 1

insertEventFunction · 0.85

Calls 3

boolToIntFunction · 0.85
insertDynamicFunction · 0.85
filterMethod · 0.80

Tested by

no test coverage detected