Movatterモバイル変換


[0]ホーム

URL:


Notice  The highest tagged major version isv9.

stats

package
v8.19.1Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2025 License:Apache-2.0Imports:12Imported by:4

Details

Repository

github.com/elastic/go-elasticsearch

Links

Documentation

Overview

Get cluster statistics.Get basic index metrics (shard numbers, store size, memory usage) andinformation about the current nodes that form the cluster (number, roles, os,jvm versions, memory usage, cpu and installed plugins).

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath =errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

typeNewStats

type NewStats func() *Stats

NewStats type alias for index.

funcNewStatsFunc

func NewStatsFunc(tpelastictransport.Interface)NewStats

NewStatsFunc returns a new instance of Stats with the provided transport.Used in the index of the library this allows to retrieve every apis in once place.

typeResponseadded inv8.7.0

type Response struct {// Ccs Cross-cluster statsCcstypes.CCSStats `json:"ccs"`// ClusterName Name of the cluster, based on the cluster name setting.ClusterNamestring `json:"cluster_name"`// ClusterUuid Unique identifier for the cluster.ClusterUuidstring `json:"cluster_uuid"`// Indices Contains statistics about indices with shards assigned to selected nodes.Indicestypes.ClusterIndices `json:"indices"`// NodeStats Contains statistics about the number of nodes selected by the request’s node// filters.NodeStats *types.NodeStatistics `json:"_nodes,omitempty"`// Nodes Contains statistics about nodes selected by the request’s node filters.Nodestypes.ClusterNodes `json:"nodes"`// Repositories Contains stats on repository feature usage exposed in cluster stats for// telemetry.Repositories map[string]map[string]int64 `json:"repositories"`// Snapshots Contains stats cluster snapshots.Snapshotstypes.ClusterSnapshotStats `json:"snapshots"`// Status Health status of the cluster, based on the state of its primary and replica// shards.Status *healthstatus.HealthStatus `json:"status,omitempty"`// Timestamp Unix timestamp, in milliseconds, for the last time the cluster statistics// were refreshed.Timestampint64 `json:"timestamp"`}

Response holds the response body struct for the package stats

https://github.com/elastic/elasticsearch-specification/blob/470b4b9aaaa25cae633ec690e54b725c6fc939c7/specification/cluster/stats/ClusterStatsResponse.ts#L71-L73

funcNewResponseadded inv8.7.0

func NewResponse() *Response

NewResponse returns a Response

typeStats

type Stats struct {// contains filtered or unexported fields}

funcNew

Get cluster statistics.Get basic index metrics (shard numbers, store size, memory usage) andinformation about the current nodes that form the cluster (number, roles, os,jvm versions, memory usage, cpu and installed plugins).

https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html

func (Stats)Do

func (rStats) Do(providedCtxcontext.Context) (*Response,error)

Do runs the request through the transport, handle the response and returns a stats.Response

func (*Stats)ErrorTraceadded inv8.14.0

func (r *Stats) ErrorTrace(errortracebool) *Stats

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errorswhen they occur.API name: error_trace

func (*Stats)FilterPathadded inv8.14.0

func (r *Stats) FilterPath(filterpaths ...string) *Stats

FilterPath Comma-separated list of filters in dot notation which reduce the responsereturned by Elasticsearch.API name: filter_path

func (*Stats)Header

func (r *Stats) Header(key, valuestring) *Stats

Header set a key, value pair in the Stats headers map.

func (*Stats)HttpRequest

func (r *Stats) HttpRequest(ctxcontext.Context) (*http.Request,error)

HttpRequest returns the http.Request object built from thegiven parameters.

func (*Stats)Humanadded inv8.14.0

func (r *Stats) Human(humanbool) *Stats

Human When set to `true` will return statistics in a format suitable for humans.For example `"exists_time": "1h"` for humans and`"eixsts_time_in_millis": 3600000` for computers. When disabled the humanreadable values will be omitted. This makes sense for responses beingconsumedonly by machines.API name: human

func (*Stats)IncludeRemotesadded inv8.16.0

func (r *Stats) IncludeRemotes(includeremotesbool) *Stats

IncludeRemotes Include remote cluster data into the responseAPI name: include_remotes

func (Stats)IsSuccess

func (rStats) IsSuccess(providedCtxcontext.Context) (bool,error)

IsSuccess allows to run a query with a context and retrieve the result as a boolean.This only exists for endpoints without a request payload and allows for quick control flow.

func (*Stats)NodeId

func (r *Stats) NodeId(nodeidstring) *Stats

NodeId Comma-separated list of node filters used to limit returned information.Defaults to all nodes in the cluster.API Name: nodeid

func (Stats)Performadded inv8.7.0

func (rStats) Perform(providedCtxcontext.Context) (*http.Response,error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*Stats)Prettyadded inv8.14.0

func (r *Stats) Pretty(prettybool) *Stats

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only usethis option for debugging only.API name: pretty

func (*Stats)Timeout

func (r *Stats) Timeout(durationstring) *Stats

Timeout Period to wait for each node to respond.If a node does not respond before its timeout expires, the response does notinclude its stats.However, timed out nodes are included in the response’s `_nodes.failed`property. Defaults to no timeout.API name: timeout

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp