MCPcopy Index your code
hub / github.com/coder/coder / Ping

Method Ping

codersdk/workspacesdk/agentconn.go:179–184  ·  view source on GitHub ↗

Ping pings the agent and returns the round-trip time. The bool returns true if the ping was made P2P.

(ctx context.Context)

Source from the content-addressed store, hash-verified

177// Ping pings the agent and returns the round-trip time.
178// The bool returns true if the ping was made P2P.
179func (c *agentConn) Ping(ctx context.Context) (time.Duration, bool, *ipnstate.PingResult, error) {
180 ctx, span := tracing.StartSpan(ctx)
181 defer span.End()
182
183 return c.Conn.Ping(ctx, c.agentAddress())
184}
185
186// Close ends the connection to the workspace agent.
187func (c *agentConn) Close() error {

Callers

nothing calls this directly

Calls 3

agentAddressMethod · 0.95
StartSpanFunction · 0.92
PingMethod · 0.65

Tested by

no test coverage detected