server

package
v0.0.0-...-f73114c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmdline

type Cmdline []string

func (Cmdline) Parse

func (cmd Cmdline) Parse() map[string]string

Parse returns all the -E arguments passed to an apm-server except passwords

type ExpvarMetrics

type ExpvarMetrics struct {
	Cmdline  Cmdline  `json:"cmdline"`
	Memstats Memstats `json:"memstats"`
	LibbeatMetrics
}

func QueryExpvar

func QueryExpvar(secret, raw string) (ExpvarMetrics, error)

QueryExpvar sends a request to an apm-server /debug/vars endpoint and parses the result.

type Info

type Info struct {
	BuildDate time.Time `json:"build_date"`
	BuildSha  string    `json:"build_sha"`
	Version   string    `json:"version"`
}

func QueryInfo

func QueryInfo(secret, url string) (Info, error)

QueryInfo sends a request to an apm-server health-check endpoint and parses the result.

func (Info) String

func (info Info) String() string

type LibbeatMetrics

type LibbeatMetrics struct {
	OutputEventsActive   *int64 `json:"libbeat.output.events.active"`
	PipelineEventsActive *int64 `json:"libbeat.pipeline.events.active"`
}

type Memstats

type Memstats struct {
	TotalAlloc     uint64 `json:"TotalAlloc"`
	HeapAlloc      uint64 `json:"HeapAlloc"`
	Mallocs        uint64 `json:"Mallocs"`
	NumGC          uint64 `json:"NumGC"`
	TotalAllocDiff uint64
}

func (Memstats) String

func (ms Memstats) String() string

func (Memstats) Sub

func (ms Memstats) Sub(ms2 Memstats) Memstats

Sub subtracts some memory stats from another

type Status

type Status struct {
	Metrics               *ExpvarMetrics
	SpanIndexCount        uint64
	TransactionIndexCount uint64
	ErrorIndexCount       uint64
}

func GetStatus

func GetStatus(logger *log.Logger, secret, url string, connection es.Connection) Status

GetStatus returns apm-server info and memory stats, plus elasticsearch counts of apm documents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL