bind

package
v0.0.0-...-3ca6cb5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QryRTT is the common prefix of query round-trip histogram counters.
	QryRTT = "QryRTT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Stats(...StatisticGroup) (Statistics, error)
}

Client queries the BIND API, parses the response and returns stats in a generic format.

type Counter

type Counter struct {
	Name    string `xml:"name,attr"`
	Counter uint   `xml:",chardata"`
}

Counter represents a single counter value.

type Gauge

type Gauge struct {
	Name  string `xml:"name"`
	Gauge int    `xml:"counter"`
}

Gauge represents a single gauge value.

type Server

type Server struct {
	BootTime         time.Time
	ConfigTime       time.Time
	IncomingQueries  []Counter
	IncomingRequests []Counter
	NameServerStats  []Counter
	ZoneStatistics   []Counter
}

Server represents BIND server statistics.

type StatisticGroup

type StatisticGroup string

StatisticGroup describes a sub-group of BIND statistics.

const (
	ServerStats StatisticGroup = "server"
	ViewStats   StatisticGroup = "view"
	TaskStats   StatisticGroup = "tasks"
)

Available statistic groups.

type Statistics

type Statistics struct {
	Server      Server
	Views       []View
	TaskManager TaskManager
}

Statistics is a generic representation of BIND statistics.

type Task

type Task struct {
	ID         string `xml:"id"`
	Name       string `xml:"name"`
	Quantum    uint   `xml:"quantum"`
	References uint   `xml:"references"`
	State      string `xml:"state"`
}

Task represents a single running task.

type TaskManager

type TaskManager struct {
	Tasks       []Task      `xml:"tasks>task"`
	ThreadModel ThreadModel `xml:"thread-model"`
}

TaskManager contains information about all running tasks.

type ThreadModel

type ThreadModel struct {
	Type           string `xml:"type"`
	WorkerThreads  uint   `xml:"worker-threads"`
	DefaultQuantum uint   `xml:"default-quantum"`
	TasksRunning   uint   `xml:"tasks-running"`
}

ThreadModel contains task and worker information.

type View

type View struct {
	Name            string
	Cache           []Gauge
	ResolverStats   []Counter
	ResolverQueries []Counter
}

View represents statistics for a single BIND view.

type XMLClient

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

XMLClient is a generic BIND API client to retrieve statistics in XML format.

func NewXMLClient

func NewXMLClient(url string, c *http.Client) *XMLClient

NewXMLClient returns an initialized XMLClient.

func (*XMLClient) Get

func (c *XMLClient) Get(p string, v interface{}) error

Get queries the given path and stores the result in the value pointed to by v. The endpoint must return a valid XML representation which can be unmarshaled into the provided value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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