Documentation ¶
Index ¶
- Constants
- Variables
- func Atofloat64(s string) float64
- func Atouint64(s string) uint64
- func Exists(path string) bool
- func FatalError(ctx slog.Context, err error, msg interface{})
- func Fields(line string) []string
- func FileLineChannel(fpath string) <-chan string
- func FixUpName(name string) []string
- func GetEnvWithDefault(env string, def string) string
- func GetEnvWithDefaultBool(env string, def bool) bool
- func GetEnvWithDefaultDuration(env string, def string) time.Duration
- func GetEnvWithDefaultInt(env string, def int) int
- func GetEnvWithDefaultRegexp(env string, def string) *regexp.Regexp
- func GetEnvWithDefaultStrings(env string, def string) []string
- func GetEnvWithDefaultURL(env string, def string) *url.URL
- func LogError(ctx slog.Context, err error, msg interface{})
- func PercentFormat(val float64) string
- func SliceContainsString(ss []string, s string) bool
- func Ui64toa(val uint64) string
- func Version() string
- type Carbon
- type Cgroup
- type Config
- type Conntrack
- type CounterMeasurement
- func (c CounterMeasurement) Difference(l CounterMeasurement) uint64
- func (c CounterMeasurement) Name(prefix string) string
- func (c CounterMeasurement) StrValue() string
- func (c CounterMeasurement) Time() time.Time
- func (c CounterMeasurement) Type() MeasurementType
- func (c CounterMeasurement) Unit() Unit
- func (c CounterMeasurement) Value() interface{}
- type Cpu
- type CpuValues
- type Df
- type Disk
- type FileNr
- type FloatGaugeMeasurement
- func (g FloatGaugeMeasurement) Name(prefix string) string
- func (g FloatGaugeMeasurement) StrValue() string
- func (g FloatGaugeMeasurement) Time() time.Time
- func (c FloatGaugeMeasurement) Type() MeasurementType
- func (c FloatGaugeMeasurement) Unit() Unit
- func (g FloatGaugeMeasurement) Value() interface{}
- type FolsomEts
- type FolsomGarbageCollection
- type FolsomHistogram
- type FolsomIo
- type FolsomMemory
- type FolsomPoller
- type FolsomReductions
- type FolsomRuntime
- type FolsomStatistics
- type FolsomType
- type FolsomValue
- type FolsomWallClock
- type GaugeMeasurement
- type Librato
- type LibratoMetric
- type LibratoMetricAttrs
- type LibratoPostBody
- type Listen
- type Load
- type Measurement
- type MeasurementType
- type Memory
- type Multi
- type Nagios3StatsPoller
- type NetworkInterface
- type Ntpdate
- type Outputter
- type Poller
- type ProcInfo
- type Procs
- func (poller Procs) Exit()
- func (poller Procs) GetProcInfo(pid int) (pInfo ProcInfo)
- func (poller Procs) Name() string
- func (poller Procs) Poll(tick time.Time)
- func (poller Procs) ScanProcIo(pInfo *ProcInfo)
- func (poller Procs) ScanProcStat(pInfo *ProcInfo)
- func (poller Procs) ScanProcStatus(pInfo *ProcInfo)
- type Redis
- type Self
- type SockStat
- type SplunkPeerEntry
- type SplunkPeerKey
- type SplunkPeers
- type SplunkSearchPeersPoller
- type Statsd
- type StdOutL2MetDer
- type StdOutL2MetRaw
- type SyslogngStats
- type Unit
Examples ¶
- Atofloat64 (Big)
- Atofloat64 (Small)
- Atouint64 (Big)
- Atouint64 (Small)
- Exists
- Fields (Basic)
- Fields (Parens)
- Fields (Parens2)
- Fields (Squashed)
- FileLineChannel (NoError)
- FixUpName
- GetEnvWithDefault (Default)
- GetEnvWithDefault (Empty)
- GetEnvWithDefault (NotDefault)
- GetEnvWithDefault (NotSet)
- GetEnvWithDefaultDuration (Default)
- GetEnvWithDefaultDuration (Empty)
- GetEnvWithDefaultDuration (NotDefault)
- GetEnvWithDefaultDuration (NotSet)
- GetEnvWithDefaultInt (Default)
- GetEnvWithDefaultInt (Empty)
- GetEnvWithDefaultInt (NotDefault)
- GetEnvWithDefaultInt (NotSet)
- GetEnvWithDefaultStrings (Empty)
- GetEnvWithDefaultStrings (Multiple)
- GetEnvWithDefaultStrings (Single)
- PercentFormat
- SliceContainsString
- Ui64toa
Constants ¶
const ( DEFAULT_EMPTY_STRING = "" DEFAULT_INTERVAL = "60s" // Default tick interval for pollers DEFAULT_OUTPUTTER = "stdoutl2metder" // Default outputter DEFAULT_POLLERS = "conntrack,cpu,df,disk,listen,load,mem,nif,ntpdate,processes,self" // Default pollers DEFAULT_PROFILE_PORT = "0" // Default profile port, 0 disables DEFAULT_DF_TYPES = "btrfs,ext3,ext4,xfs" // Default fs types to report df for DEFAULT_DF_LOOP = false // Default to not reporting df metrics for loop back filesystems DEFAULT_NIF_DEVICES = "eth0" // Default interfaces to report stats for DEFAULT_NTPDATE_SERVERS = "0.pool.ntp.org,1.pool.ntp.org" // Default to the pool.ntp.org servers DEFAULT_CPU_AGGR = true // Default whether to only report aggregate CPU DEFAULT_SYSLOGNG_SOCKET = "/var/lib/syslog-ng/syslog-ng.ctl" // Default location of the syslog-ng socket DEFAULT_SELF_POLLER_MODE = "minimal" // Default to only minimal set of self metrics DEFAULT_SOCKSTAT_PROTOS = "TCP,UDP,TCP6,UDP6" // Default protocols to report sockstats on DEFAULT_PERCENTAGES = "" // Default pollers where publishing perc metrics is allowed DEFAULT_FULL = "" // Default list of pollers who should report full metrycs DEFAULT_LIBRATO_URL = "https://metrics-api.librato.com/v1/metrics" // Default librato url to submit metrics to DEFAULT_LIBRATO_BATCH_SIZE = 500 // Default submission count DEFAULT_LIBRATO_BATCH_TIMEOUT = "10s" // Default submission after DEFAULT_LIBRATO_ROUND = true // Round measure_time to interval DEFAULT_LISTEN_ADDR = "unix,#shh" // listen on UDS #shh DEFAULT_DISK_FILTER = "(xv|s)d" // xvd* and sd* by default DEFAULT_PROCESSES_REGEX = `\A\z` // Regex of processes to pull additional stats about DEFAULT_TICKS = 100 // Default number of clock ticks per second (see _SC_CLK_TCK) DEFAULT_PAGE_SIZE = 4096 // Default system page size (see getconf PAGESIZE) DEFAULT_NAGIOS3_METRIC_NAMES = "NUMSERVICES,NUMHOSTS,AVGACTSVCLAT,AVGACTHSTLAT,NUMHSTACTCHK5M,NUMSVCACTCHK5M,NUMHSTACTCHK1M,NUMSVCACTCHK1M" DEFAULT_SPLUNK_PEERS_SKIP_VERIFY = false DEFAULT_NETWORK_TIMEOUT = "5s" DEFAULT_REDIS_INFO = "clients:connected_clients;memory:used_memory,used_memory_rss;stats:instantaneous_ops_per_sec;keyspace:db0.keys" // semi colon seperated section:keya,keyb list DEFAULT_REDIS_URL = "tcp://localhost:6379/0?timeout=10s&maxidle=1" DEFAULT_META = false DEFAULT_CGROUPS = "" )
const ( SYS = "/sys/block/" SECTOR_SIZE = 512 )
const ( LibratoBacklog = 8 // No more than N pending batches in-flight LibratoMaxAttempts = 4 // Max attempts before dropping batch LibratoStartingBackoff = 500 * time.Millisecond )
const ( SOCKSTAT4 = "/proc/net/sockstat" SOCKSTAT6 = "/proc/net/sockstat6" )
const ( STATS_COMMAND = "STATS\n" HEADER = "SourceName;SourceId;SourceInstance;State;Type;Number" FOOTER = "." )
const (
CGROUPS_PATH = "/sys/fs/cgroup"
)
const (
CONNTRACK_DATA = "/proc/sys/net/netfilter/nf_conntrack_count"
)
const (
CPU_DATA = "/proc/stat"
)
const (
DEVICE_FILE = "/proc/net/dev"
)
const (
FILE_NR_DATA = "/proc/sys/fs/file-nr"
)
const (
LOAD_DATA = "/proc/loadavg"
)
const (
MEMORY_FILE = "/proc/meminfo"
)
const (
PROC = "/proc"
)
Variables ¶
var ( MetricNameRegexp = regexp.MustCompile("^[a-zA-Z0-9]([a-zA-Z0-9.-]+)?$") UnitRegexp = regexp.MustCompile("^([a-zA-Z$%#]+)(,([a-zA-Z$%#]+))?$") // <unit 1>,<abbr 3> )
var ( Logger = log.New(os.Stdout, "shh: ", log.LstdFlags) ErrLogger = log.New(os.Stderr, "shh: ", log.LstdFlags) )
var ( Empty = Unit{"", ""} Percent = Unit{"Percent", "%"} Bytes = Unit{"Bytes", "b"} Seconds = Unit{"Seconds", "s"} MilliSeconds = Unit{"MilliSeconds", "ms"} NanoSeconds = Unit{"NanoSeconds", "ns"} Requests = Unit{"Requests", "reqs"} Errors = Unit{"Errors", "errs"} Packets = Unit{"Packets", "pkts"} INodes = Unit{"INodes", "inodes"} Files = Unit{"Files", "files"} Processes = Unit{"Processes", "procs"} Threads = Unit{"Threads", "threads"} Connections = Unit{"Connections", "conns"} Sockets = Unit{"Sockets", "socks"} Avg = Unit{"Avg", "avg"} Objects = Unit{"Objects", "objs"} Routines = Unit{"Routines", "routines"} Metrics = Unit{"Metrics", "metrics"} Faults = Unit{"Faults", "faults"} Ops = Unit{"Operations", "ops"} Peers = Unit{"Peers", "peers"} ContextSwitches = Unit{"ContextSwitches", "cswit"} Words = Unit{"Words", "words"} Reductions = Unit{"Reductions", "rdux"} Terms = Unit{"Terms", "terms"} )
var (
MEM_MINIMAL_LIST = []string{"memfree", "memtotal", "swapfree", "swaptotal", "buffers", "cached", "swapcached"}
)
var (
MetricNameNormalizer = strings.NewReplacer("#", ".", "_", "-")
)
var (
NonWord = regexp.MustCompile("\\W")
)
var ( // RedisKnownGauges lists the metrics that are known Gauges RedisKnownGauges = map[string]struct{}{ "clients:connected_clients": struct{}{}, "clients:client_longest_output_list": struct{}{}, "clients:client_biggest_input_buf": struct{}{}, "clients:blocked_clients": struct{}{}, "keyspace:db0.keys": struct{}{}, "memory:used_memory": struct{}{}, "memory:used_memory_rss": struct{}{}, "memory:used_memory_peak": struct{}{}, "memory:used_memory_lua": struct{}{}, "replication:master_last_io_seconds_ago": struct{}{}, "replication:master_sync_in_progress": struct{}{}, "replication:master_sync_left_bytes": struct{}{}, "replication:master_sync_last_io_seconds_ago": struct{}{}, "replication:master_link_down_since_seconds": struct{}{}, "replication:connected_slaves": struct{}{}, "stats:instantaneous_ops_per_sec": struct{}{}, "stats:pubsub_channels": struct{}{}, "stats:pubsub_patterns": struct{}{}, "stats:latest_fork_usec": struct{}{}, } )
Functions ¶
func Atofloat64 ¶
Example (Big) ¶
fmt.Println(Atofloat64("10226292680.3"))
Output: 1.02262926803e+10
Example (Small) ¶
fmt.Println(Atofloat64("0.0"))
Output: 0
func Atouint64 ¶
Example (Big) ¶
fmt.Println(Atouint64("10226292680"))
Output: 10226292680
Example (Small) ¶
fmt.Println(Atouint64("0"))
Output: 0
func Exists ¶
Checks to see if a path exists or not
Example ¶
fmt.Println(Exists("./foozle_not_found")) fmt.Println(Exists("./file_test.go"))
Output: false true
func FatalError ¶ added in v0.6.0
func Fields ¶
Example (Basic) ¶
fmt.Println(Fields(" eth0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"))
Output: [eth0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Example (Parens) ¶
fmt.Println(Fields("372 (kworker/2:1) S 2 0 0 0 -1 69238880 0 0 0 0 0 17293 0 0 20 0 1 0 40 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 18446744073709551615 0 0 17 2 0 0 0 0 0 0 0 0 0 0 0 0 0\n"))
Output: [372 (kworker/2:1) S 2 0 0 0 -1 69238880 0 0 0 0 0 17293 0 0 20 0 1 0 40 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 18446744073709551615 0 0 17 2 0 0 0 0 0 0 0 0 0 0 0 0 0]
Example (Parens2) ¶
f := Fields("Active(anon): 42384 kB") fmt.Println(f) fmt.Println(len(f))
Output: [Active(anon) 42384 kB] 3
Example (Squashed) ¶
fmt.Println(Fields(" eth0:10226292680 39079204 0 0 0 0 0 0 10250230999 51012120 0 0 0 0 0 0\n"))
Output: [eth0 10226292680 39079204 0 0 0 0 0 0 10250230999 51012120 0 0 0 0 0 0]
func FileLineChannel ¶
Small wrapper to handle errors on open
Example (NoError) ¶
FileLineChannel
c := FileLineChannel("./misc_test.go") var i int for d := range c { d = d i++ } fmt.Println(i > 0)
Output: true
func FixUpName ¶
Example ¶
FixUpName
fmt.Println(FixUpName("foo(bar)")) fmt.Println(FixUpName("Foo(Bar)")) fmt.Println(FixUpName("foo_bar")) fmt.Println(FixUpName("Foo_Bar)")) fmt.Println(FixUpName("Foo")) fmt.Println(FixUpName("(Foo)"))
Output: [foo bar] [foo bar] [foo bar] [foo bar] [foo] [foo]
func GetEnvWithDefault ¶
Returns the value of $env from the OS and if it's empty, returns def
Example (Default) ¶
os.Setenv("SHH_TEST_ENV", "bar") fmt.Println(GetEnvWithDefault("SHH_TEST_ENV", "bar"))
Output: bar
Example (Empty) ¶
os.Setenv("SHH_TEST_ENV", "") fmt.Println(GetEnvWithDefault("SHH_TEST_ENV", "bar"))
Output: bar
Example (NotDefault) ¶
os.Setenv("SHH_TEST_ENV", "foo") fmt.Println(GetEnvWithDefault("SHH_TEST_ENV", "bar"))
Output: foo
Example (NotSet) ¶
os.Clearenv() fmt.Println(GetEnvWithDefault("SHH_TEST_ENV", "bar"))
Output: bar
func GetEnvWithDefaultBool ¶
Returns the value of $env from the OS and if it's empty, returns def
func GetEnvWithDefaultDuration ¶
Example (Default) ¶
os.Setenv("SHH_TEST_ENV", "42s") fmt.Println(GetEnvWithDefaultDuration("SHH_TEST_ENV", "42s"))
Output: 42s
Example (Empty) ¶
os.Setenv("SHH_TEST_ENV", "") fmt.Println(GetEnvWithDefaultDuration("SHH_TEST_ENV", "42s"))
Output: 42s
Example (NotDefault) ¶
os.Setenv("SHH_TEST_ENV", "7s") fmt.Println(GetEnvWithDefaultDuration("SHH_TEST_ENV", "42s"))
Output: 7s
Example (NotSet) ¶
os.Clearenv() fmt.Println(GetEnvWithDefaultDuration("SHH_TEST_ENV", "42s"))
Output: 42s
func GetEnvWithDefaultInt ¶
Returns the value of $env from the OS and if it's empty, returns def
Example (Default) ¶
os.Setenv("SHH_TEST_ENV", "42") fmt.Println(GetEnvWithDefaultInt("SHH_TEST_ENV", 42))
Output: 42
Example (Empty) ¶
os.Setenv("SHH_TEST_ENV", "") fmt.Println(GetEnvWithDefaultInt("SHH_TEST_ENV", 42))
Output: 42
Example (NotDefault) ¶
os.Setenv("SHH_TEST_ENV", "7") fmt.Println(GetEnvWithDefaultInt("SHH_TEST_ENV", 42))
Output: 7
Example (NotSet) ¶
os.Clearenv() fmt.Println(GetEnvWithDefaultInt("SHH_TEST_ENV", 42))
Output: 42
func GetEnvWithDefaultRegexp ¶ added in v0.8.3
Returns a *regexp.Regexp compiled from the env or default
func GetEnvWithDefaultStrings ¶
Returns a slice of sorted strings from the environment or default split on , So "foo,bar" returns ["bar","foo"]
Example (Empty) ¶
os.Setenv("SHH_TEST_ENV", "") fmt.Println(len(GetEnvWithDefaultStrings("SHH_TEST_ENV", "")))
Output: 0
Example (Multiple) ¶
os.Setenv("SHH_TEST_ENV", "foo,bar") v := GetEnvWithDefaultStrings("SHH_TEST_ENV", "") fmt.Println(len(v)) fmt.Println(v[0]) fmt.Println(v[1])
Output: 2 bar foo
Example (Single) ¶
os.Setenv("SHH_TEST_ENV", "foo") v := GetEnvWithDefaultStrings("SHH_TEST_ENV", "") fmt.Println(len(v)) fmt.Println(v[0])
Output: 1 foo
func GetEnvWithDefaultURL ¶ added in v0.8.8
Returns a *url.URL representing the given env, or nil if empty
func PercentFormat ¶
Example ¶
fmt.Println(PercentFormat(100.0)) fmt.Println(PercentFormat(42.314))
Output: 100.00 42.31
func SliceContainsString ¶
Example ¶
fmt.Println(SliceContainsString([]string{"a", "b", "c"}, "a")) fmt.Println(SliceContainsString([]string{"a", "b", "c"}, "b")) fmt.Println(SliceContainsString([]string{"a", "b", "c"}, "c")) fmt.Println(SliceContainsString([]string{"a", "b", "c"}, "z")) fmt.Println(SliceContainsString([]string{"a", "b", "c"}, "aa"))
Output: true true true false false
Types ¶
type Carbon ¶
type Carbon struct { Host string // contains filtered or unexported fields }
func NewCarbonOutputter ¶
func NewCarbonOutputter(measurements <-chan Measurement, config Config) *Carbon
type Cgroup ¶ added in v0.9.11
type Cgroup struct {
// contains filtered or unexported fields
}
func NewCgroupPoller ¶ added in v0.9.11
func NewCgroupPoller(measurements chan<- Measurement, config Config) Cgroup
type Config ¶
type Config struct { Interval time.Duration Outputter string Pollers []string Source string Prefix string ProfilePort string Percentages []string Full []string DfTypes []string DfLoop bool Listen string ListenTimeout time.Duration NifDevices []string NtpdateServers []string CpuOnlyAggregate bool LibratoUrl *url.URL LibratoUser string LibratoToken string LibratoBatchSize int LibratoBatchTimeout time.Duration LibratoRound bool NetworkTimeout time.Duration CarbonHost string SockStatProtos []string StatsdHost string StatsdProto string SyslogngSocket string Start time.Time DiskFilter *regexp.Regexp UserAgent string ProcessesRegex *regexp.Regexp Ticks int PageSize int Nagios3MetricNames []string SplunkPeersSkipVerify bool SplunkPeersUrl *url.URL FolsomBaseUrl *url.URL RedisUrl *url.URL RedisInfo string Meta bool Cgroups []string // contains filtered or unexported fields }
type Conntrack ¶
type Conntrack struct {
// contains filtered or unexported fields
}
func NewConntrackPoller ¶
func NewConntrackPoller(measurements chan<- Measurement) Conntrack
type CounterMeasurement ¶ added in v0.5.0
type CounterMeasurement struct {
// contains filtered or unexported fields
}
func (CounterMeasurement) Difference ¶ added in v0.5.0
func (c CounterMeasurement) Difference(l CounterMeasurement) uint64
func (CounterMeasurement) Name ¶ added in v0.5.0
func (c CounterMeasurement) Name(prefix string) string
func (CounterMeasurement) StrValue ¶ added in v0.5.0
func (c CounterMeasurement) StrValue() string
func (CounterMeasurement) Time ¶ added in v0.5.0
func (c CounterMeasurement) Time() time.Time
func (CounterMeasurement) Type ¶ added in v0.5.0
func (c CounterMeasurement) Type() MeasurementType
func (CounterMeasurement) Unit ¶ added in v0.5.0
func (c CounterMeasurement) Unit() Unit
func (CounterMeasurement) Value ¶ added in v0.5.0
func (c CounterMeasurement) Value() interface{}
type Cpu ¶
type Cpu struct { AggregateOnly bool // contains filtered or unexported fields }
func NewCpuPoller ¶
func NewCpuPoller(measurements chan<- Measurement, config Config) Cpu
type CpuValues ¶
type CpuValues struct { User float64 Nice float64 System float64 Idle float64 Iowait float64 Irq float64 Softirq float64 Steal float64 Guest float64 }
func (CpuValues) DiffPercent ¶
type Df ¶
func NewDfPoller ¶
func NewDfPoller(measurements chan<- Measurement, config Config) Df
type Disk ¶
type Disk struct {
// contains filtered or unexported fields
}
func NewDiskPoller ¶
func NewDiskPoller(measurements chan<- Measurement, config Config) Disk
type FileNr ¶ added in v0.5.0
type FileNr struct {
// contains filtered or unexported fields
}
func NewFileNrPoller ¶ added in v0.5.0
func NewFileNrPoller(measurements chan<- Measurement) FileNr
type FloatGaugeMeasurement ¶ added in v0.5.0
type FloatGaugeMeasurement struct {
// contains filtered or unexported fields
}
func (FloatGaugeMeasurement) Name ¶ added in v0.5.0
func (g FloatGaugeMeasurement) Name(prefix string) string
func (FloatGaugeMeasurement) StrValue ¶ added in v0.5.0
func (g FloatGaugeMeasurement) StrValue() string
func (FloatGaugeMeasurement) Time ¶ added in v0.5.0
func (g FloatGaugeMeasurement) Time() time.Time
func (FloatGaugeMeasurement) Type ¶ added in v0.5.0
func (c FloatGaugeMeasurement) Type() MeasurementType
func (FloatGaugeMeasurement) Unit ¶ added in v0.5.0
func (c FloatGaugeMeasurement) Unit() Unit
func (FloatGaugeMeasurement) Value ¶ added in v0.5.0
func (g FloatGaugeMeasurement) Value() interface{}
type FolsomGarbageCollection ¶ added in v0.9.2
type FolsomHistogram ¶ added in v0.9.12
type FolsomHistogram struct { ArithmeticMean float64 `json:"arithmetic_mean"` GeometricMean float64 `json:"geometric_mean"` HarmonicMean float64 `json:"harmonic_mean"` Histogram map[string]float64 `json:"histogram"` Kurtosis float64 `json:"kurtosis"` N uint64 `json:"n"` Max float64 `json:"max"` Median float64 `json:"median"` Min float64 `json:"min"` Percentile map[string]float64 `json:"percentile"` Skewness float64 `json:"skewness"` StandardDeviation float64 `json:"standard_deviation"` Variance float64 `json:"variance"` }
type FolsomMemory ¶ added in v0.9.2
type FolsomMemory struct { Total uint64 `json:"total"` Processes uint64 `json:"processes"` ProcessesUsed uint64 `json:"processes_used"` System uint64 `json:"system"` Atom uint64 `json:"atom"` AtomUsed uint64 `json:"atom_used"` Binary uint64 `json:"binary"` Code uint64 `json:"code"` Ets uint64 `json:"ets"` }
type FolsomPoller ¶ added in v0.9.2
type FolsomPoller struct {
// contains filtered or unexported fields
}
func NewFolsomPoller ¶ added in v0.9.2
func NewFolsomPoller(measurements chan<- Measurement, config Config) FolsomPoller
func (FolsomPoller) Exit ¶ added in v0.9.2
func (poller FolsomPoller) Exit()
func (FolsomPoller) Name ¶ added in v0.9.2
func (poller FolsomPoller) Name() string
func (FolsomPoller) Poll ¶ added in v0.9.2
func (poller FolsomPoller) Poll(tick time.Time)
type FolsomReductions ¶ added in v0.9.2
type FolsomRuntime ¶ added in v0.9.2
type FolsomStatistics ¶ added in v0.9.2
type FolsomStatistics struct { ContextSwitches uint64 `json:"context_switches"` GarbageCollection FolsomGarbageCollection `json:"garbage_collection"` Io FolsomIo `json:"io"` Reductions FolsomReductions `json:"reductions"` RunQueue uint64 `json:"run_queue"` Runtime FolsomRuntime `json:"runtime"` WallClock FolsomWallClock `json:"wall_clock"` SchedUtil uint64 `json:"sched_util"` }
type FolsomType ¶ added in v0.9.3
type FolsomType struct {
Type string `json:"type"`
}
type FolsomValue ¶ added in v0.9.2
type FolsomWallClock ¶ added in v0.9.2
type GaugeMeasurement ¶ added in v0.5.0
type GaugeMeasurement struct {
// contains filtered or unexported fields
}
func (GaugeMeasurement) Name ¶ added in v0.5.0
func (g GaugeMeasurement) Name(prefix string) string
func (GaugeMeasurement) StrValue ¶ added in v0.5.0
func (g GaugeMeasurement) StrValue() string
func (GaugeMeasurement) Time ¶ added in v0.5.0
func (g GaugeMeasurement) Time() time.Time
func (GaugeMeasurement) Type ¶ added in v0.5.0
func (c GaugeMeasurement) Type() MeasurementType
func (GaugeMeasurement) Unit ¶ added in v0.5.0
func (c GaugeMeasurement) Unit() Unit
func (GaugeMeasurement) Value ¶ added in v0.5.0
func (g GaugeMeasurement) Value() interface{}
type Librato ¶
type Librato struct { Timeout time.Duration BatchSize int User string Token string Url string // contains filtered or unexported fields }
func NewLibratoOutputter ¶
func NewLibratoOutputter(measurements <-chan Measurement, config Config) *Librato
type LibratoMetric ¶
type LibratoMetric struct { Name string `json:"name"` Value interface{} `json:"value"` When int64 `json:"measure_time"` Source string `json:"source,omitempty"` Attributes LibratoMetricAttrs `json:"attributes,omitempty"` }
type LibratoMetricAttrs ¶ added in v0.5.0
type LibratoPostBody ¶ added in v0.5.0
type LibratoPostBody struct { Gauges []LibratoMetric `json:"gauges,omitempty"` Counters []LibratoMetric `json:"counters,omitempty"` }
type Listen ¶
func NewListenPoller ¶
func NewListenPoller(measurements chan<- Measurement, config Config) Listen
func (*Listen) HandleListenConnection ¶ added in v0.8.8
type Load ¶
type Load struct {
// contains filtered or unexported fields
}
func NewLoadPoller ¶
func NewLoadPoller(measurements chan<- Measurement) Load
type Measurement ¶
type MeasurementType ¶ added in v0.5.0
type MeasurementType int
const ( CounterType MeasurementType = iota GaugeType FloatGaugeType )
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func NewMemoryPoller ¶
func NewMemoryPoller(measurements chan<- Measurement, config Config) Memory
type Multi ¶
func NewMultiPoller ¶
func NewMultiPoller(measurements chan<- Measurement, config Config) Multi
func (Multi) RegisterPoller ¶
type Nagios3StatsPoller ¶ added in v0.8.6
type Nagios3StatsPoller struct {
// contains filtered or unexported fields
}
func NewNagios3StatsPoller ¶ added in v0.8.6
func NewNagios3StatsPoller(measurements chan<- Measurement, config Config) Nagios3StatsPoller
func (Nagios3StatsPoller) Exit ¶ added in v0.8.6
func (poller Nagios3StatsPoller) Exit()
func (Nagios3StatsPoller) Name ¶ added in v0.8.6
func (poller Nagios3StatsPoller) Name() string
func (Nagios3StatsPoller) Poll ¶ added in v0.8.6
func (poller Nagios3StatsPoller) Poll(tick time.Time)
type NetworkInterface ¶
type NetworkInterface struct { Devices []string // contains filtered or unexported fields }
func NewNetworkInterfacePoller ¶
func NewNetworkInterfacePoller(measurements chan<- Measurement, config Config) NetworkInterface
func (NetworkInterface) Exit ¶
func (poller NetworkInterface) Exit()
func (NetworkInterface) Name ¶
func (poller NetworkInterface) Name() string
func (NetworkInterface) Poll ¶
func (poller NetworkInterface) Poll(tick time.Time)
http://www.kernel.org/doc/Documentation/filesystems/proc.txt (section 1.4)
type Ntpdate ¶
type Ntpdate struct { Servers []string // contains filtered or unexported fields }
func NewNtpdatePoller ¶
func NewNtpdatePoller(measurements chan<- Measurement, config Config) Ntpdate
type Outputter ¶
type Outputter interface {
Start()
}
func NewOutputter ¶
func NewOutputter(name string, measurements <-chan Measurement, config Config) (Outputter, error)
FIXME: Any way to do this with reflect and a map?
type Procs ¶ added in v0.5.0
type Procs struct {
// contains filtered or unexported fields
}
func NewProcessesPoller ¶
func NewProcessesPoller(measurements chan<- Measurement, config Config) Procs
func (Procs) GetProcInfo ¶ added in v0.8.3
func (Procs) ScanProcIo ¶ added in v0.8.3
func (Procs) ScanProcStat ¶ added in v0.8.3
func (Procs) ScanProcStatus ¶ added in v0.8.3
type Redis ¶ added in v0.9.5
type Redis struct {
// contains filtered or unexported fields
}
Redis poller info contains a mapping for the section to the keys that you want for each key. See DEFAULT_REDIS_INFO comment
func NewRedisPoller ¶ added in v0.9.5
func NewRedisPoller(measurements chan<- Measurement, config Config) Redis
NewRedisPoller constructs a functioning Redis poller from the provided config and reports on the provided channel
type Self ¶
type Self struct {
// contains filtered or unexported fields
}
func NewSelfPoller ¶
func NewSelfPoller(measurements chan<- Measurement, config Config) Self
type SockStat ¶ added in v0.5.0
type SockStat struct { Protocols []string // contains filtered or unexported fields }
func NewSockStatPoller ¶ added in v0.5.0
func NewSockStatPoller(measurements chan<- Measurement, config Config) SockStat
type SplunkPeerEntry ¶ added in v0.8.8
type SplunkPeerEntry struct { Title string `xml:"title"` Keys []SplunkPeerKey `xml:"content>dict>key"` }
type SplunkPeerKey ¶ added in v0.8.8
type SplunkPeers ¶ added in v0.8.8
type SplunkPeers struct {
Entries []SplunkPeerEntry `xml:"entry"`
}
type SplunkSearchPeersPoller ¶ added in v0.8.8
type SplunkSearchPeersPoller struct {
// contains filtered or unexported fields
}
func NewSplunkSearchPeersPoller ¶ added in v0.8.8
func NewSplunkSearchPeersPoller(measurements chan<- Measurement, config Config) SplunkSearchPeersPoller
func (SplunkSearchPeersPoller) Exit ¶ added in v0.8.8
func (poller SplunkSearchPeersPoller) Exit()
func (SplunkSearchPeersPoller) Name ¶ added in v0.8.8
func (poller SplunkSearchPeersPoller) Name() string
func (SplunkSearchPeersPoller) Poll ¶ added in v0.8.8
func (poller SplunkSearchPeersPoller) Poll(tick time.Time)
type Statsd ¶
func NewStatsdOutputter ¶
func NewStatsdOutputter(measurements <-chan Measurement, config Config) *Statsd
func (*Statsd) Encode ¶
func (s *Statsd) Encode(mm Measurement) string
type StdOutL2MetDer ¶
type StdOutL2MetDer struct {
// contains filtered or unexported fields
}
func NewStdOutL2MetDer ¶
func NewStdOutL2MetDer(measurements <-chan Measurement, config Config) *StdOutL2MetDer
func (*StdOutL2MetDer) Output ¶
func (out *StdOutL2MetDer) Output()
func (*StdOutL2MetDer) Start ¶
func (out *StdOutL2MetDer) Start()
type StdOutL2MetRaw ¶
type StdOutL2MetRaw struct {
// contains filtered or unexported fields
}
func NewStdOutL2MetRaw ¶
func NewStdOutL2MetRaw(measurements <-chan Measurement, config Config) *StdOutL2MetRaw
func (*StdOutL2MetRaw) Output ¶
func (out *StdOutL2MetRaw) Output()
func (*StdOutL2MetRaw) Start ¶
func (out *StdOutL2MetRaw) Start()
type SyslogngStats ¶
type SyslogngStats struct { Socket string // contains filtered or unexported fields }
func NewSyslogngStatsPoller ¶
func NewSyslogngStatsPoller(measurements chan<- Measurement, config Config) SyslogngStats
func (SyslogngStats) Exit ¶
func (poller SyslogngStats) Exit()
func (SyslogngStats) Name ¶
func (poller SyslogngStats) Name() string
func (SyslogngStats) Poll ¶
func (poller SyslogngStats) Poll(tick time.Time)
Source Files ¶
- carbon_output.go
- cgroup_poller.go
- config.go
- conntrack_poller.go
- cpu_poller.go
- df_poller.go
- disk_poller.go
- filenr_poller.go
- folsom_poller.go
- librato_output.go
- listen_poller.go
- load_poller.go
- log.go
- mem_poller.go
- mm.go
- nagios3stats_poller.go
- nif_poller.go
- ntpdate_poller.go
- outputters.go
- pollers.go
- processes_poller.go
- redis_poller.go
- self_poller.go
- sockstat_poller.go
- splunk_search_peers_poller.go
- statsd_output.go
- stdout_output.go
- syslog-ng_stats.go
- units.go
- utils.go