MCPcopy Create free account
hub / github.com/AI45Lab/Code / emit_remote_git_event

Function emit_remote_git_event

core/src/workspace/remote_git.rs:800–816  ·  view source on GitHub ↗

Emit a structured `tracing::debug!` event for a single gitserver call. Mirrors the metering shape used by `S3WorkspaceBackend::emit_s3_call_event` so a single subscriber can meter both backends. Fields: | Field | Meaning | |---------------|--------------------------------------------------| | `op` | gitserver op (`status`, `log`, `diff`,

(
    op: &'static str,
    repo_id: &str,
    status: Option<u16>,
    ok: bool,
    elapsed: Duration,
    bytes: Option<u64>,
)

Source from the content-addressed store, hash-verified

798/// | `bytes` | response body length, when known |
799/// | `duration_ms` | wall-clock |
800fn emit_remote_git_event(
801 op: &'static str,
802 repo_id: &str,
803 status: Option<u16>,
804 ok: bool,
805 elapsed: Duration,
806 bytes: Option<u64>,
807) {
808 tracing::debug!(
809 op = format!("git.{}", op),
810 repo_id = %repo_id,
811 status = status.unwrap_or(0),
812 outcome = if ok { "ok" } else { "error" },
813 bytes = bytes.unwrap_or(0),
814 duration_ms = elapsed.as_millis() as u64,
815 );
816}
817
818impl super::WorkspaceServices {
819 /// Attach a remote git provider to an existing [`WorkspaceServices`].

Callers 3

post_jsonMethod · 0.85
post_unitMethod · 0.85
post_streamedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected