package csot

import "go.mongodb.org/mongo-driver/internal/csot"

Index

Functions

func IsTimeoutContext

func IsTimeoutContext(ctx context.Context) bool

func MakeTimeoutContext

func MakeTimeoutContext(ctx context.Context, to time.Duration) (context.Context, context.CancelFunc)

MakeTimeoutContext returns a new context with Client-Side Operation Timeout (CSOT) feature-gated behavior and a Timeout set to the passed in Duration. Setting a Timeout on a single operation is not supported in public API.

TODO(GODRIVER-2348) We may be able to remove this function once CSOT feature-gated behavior becomes the TODO default behavior.

Types

type ZeroRTTMonitor

type ZeroRTTMonitor struct{}

ZeroRTTMonitor implements the RTTMonitor interface and is used internally for testing. It returns 0 for all RTT calculations and an empty string for RTT statistics.

func (*ZeroRTTMonitor) EWMA

func (zrm *ZeroRTTMonitor) EWMA() time.Duration

EWMA implements the RTT monitor interface.

func (*ZeroRTTMonitor) Min

func (zrm *ZeroRTTMonitor) Min() time.Duration

Min implements the RTT monitor interface.

func (*ZeroRTTMonitor) P90

func (zrm *ZeroRTTMonitor) P90() time.Duration

P90 implements the RTT monitor interface.

func (*ZeroRTTMonitor) Stats

func (zrm *ZeroRTTMonitor) Stats() string

Stats implements the RTT monitor interface.

Source Files

csot.go

Version
v1.16.0-rc0
Published
Jun 27, 2024
Platform
darwin/amd64
Imports
2 packages
Last checked
16 minutes ago

Tools for package owners.