diagnostics - ActiveState ActiveGo 1.8
...

Package diagnostics

import "github.com/influxdata/influxdb/monitor/diagnostics"
Overview
Index

Overview ▾

Package diagnostics provides the diagnostics type so that other packages can provide diagnostics without depending on the monitor package.

type Client

Client is the interface modules implement if they register diagnostics with monitor.

type Client interface {
    Diagnostics() (*Diagnostics, error)
}

type ClientFunc

The ClientFunc type is an adapter to allow the use of ordinary functions as Diagnostics clients.

type ClientFunc func() (*Diagnostics, error)

func (ClientFunc) Diagnostics

func (f ClientFunc) Diagnostics() (*Diagnostics, error)

Diagnostics calls f().

type Diagnostics

Diagnostics represents a table of diagnostic information. The first value is the name of the columns, the second is a slice of interface slices containing the values for each column, by row. This information is never written to an InfluxDB system and is display-only. An example showing, say, connections follows:

source_ip    source_port       dest_ip     dest_port
182.1.0.2    2890              127.0.0.1   38901
174.33.1.2   2924              127.0.0.1   38902
type Diagnostics struct {
    Columns []string
    Rows    [][]interface{}
}

func NewDiagnostics

func NewDiagnostics(columns []string) *Diagnostics

NewDiagnostic initialises a new Diagnostics with the specified columns.

func (*Diagnostics) AddRow

func (d *Diagnostics) AddRow(r []interface{})

AddRow appends the provided row to the Diagnostics' rows.