nodestats

package
v1.12.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PeriodicReportInterval is the interval for generating periodic reports
	PeriodicReportInterval = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APILocalStats

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

APILocalStats is the struct for getting API stats

func NewAPILocalStats

func NewAPILocalStats() *APILocalStats

NewAPILocalStats creates a new APILocalStats

func (*APILocalStats) BuildReport

func (s *APILocalStats) BuildReport() string

BuildReport builds a report of the API stats

func (*APILocalStats) ReportCall

func (s *APILocalStats) ReportCall(report APIReport, size int64)

ReportCall reports a call to the API

type APIReport

type APIReport struct {
	Method       string
	HandlingTime time.Duration
	Success      bool
}

APIReport is the report of an API call

type DiskStatus

type DiskStatus struct {
	All  uint64 `json:"All"`
	Used uint64 `json:"Used"`
	Free uint64 `json:"Free"`
}

DiskStatus is the status of the disk

type NodeStats

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

NodeStats is the struct for getting node stats

func NewNodeStats

func NewNodeStats(stats ...StatsReporter) *NodeStats

NewNodeStats creates a new NodeStats

func (*NodeStats) Start

func (s *NodeStats) Start(ctx context.Context) error

Start starts the node stats

func (*NodeStats) Stop

func (s *NodeStats) Stop(ctx context.Context) error

Stop stops the node stats

type StatsReporter

type StatsReporter interface {
	BuildReport() string
}

StatsReporter is the interface for stats reporter

Jump to

Keyboard shortcuts

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