bind_exporter: github.com/digitalocean/bind_exporter/bind Index | Files | Directories

package bind

import "github.com/digitalocean/bind_exporter/bind"

Index

Package Files

bind.go

Constants

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

type Client Uses

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

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

type Counter Uses

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

Counter represents a single counter value.

type Gauge Uses

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

Gauge represents a single gauge value.

type Server Uses

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

Server represents BIND server statistics.

type StatisticGroup Uses

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 Uses

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

Statistics is a generic representation of BIND statistics.

type Task Uses

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 Uses

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

TaskManager contains information about all running tasks.

type ThreadModel Uses

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 Uses

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

View represents statistics for a single BIND view.

type XMLClient Uses

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

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

func NewXMLClient Uses

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

NewXMLClient returns an initialized XMLClient.

func (*XMLClient) Get Uses

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

PathSynopsis
auto
v2
v3

Package bind imports 7 packages (graph) and is imported by 4 packages. Updated 2019-03-17. Refresh now. Tools for package owners.