metrics

package
v0.0.0-...-b09d12c Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodNameEnvKey      = "NFS_GANESHA_POD_NAME"
	PodNamespaceEnvKey = "NFS_GANESHA_POD_NAMESPACE"
)

Variables

View Source
var (
	// DefaultMetricsPort is the default port used to export prometheus metrics
	DefaultMetricsPort = int(8080)
	// DefaultMetricsPath is the default HTTP path to export prometheus metrics
	DefaultMetricsPath = "/metrics"
)

Functions

func GetSelfPod

func GetSelfPod(ctx context.Context, clnt *kclient) (*corev1.Pod, error)

func GetSelfPodID

func GetSelfPodID() types.NamespacedName

func RunNfsgMetricsExporter

func RunNfsgMetricsExporter(log logr.Logger) error

RunNfsgMetricsExporter executes an HTTP server and exports NFS-Ganesha stats as Prometheus metrics.

func UpdateDefaultVersions

func UpdateDefaultVersions(version, commitid string)

UpdateDefaultVersions re-assigns defaults upon init

Types

type Client

type Client struct {
	Client   string
	NFSv3    bool
	MNTv3    bool
	NLMv4    bool
	RQUOTA   bool
	NFSv40   bool
	NFSv41   bool
	NFSv42   bool
	Plan9    bool
	LastTime unix.Timespec
}

Client Structure of the output of ShowClients dbus call

type ClientIOStats

type ClientIOStats struct {
	NFSv3  IOStats
	NFSv40 IOStats
	NFSv41 IOStats
	NFSv42 IOStats
}

ClientIOStats

type ClientIOs

type ClientIOs struct {
	ReplyHeader
	ClientIOStats
}

ClientIOs

type ClientsDbusReader

type ClientsDbusReader struct {
	DbusReader
}

ClientsDbusReader

func NewClientsDbusReader

func NewClientsDbusReader() *ClientsDbusReader

NewClientsDbusReader

func (*ClientsDbusReader) GetClientIOs

func (cldr *ClientsDbusReader) GetClientIOs(
	ipaddr string) (*ClientIOs, bool, error)

func (*ClientsDbusReader) GetClients

func (cldr *ClientsDbusReader) GetClients() (unix.Timespec, []Client, error)

type DbusReader

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

DbusReader

func (*DbusReader) Close

func (dr *DbusReader) Close()

func (*DbusReader) Setup

func (dr *DbusReader) Setup() error

type Export

type Export struct {
	ExportID uint32
	Path     string
	NFSv3    bool
	MNTv3    bool
	NLMv4    bool
	RQUOTA   bool
	NFSv40   bool
	NFSv41   bool
	NFSv42   bool
	Plan9    bool
	LastTime unix.Timespec
}

Export Structure of the output of ShowExports dbus call

type ExportsDbusReader

type ExportsDbusReader struct {
	DbusReader
}

ExportsDbusReader

func NewExportsDbusReader

func NewExportsDbusReader() *ExportsDbusReader

NewExportsDbusReader

func (*ExportsDbusReader) GetAuthStats

func (exdr *ExportsDbusReader) GetAuthStats(exportID uint16) error

func (*ExportsDbusReader) GetExports

func (exdr *ExportsDbusReader) GetExports() (
	unix.Timespec, []Export, error)

func (*ExportsDbusReader) GetFullV3Stats

func (exdr *ExportsDbusReader) GetFullV3Stats(exportID uint16) error

func (*ExportsDbusReader) GetFullV4Stats

func (exdr *ExportsDbusReader) GetFullV4Stats(exportID uint16) error

func (*ExportsDbusReader) GetGlobalOPS

func (exdr *ExportsDbusReader) GetGlobalOPS(
	exportID uint16) (*OperationsStats, bool, error)

func (*ExportsDbusReader) GetTotalOPS

func (exdr *ExportsDbusReader) GetTotalOPS(
	exportID uint16) (*OperationsStats, bool, error)

type IOCounts

type IOCounts struct {
	Total       uint64
	Errors      uint64
	Transferred uint64
}

IOCounts

func ParseIOCounts

func ParseIOCounts(in interface{}) (IOCounts, int)

type IOStats

type IOStats struct {
	Read   IOCounts
	Write  IOCounts
	Other  IOCounts
	Layout IOCounts
}

IOStats

func ParseIOStats

func ParseIOStats(v []interface{}) (IOStats, int)

type OperationCount

type OperationCount struct {
	NFSv3  uint64
	MNTv1  uint64
	MNTv3  uint64
	NLMv4  uint64
	RQUOTA uint64
	NFSv40 uint64
	NFSv41 uint64
	NFSv42 uint64
	Plan9  uint64
}

OperationCount

type OperationStats

type OperationStats struct {
	Total  uint64
	Errors uint64
}

OperationStats

type OperationsStats

type OperationsStats struct {
	ReplyHeader
	OPS OperationCount
}

OperationsStats

type ReplyHeader

type ReplyHeader struct {
	Status bool
	Error  string
	Time   unix.Timespec
}

ReplyHeader

type Versions

type Versions struct {
	Version  string
	CommitID string
}

func GetVersions

func GetVersions() Versions

GetVersions returns the current default versions

Jump to

Keyboard shortcuts

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