File: results.go

package info (click to toggle)
golang-github-gophercloud-utils 0.0~git20231010.80377ec-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 816 kB
  • sloc: sh: 20; makefile: 7
file content (53 lines) | stat: -rw-r--r-- 1,574 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package status

import "github.com/gophercloud/gophercloud"

type commonResult struct {
	gophercloud.Result
}

// Extract is a function that accepts a result and extracts a Gnocchi status.
func (r commonResult) Extract() (*Status, error) {
	var s *Status
	err := r.ExtractInto(&s)
	return s, err
}

// GetResult represents the result of a get operation. Call its Extract
// method to interpret it as a Gnocchi status.
type GetResult struct {
	commonResult
}

// Status represents a Gnocchi status of measurements processing.
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"`
}

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

// Storage contains Gnocchi storage data of metrics and measures to process.
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"`
}

// Summary contains total numbers of metrics and measures to process.
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"`
}