rename client struct
This commit is contained in:
parent
640075da94
commit
e88f889baa
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"golift.io/unifi"
|
"golift.io/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
type client struct {
|
type uclient struct {
|
||||||
Anomalies *prometheus.Desc
|
Anomalies *prometheus.Desc
|
||||||
BytesR *prometheus.Desc
|
BytesR *prometheus.Desc
|
||||||
CCQ *prometheus.Desc
|
CCQ *prometheus.Desc
|
||||||
|
|
@ -38,7 +38,7 @@ type client struct {
|
||||||
DpiStatsTxPackets *prometheus.Desc
|
DpiStatsTxPackets *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
func descClient(ns string) *client {
|
func descClient(ns string) *uclient {
|
||||||
if ns += "_client_"; ns == "_client_" {
|
if ns += "_client_"; ns == "_client_" {
|
||||||
ns = "client_"
|
ns = "client_"
|
||||||
}
|
}
|
||||||
|
|
@ -48,7 +48,7 @@ func descClient(ns string) *client {
|
||||||
"sw_name", "radio_name", "radio", "radio_proto", "name", "channel",
|
"sw_name", "radio_name", "radio", "radio_proto", "name", "channel",
|
||||||
"vlan", "ip", "essid", "bssid", "radio_desc"}
|
"vlan", "ip", "essid", "bssid", "radio_desc"}
|
||||||
|
|
||||||
return &client{
|
return &uclient{
|
||||||
Anomalies: prometheus.NewDesc(ns+"anomalies_total", "Client Anomalies", labels, nil),
|
Anomalies: prometheus.NewDesc(ns+"anomalies_total", "Client Anomalies", labels, nil),
|
||||||
BytesR: prometheus.NewDesc(ns+"bytes_rate", "Client Data Rate", labels, nil),
|
BytesR: prometheus.NewDesc(ns+"bytes_rate", "Client Data Rate", labels, nil),
|
||||||
CCQ: prometheus.NewDesc(ns+"ccq", "Client Connection Quality", labels, nil),
|
CCQ: prometheus.NewDesc(ns+"ccq", "Client Connection Quality", labels, nil),
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ type UnifiCollectorCnfg struct {
|
||||||
// and the collected metrics will be incomplete. Possibly, no metrics
|
// and the collected metrics will be incomplete. Possibly, no metrics
|
||||||
// will be collected at all.
|
// will be collected at all.
|
||||||
ReportErrors bool
|
ReportErrors bool
|
||||||
// This function is passed to the Collect() method. The Collect method runs This
|
// This function is passed to the Collect() method. The Collect method runs
|
||||||
// function to retreive the latest UniFi
|
// this function to retreive the latest UniFi measurements and export them.
|
||||||
CollectFn func() (*metrics.Metrics, error)
|
CollectFn func() (*metrics.Metrics, error)
|
||||||
// Provide a logger function if you want to run a routine *after* prometheus checks in.
|
// Provide a logger function if you want to run a routine *after* prometheus checks in.
|
||||||
LoggingFn func(*Report)
|
LoggingFn func(*Report)
|
||||||
|
|
@ -29,7 +29,7 @@ type UnifiCollectorCnfg struct {
|
||||||
|
|
||||||
type unifiCollector struct {
|
type unifiCollector struct {
|
||||||
Config UnifiCollectorCnfg
|
Config UnifiCollectorCnfg
|
||||||
Client *client
|
Client *uclient
|
||||||
UAP *uap
|
UAP *uap
|
||||||
USG *usg
|
USG *usg
|
||||||
USW *usw
|
USW *usw
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue