GoodMemGoodMem
ReferenceSdkV2.NET

Ping

Endpoint health probes — single-shot and streaming.

Namespace: Goodmem.Client.Api · Class: PingApi

Reach this surface as client.Ping on a GoodmemClient. Every network method is asynchronous — it returns a Task<T> (or an IAsyncEnumerable<T> for pagination and streaming) and accepts a CancellationToken; the Async suffix marks the standard .NET Task-based async pattern.

Methods

MethodSummary
OnceAsyncRun a single ping probe.
StreamAsyncStream ping probe results.

OnceAsync

Runs a single ping probe and returns the probe result.

Declaration

public Task<PingResult> OnceAsync(PingOnceRequest request, CancellationToken ct = default)

HTTPPOST /v1/ping:once

Parameters

TypeNameDescription
PingOnceRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<PingResult> — an awaitable that resolves to PingResult.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var result = await client.Ping.OnceAsync(
    new PingOnceRequest { TargetId = "your-embedder-id" }
);
Console.WriteLine($"{result.RttMs}ms ok={result.Ok}");


StreamAsync

Opens a streaming ping session and returns per-probe results plus a terminal summary.

Declaration

public IAsyncEnumerable<PingEvent> StreamAsync(PingStreamRequest request, CancellationToken ct = default)

HTTPPOST /v1/ping:stream

Parameters

TypeNameDescription
PingStreamRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

IAsyncEnumerable<PingEvent> — an async stream; await foreach yields each PingEvent across pages / events.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

await foreach (
    var ev in client.Ping.StreamAsync(
        new PingStreamRequest { TargetId = "your-embedder-id", Count = 2 }
    )
)
{
    if (ev.Result is { } result)
        Console.WriteLine($"{result.Seq}: {result.RttMs}ms");
}


Data Models

Types in the Goodmem.Client.Models namespace. Each row lists the C# property, its type, the JSON wire name, and a description.

PingOnceRequest

Request payload for a single ping probe

PropertyTypeJSON (wire)Description
TargetIdstringtargetIdTarget resource ID (UUID)
TargetTypeHintPingTargetTypetargetTypeHintOptional hint for the target resource type (optional)
PayloadTypePingPayloadTypepayloadTypeDesired payload type (defaults to provider-specific value) (optional)
PayloadstringpayloadExplicit UTF-8 payload to send with the probe (mutually exclusive with payloadSizeBytes) (optional)
PayloadSizeBytesintpayloadSizeBytesSynthetic payload size in bytes (mutually exclusive with payload) (optional)
TimeoutMsinttimeoutMsPer-probe timeout in milliseconds (0 uses server default) (optional)

PingTargetType

Target types for ping operations

String enum: "TARGET_TYPE_UNSPECIFIED" · "EMBEDDER" · "RERANKER" · "LLM"

PingPayloadType

Payload types supported by ping operations

String enum: "PAYLOAD_TYPE_UNSPECIFIED" · "TEXT" · "JSON" · "BINARY"

PingResult

Result from an individual ping probe

PropertyTypeJSON (wire)Description
EndpointPingEndpointInfoendpointResolved endpoint metadata for the target
SeqintseqSequential probe number (1-based)
BytesSentintbytesSentPayload bytes transmitted
BytesReceivedintbytesReceivedPayload bytes received
OkboolokTrue when the provider responded successfully within the timeout
HttpStatusinthttpStatusProvider HTTP status code or equivalent transport status
ErrorMessagestringerrorMessageHuman-readable error message when ok=false (optional)
RttMsdoublerttMsObserved round-trip latency in milliseconds
TimingPingTimingtimingRaw timing data recorded on the server
MetadataIReadOnlyDictionary<string, string>metadataAdditional provider metadata (request IDs, throttling signals, etc.) (optional)

PingEndpointInfo

Resolved endpoint metadata for ping responses

