Ping
package goodmem // import "fury.io/pairsys/goodmem"Endpoint health probes — single-shot and streaming.
Methods are called as client.Ping().<Method>(ctx, ...) on a *goodmem.Client. Service: PingService.
Index
- type PingService
- type PingOnceRequest
- type PingTargetType
- type PingPayloadType
- type PingResult
- type PingEndpointInfo
- type PingTiming
- type PingStreamRequest
- type PingEvent
- type PingSummary
- type PingNotice
type PingService
type PingService struct{ … }
Access this service as client.Ping() on a *goodmem.Client. Its methods follow.
func (s *PingService) Once
func (s *PingService) Once(ctx context.Context, req *models.PingOnceRequest) (*models.PingResult, error)
Runs a single ping probe and returns the probe result.
HTTP — POST /v1/ping:once
Parameters
ctx(context.Context) — carries the deadline and cancellation signal for the call.req(*models.PingOnceRequest) — the request payload. The linked type documents every field and its JSON wire name.
Returns — (*models.PingResult, error)
Example
result, err := client.Ping().Once(ctx, &models.PingOnceRequest{TargetID: "your-embedder-id"})
if err != nil {
log.Fatal(err)
}
_ = result.RttMs
_ = result.Okfunc (s *PingService) Stream
func (s *PingService) Stream(ctx context.Context, req *models.PingStreamRequest) (*Stream[models.PingEvent], error)
Opens a streaming ping session and returns per-probe results plus a terminal summary.
HTTP — POST /v1/ping:stream
Parameters
ctx(context.Context) — carries the deadline and cancellation signal for the call.req(*models.PingStreamRequest) — the request payload. The linked type documents every field and its JSON wire name.
Returns — (*Stream[models.PingEvent], error)
Example
stream, err := client.Ping().Stream(ctx, &models.PingStreamRequest{TargetID: "your-embedder-id", Count: goodmem.Ptr(int32(2))})
if err != nil {
log.Fatal(err)
}
defer stream.Close()
for event, err := range stream.Events() {
if err != nil {
log.Fatal(err)
}
_ = event
}type PingOnceRequest
type PingOnceRequest struct{ … }
Request payload for a single ping probe
TargetID(string, wiretargetId) — Target resource ID (UUID)TargetTypeHint(models.PingTargetType, optional, wiretargetTypeHint) — Optional hint for the target resource typePayloadType(models.PingPayloadType, optional, wirepayloadType) — Desired payload type (defaults to provider-specific value)Payload(string, optional, wirepayload) — Explicit UTF-8 payload to send with the probe (mutually exclusive with payloadSizeBytes)PayloadSizeBytes(int32, optional, wirepayloadSizeBytes) — Synthetic payload size in bytes (mutually exclusive with payload)TimeoutMs(int32, optional, wiretimeoutMs) — Per-probe timeout in milliseconds (0 uses server default)
type PingTargetType
type PingTargetType string
Target types for ping operations
String enum (type PingTargetType string): "TARGET_TYPE_UNSPECIFIED" · "EMBEDDER" · "RERANKER" · "LLM"
type PingPayloadType
type PingPayloadType string
Payload types supported by ping operations
String enum (type PingPayloadType string): "PAYLOAD_TYPE_UNSPECIFIED" · "TEXT" · "JSON" · "BINARY"
type PingResult
type PingResult struct{ … }
Result from an individual ping probe
Endpoint(models.PingEndpointInfo, wireendpoint) — Resolved endpoint metadata for the targetSeq(int32, wireseq) — Sequential probe number (1-based)BytesSent(int32, wirebytesSent) — Payload bytes transmittedBytesReceived(int32, wirebytesReceived) — Payload bytes receivedOk(bool, wireok) — True when the provider responded successfully within the timeoutHTTPStatus(int32, wirehttpStatus) — Provider HTTP status code or equivalent transport statusErrorMessage(string, optional, wireerrorMessage) — Human-readable error message when ok=falseRttMs(float64, wirerttMs) — Observed round-trip latency in millisecondsTiming(models.PingTiming, wiretiming) — Raw timing data recorded on the serverMetadata(map[string]string, optional, wiremetadata) — Additional provider metadata (request IDs, throttling signals, etc.)
type PingEndpointInfo
type PingEndpointInfo struct{ … }
Resolved endpoint metadata for ping responses
TargetType(models.PingTargetType, wiretargetType) — Resolved resource typeTargetID(string, wiretargetId) — Target resource ID (UUID)ResolvedEndpoint(string, wireresolvedEndpoint) — Fully resolved endpoint URL used for the probeProvider(string, wireprovider) — Provider name backing the resourceModelIdentifier(string, wiremodelIdentifier) — Provider-specific model identifier
type PingTiming
type PingTiming struct{ … }
Timing information captured during a ping probe
ClientSendTimeUnixNanos(int64, wireclientSendTimeUnixNanos) — Client send time (Unix epoch nanoseconds)ServerReceivedTimeUnixNanos(int64, wireserverReceivedTimeUnixNanos) — Server received time (Unix epoch nanoseconds)ServerSendTimeUnixNanos(int64, wireserverSendTimeUnixNanos) — Server send time (Unix epoch nanoseconds)ClientReceiveTimeUnixNanos(int64, wireclientReceiveTimeUnixNanos) — Client receive time (Unix epoch nanoseconds)
type PingStreamRequest
type PingStreamRequest struct{ … }
Request payload for a streaming ping session
TargetID(string, wiretargetId) — Target resource ID (UUID)TargetTypeHint(models.PingTargetType, optional, wiretargetTypeHint) — Optional hint for the target resource typeCount(int32, optional, wirecount) — Number of probes to run (0 uses server default)IntervalMs(int32, optional, wireintervalMs) — Delay between probes in milliseconds (0 uses server default)TimeoutMs(int32, optional, wiretimeoutMs) — Per-probe timeout in milliseconds (0 uses server default)PayloadType(models.PingPayloadType, optional, wirepayloadType) — Desired payload type (defaults to provider-specific value)Payload(string, optional, wirepayload) — Explicit UTF-8 payload to send with each probe (mutually exclusive with payloadSizeBytes)PayloadSizeBytes(int32, optional, wirepayloadSizeBytes) — Synthetic payload size in bytes (mutually exclusive with payload)MaxInFlight(int32, optional, wiremaxInFlight) — Maximum concurrent probes (defaults to 1)Jitter(bool, optional, wirejitter) — Add jitter to probe schedulingLabels(map[string]string, optional, wirelabels) — Optional labels to attach to the ping session
type PingEvent
type PingEvent struct{ … }
Streaming event from a ping session
Result(models.PingResult, optional, wireresult) — Probe result eventSummary(models.PingSummary, optional, wiresummary) — Summary emitted at session completionNotice(models.PingNotice, optional, wirenotice) — Non-fatal notice emitted during session
type PingSummary
type PingSummary struct{ … }
Summary emitted at the end of a ping session
Endpoint(models.PingEndpointInfo, wireendpoint) — Endpoint metadata copied from the final probeRequests(int32, wirerequests) — Total number of probes scheduledResponses(int32, wireresponses) — Number of responses received (including timeouts/errors)Ok(int32, wireok) — Count of probes that succeededTimeouts(int32, wiretimeouts) — Count of probes that exceeded the timeoutErrors(int32, wireerrors) — Count of probes that failed for other reasonsRttMinMs(float64, wirerttMinMs) — Minimum observed round-trip latency (ms)RttAvgMs(float64, wirerttAvgMs) — Average observed round-trip latency (ms)RttP50Ms(float64, wirerttP50Ms) — Median (p50) round-trip latency (ms)RttP90Ms(float64, wirerttP90Ms) — 90th percentile round-trip latency (ms)RttP99Ms(float64, wirerttP99Ms) — 99th percentile round-trip latency (ms)RttMaxMs(float64, wirerttMaxMs) — Maximum observed round-trip latency (ms)RequestsPerSecond(float64, wirerequestsPerSecond) — Effective request throughput across the sessionBytesPerSecond(float64, wirebytesPerSecond) — Aggregate bytes per second (send + receive)AppliedLimits(map[string]string, optional, wireappliedLimits) — Resource limits applied by the server
type PingNotice
type PingNotice struct{ … }
Non-fatal notice emitted during a ping session
Code(string, wirecode) — Machine-readable notice identifierMessage(string, wiremessage) — Human-readable notice messageDetails(map[string]string, optional, wiredetails) — Additional contextual details