status

package
v0.0.0-...-80377ec Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Overview

Package status provides the ability to retrieve Gnocchi status through the Gnocchi API.

Example of Getting status

details := true

getOpts := status.GetOpts{
	Details: &details,
}

gnocchiStatus, err := status.Get(client, getOpts).Extract()
if err != nil {
	panic(err)
}

fmt.Printf("%+v\n", gnocchiStatus)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetOpts

type GetOpts struct {
	// Details allows to get status with all attributes.
	Details *bool `q:"details"`
}

GetOpts allows to provide additional options to the Gnocchi status Get request.

func (GetOpts) ToStatusGetQuery

func (opts GetOpts) ToStatusGetQuery() (string, error)

ToStatusGetQuery formats a GetOpts into a query string.

type GetOptsBuilder

type GetOptsBuilder interface {
	ToStatusGetQuery() (string, error)
}

GetOptsBuilder allows to add additional parameters to the Get request.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Gnocchi status.

func Get

Get retrieves the overall status of the Gnocchi installation.

func (GetResult) Extract

func (r GetResult) Extract() (*Status, error)

Extract is a function that accepts a result and extracts a Gnocchi status.

type Metricd

type Metricd struct {
	// Processors represents a list of running Gnocchi metricd processors.
	Processors []string `json:"processors"`
}

Metricd represents all running Gnocchi metricd daemons.

type Status

type Status struct {
	// Metricd represents all running Gnocchi metricd daemons.
	Metricd Metricd `json:"metricd"`

	// Storage contains Gnocchi storage data of measures backlog.
	Storage Storage `json:"storage"`
}

Status represents a Gnocchi status of measurements processing.

type Storage

type Storage struct {
	// MeasuresToProcess represents all metrics having measures to process.
	MeasuresToProcess map[string]int `json:"measures_to_process"`

	// Summary represents total count of metrics and processing measures.
	Summary Summary `json:"summary"`
}

Storage contains Gnocchi storage data of metrics and measures to process.

type Summary

type Summary struct {
	// Measures represents total number of measures to process.
	Measures int `json:"measures"`

	// Metrics represents total number of metric having measures to process.
	Metrics int `json:"metrics"`
}

Summary contains total numbers of metrics and measures to process.

Directories

Path Synopsis
status unit tests
status unit tests

Jump to

Keyboard shortcuts

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