PropertyTypeJSON (wire)Description
TargetTypePingTargetTypetargetTypeResolved resource type
TargetIdstringtargetIdTarget resource ID (UUID)
ResolvedEndpointstringresolvedEndpointFully resolved endpoint URL used for the probe
ProviderstringproviderProvider name backing the resource
ModelIdentifierstringmodelIdentifierProvider-specific model identifier

PingTiming

Timing information captured during a ping probe

PropertyTypeJSON (wire)Description
ClientSendTimeUnixNanoslongclientSendTimeUnixNanosClient send time (Unix epoch nanoseconds)
ServerReceivedTimeUnixNanoslongserverReceivedTimeUnixNanosServer received time (Unix epoch nanoseconds)
ServerSendTimeUnixNanoslongserverSendTimeUnixNanosServer send time (Unix epoch nanoseconds)
ClientReceiveTimeUnixNanoslongclientReceiveTimeUnixNanosClient receive time (Unix epoch nanoseconds)

PingStreamRequest

Request payload for a streaming ping session

PropertyTypeJSON (wire)Description
TargetIdstringtargetIdTarget resource ID (UUID)
TargetTypeHintPingTargetTypetargetTypeHintOptional hint for the target resource type (optional)
CountintcountNumber of probes to run (0 uses server default) (optional)
IntervalMsintintervalMsDelay between probes in milliseconds (0 uses server default) (optional)
TimeoutMsinttimeoutMsPer-probe timeout in milliseconds (0 uses server default) (optional)
PayloadTypePingPayloadTypepayloadTypeDesired payload type (defaults to provider-specific value) (optional)
PayloadstringpayloadExplicit UTF-8 payload to send with each probe (mutually exclusive with payloadSizeBytes) (optional)
PayloadSizeBytesintpayloadSizeBytesSynthetic payload size in bytes (mutually exclusive with payload) (optional)
MaxInFlightintmaxInFlightMaximum concurrent probes (defaults to 1) (optional)
JitterbooljitterAdd jitter to probe scheduling (optional)
LabelsIReadOnlyDictionary<string, string>labelsOptional labels to attach to the ping session (optional)

PingEvent

Streaming event from a ping session

PropertyTypeJSON (wire)Description
ResultPingResultresultProbe result event (optional)
SummaryPingSummarysummarySummary emitted at session completion (optional)
NoticePingNoticenoticeNon-fatal notice emitted during session (optional)

PingSummary

Summary emitted at the end of a ping session

PropertyTypeJSON (wire)Description
EndpointPingEndpointInfoendpointEndpoint metadata copied from the final probe
RequestsintrequestsTotal number of probes scheduled
ResponsesintresponsesNumber of responses received (including timeouts/errors)
OkintokCount of probes that succeeded
TimeoutsinttimeoutsCount of probes that exceeded the timeout
ErrorsinterrorsCount of probes that failed for other reasons
RttMinMsdoublerttMinMsMinimum observed round-trip latency (ms)
RttAvgMsdoublerttAvgMsAverage observed round-trip latency (ms)
RttP50MsdoublerttP50MsMedian (p50) round-trip latency (ms)
RttP90MsdoublerttP90Ms90th percentile round-trip latency (ms)
RttP99MsdoublerttP99Ms99th percentile round-trip latency (ms)
RttMaxMsdoublerttMaxMsMaximum observed round-trip latency (ms)
RequestsPerSeconddoublerequestsPerSecondEffective request throughput across the session
BytesPerSeconddoublebytesPerSecondAggregate bytes per second (send + receive)
AppliedLimitsIReadOnlyDictionary<string, string>appliedLimitsResource limits applied by the server (optional)

PingNotice

Non-fatal notice emitted during a ping session

PropertyTypeJSON (wire)Description
CodestringcodeMachine-readable notice identifier
MessagestringmessageHuman-readable notice message
DetailsIReadOnlyDictionary<string, string>detailsAdditional contextual details (optional)