Documentation
¶
Overview ¶
Package experimental is a collection of experimental features that might have some rough edges to them. Housing experimental features in this package results in a user accessing these APIs as `experimental.Foo`, thereby making it explicit that the feature is experimental and using them in production code is at their own risk.
All APIs in this package are experimental.
Index ¶
- func WithBufferPool(pool BufferPool) option.ClientOption
- func WithDirectConnectivityEnforced() option.ClientOption
- func WithMeterProvider(mp *metric.MeterProvider) option.ClientOption
- func WithMetricExporter(ex *metric.Exporter) option.ClientOption
- func WithMetricInterval(metricInterval time.Duration) option.ClientOption
- func WithOtelDebugMetrics() option.ClientOption
- func WithOtelMetrics() option.ClientOption
- func WithReadStallTimeout(rstc *ReadStallTimeoutConfig) option.ClientOption
- type BufferPool
- type ReadStallTimeoutConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBufferPool ¶ added in v1.68.0
func WithBufferPool(pool BufferPool) option.ClientOption
WithBufferPool provides an option.ClientOption that may be passed to cloud.google.com/go/storage.NewGRPCClient. It sets the buffer pool used to allocate memory for parallel uploads.
This option is not supported at the moment.
func WithDirectConnectivityEnforced ¶ added in v1.60.0
func WithDirectConnectivityEnforced() option.ClientOption
WithDirectConnectivityEnforced provides an option.ClientOption that may be passed to cloud.google.com/go/storage.NewGRPCClient. It sets the gRPC client to use direct path connectivity for all requests and may fail if direct path connectivity cannot be established for a request.
func WithMeterProvider ¶ added in v1.57.0
func WithMeterProvider(mp *metric.MeterProvider) option.ClientOption
WithMeterProvider provides a option.ClientOption that may be passed to [storage.NewGRPCClient]. Set an alternate client-side meter provider to emit metrics through. This option takes precedence over WithMetricExporter and WithMetricInterval.
func WithMetricExporter ¶ added in v1.46.0
func WithMetricExporter(ex *metric.Exporter) option.ClientOption
WithMetricExporter provides a option.ClientOption that may be passed to [storage.NewGRPCClient]. Set an alternate client-side metric Exporter to emit metrics through. Must implement metric.Exporter. This option is ignored if WithMeterProvider is also set.
func WithMetricInterval ¶ added in v1.46.0
func WithMetricInterval(metricInterval time.Duration) option.ClientOption
WithMetricInterval provides a option.ClientOption that may be passed to [storage.NewGRPCClient]. It sets how often to emit metrics metric.WithInterval when using metric.NewPeriodicReader When using Cloud Monitoring interval must be at minimum 1 time.Minute. This option is ignored if WithMeterProvider is also set.
func WithOtelDebugMetrics ¶ added in v1.65.0
func WithOtelDebugMetrics() option.ClientOption
WithOtelDebugMetrics provides an option.ClientOption that may be passed to cloud.google.com/go/storage.NewClient or cloud.google.com/go/storage.NewGRPCClient. It enables debug client-side OpenTelemetry metrics.
func WithOtelMetrics ¶ added in v1.63.1
func WithOtelMetrics() option.ClientOption
WithOtelMetrics provides an option.ClientOption that may be passed to cloud.google.com/go/storage.NewClient or cloud.google.com/go/storage.NewGRPCClient. It enables client-side OpenTelemetry metrics.
func WithReadStallTimeout ¶
func WithReadStallTimeout(rstc *ReadStallTimeoutConfig) option.ClientOption
WithReadStallTimeout provides a option.ClientOption that may be passed to [storage.NewClient] or [storage.NewGRPCClient]. It enables the client to retry stalled requests when starting a download from Cloud Storage. If the timeout elapses with no response from the server, the request is automatically retried. The timeout is initially set to ReadStallTimeoutConfig.Min. The client tracks latency across all read requests from the client for each bucket accessed, and can adjust the timeout higher to the target percentile when latency for request to that bucket is high. Currently, this is supported for downloads ([storage.NewReader] and [storage.NewRangeReader] calls) on the XML API and gRPC API (not implemented for JSON API).
Types ¶
type BufferPool ¶ added in v1.68.0
type BufferPool interface {
// Get retrieves a single chunk of memory. It returns a slice that is
// optimally sized by the pool, guaranteeing that len(buf) <= maxSize.
// It blocks until the request is satisfied.
// It returns an error if the context is cancelled (e.g., context.Canceled)
// or if the underlying allocation encounters a fatal failure.
Get(ctx context.Context, maxSize int) ([]byte, error)
// TryGet retrieves a chunk of memory up to maxSize bytes.
// It is non-blocking and either returns a memory chunk or fails instantly
// by throwing an error.
TryGet(maxSize int) ([]byte, error)
// Put returns a previously acquired buffer to the pool.
// After calling Put, the caller must not retain, read, or write to the buffer.
// The exact slice returned by Get or TryGet must be passed back.
Put(buf []byte)
}
BufferPool is not supported at the moment.
type ReadStallTimeoutConfig ¶
type ReadStallTimeoutConfig struct {
// Min is the minimum duration of the timeout. The default value is 500ms. Requests
// taking shorter than this value to return response headers will never time out.
// In general, you should choose a Min value that is greater than the typical value
// for the target percentile.
Min time.Duration
// TargetPercentile is the percentile to target for the dynamic timeout. The default
// value is 0.99. At the default percentile, at most 1% of requests will be timed out
// and retried.
TargetPercentile float64
}
ReadStallTimeoutConfig defines the timeout which is adjusted dynamically based on past observed latencies.