mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-02 00:26:35 +00:00
chore: Ensure collector build funcs are private
Collector builder functions are only used internally in the `collector` package, and shouldn't needlessly be exposed as part of the package API to downstream clients. Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
@@ -76,8 +76,8 @@ type ADCollector struct {
|
|||||||
TombstonedObjectsVisitedTotal *prometheus.Desc
|
TombstonedObjectsVisitedTotal *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewADCollector ...
|
// newADCollector ...
|
||||||
func NewADCollector() (Collector, error) {
|
func newADCollector() (Collector, error) {
|
||||||
const subsystem = "ad"
|
const subsystem = "ad"
|
||||||
return &ADCollector{
|
return &ADCollector{
|
||||||
AddressBookOperationsTotal: prometheus.NewDesc(
|
AddressBookOperationsTotal: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkADCollector(b *testing.B) {
|
func BenchmarkADCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "ad", NewADCollector)
|
benchmarkCollector(b, "ad", newADCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ type ContainerMetricsCollector struct {
|
|||||||
WriteSizeBytes *prometheus.Desc
|
WriteSizeBytes *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewContainerMetricsCollector constructs a new ContainerMetricsCollector
|
// newContainerMetricsCollector constructs a new ContainerMetricsCollector
|
||||||
func NewContainerMetricsCollector() (Collector, error) {
|
func newContainerMetricsCollector() (Collector, error) {
|
||||||
const subsystem = "container"
|
const subsystem = "container"
|
||||||
return &ContainerMetricsCollector{
|
return &ContainerMetricsCollector{
|
||||||
ContainerAvailable: prometheus.NewDesc(
|
ContainerAvailable: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkContainerCollector(b *testing.B) {
|
func BenchmarkContainerCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "container", NewContainerMetricsCollector)
|
benchmarkCollector(b, "container", newContainerMetricsCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ type CSCollector struct {
|
|||||||
Hostname *prometheus.Desc
|
Hostname *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCSCollector ...
|
// newCSCollector ...
|
||||||
func NewCSCollector() (Collector, error) {
|
func newCSCollector() (Collector, error) {
|
||||||
const subsystem = "cs"
|
const subsystem = "cs"
|
||||||
|
|
||||||
return &CSCollector{
|
return &CSCollector{
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkCsCollector(b *testing.B) {
|
func BenchmarkCsCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "cs", NewCSCollector)
|
benchmarkCollector(b, "cs", newCSCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ func dfsrGetPerfObjectName(collector string) string {
|
|||||||
return (prefix + suffix)
|
return (prefix + suffix)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDFSRCollector is registered
|
// newDFSRCollector is registered
|
||||||
func NewDFSRCollector() (Collector, error) {
|
func newDFSRCollector() (Collector, error) {
|
||||||
log.Info("dfsr collector is in an experimental state! Metrics for this collector have not been tested.")
|
log.Info("dfsr collector is in an experimental state! Metrics for this collector have not been tested.")
|
||||||
const subsystem = "dfsr"
|
const subsystem = "dfsr"
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkDFSRCollector(b *testing.B) {
|
func BenchmarkDFSRCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "dfsr", NewDFSRCollector)
|
benchmarkCollector(b, "dfsr", newDFSRCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ type DhcpCollector struct {
|
|||||||
FailoverBndupdDropped *prometheus.Desc
|
FailoverBndupdDropped *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDhcpCollector() (Collector, error) {
|
func newDhcpCollector() (Collector, error) {
|
||||||
const subsystem = "dhcp"
|
const subsystem = "dhcp"
|
||||||
|
|
||||||
return &DhcpCollector{
|
return &DhcpCollector{
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkDHCPCollector(b *testing.B) {
|
func BenchmarkDHCPCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "dhcp", NewDhcpCollector)
|
benchmarkCollector(b, "dhcp", newDhcpCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ type DNSCollector struct {
|
|||||||
UnmatchedResponsesReceived *prometheus.Desc
|
UnmatchedResponsesReceived *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDNSCollector ...
|
// newDNSCollector ...
|
||||||
func NewDNSCollector() (Collector, error) {
|
func newDNSCollector() (Collector, error) {
|
||||||
const subsystem = "dns"
|
const subsystem = "dns"
|
||||||
return &DNSCollector{
|
return &DNSCollector{
|
||||||
ZoneTransferRequestsReceived: prometheus.NewDesc(
|
ZoneTransferRequestsReceived: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkDNSCollector(b *testing.B) {
|
func BenchmarkDNSCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "dns", NewDNSCollector)
|
benchmarkCollector(b, "dns", newDNSCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ type HyperVCollector struct {
|
|||||||
VMMemoryRemovedMemory *prometheus.Desc
|
VMMemoryRemovedMemory *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewHyperVCollector ...
|
// newHyperVCollector ...
|
||||||
func NewHyperVCollector() (Collector, error) {
|
func newHyperVCollector() (Collector, error) {
|
||||||
buildSubsystemName := func(component string) string { return "hyperv_" + component }
|
buildSubsystemName := func(component string) string { return "hyperv_" + component }
|
||||||
return &HyperVCollector{
|
return &HyperVCollector{
|
||||||
HealthCritical: prometheus.NewDesc(
|
HealthCritical: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkHypervCollector(b *testing.B) {
|
func BenchmarkHypervCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "hyperv", NewHyperVCollector)
|
benchmarkCollector(b, "hyperv", newHyperVCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ type IISCollector struct {
|
|||||||
iis_version simple_version
|
iis_version simple_version
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewIISCollector() (Collector, error) {
|
func newIISCollector() (Collector, error) {
|
||||||
const subsystem = "iis"
|
const subsystem = "iis"
|
||||||
|
|
||||||
return &IISCollector{
|
return &IISCollector{
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkIISCollector(b *testing.B) {
|
func BenchmarkIISCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "iis", NewIISCollector)
|
benchmarkCollector(b, "iis", newIISCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func getDFSRCollectorDeps() []string {
|
|||||||
var collectors = []collectorInit{
|
var collectors = []collectorInit{
|
||||||
{
|
{
|
||||||
name: "ad",
|
name: "ad",
|
||||||
builder: NewADCollector,
|
builder: newADCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "container",
|
name: "container",
|
||||||
builder: NewContainerMetricsCollector,
|
builder: newContainerMetricsCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,17 +68,17 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "cs",
|
name: "cs",
|
||||||
builder: NewCSCollector,
|
builder: newCSCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "dfsr",
|
name: "dfsr",
|
||||||
builder: NewDFSRCollector,
|
builder: newDFSRCollector,
|
||||||
perfCounterNames: getDFSRCollectorDeps(),
|
perfCounterNames: getDFSRCollectorDeps(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "dhcp",
|
name: "dhcp",
|
||||||
builder: NewDhcpCollector,
|
builder: newDhcpCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -88,7 +88,7 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "dns",
|
name: "dns",
|
||||||
builder: NewDNSCollector,
|
builder: newDNSCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -113,12 +113,12 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "hyperv",
|
name: "hyperv",
|
||||||
builder: NewHyperVCollector,
|
builder: newHyperVCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "iis",
|
name: "iis",
|
||||||
builder: NewIISCollector,
|
builder: newIISCollector,
|
||||||
perfCounterNames: []string{"Web Service",
|
perfCounterNames: []string{"Web Service",
|
||||||
"APP_POOL_WAS",
|
"APP_POOL_WAS",
|
||||||
"Web Service Cache",
|
"Web Service Cache",
|
||||||
@@ -127,17 +127,17 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "logical_disk",
|
name: "logical_disk",
|
||||||
builder: NewLogicalDiskCollector,
|
builder: newLogicalDiskCollector,
|
||||||
perfCounterNames: []string{"LogicalDisk"},
|
perfCounterNames: []string{"LogicalDisk"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "logon",
|
name: "logon",
|
||||||
builder: NewLogonCollector,
|
builder: newLogonCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "memory",
|
name: "memory",
|
||||||
builder: NewMemoryCollector,
|
builder: newMemoryCollector,
|
||||||
perfCounterNames: []string{"Memory"},
|
perfCounterNames: []string{"Memory"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -167,62 +167,62 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "msmq",
|
name: "msmq",
|
||||||
builder: NewMSMQCollector,
|
builder: newMSMQCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "mssql",
|
name: "mssql",
|
||||||
builder: NewMSSQLCollector,
|
builder: newMSSQLCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "net",
|
name: "net",
|
||||||
builder: NewNetworkCollector,
|
builder: newNetworkCollector,
|
||||||
perfCounterNames: []string{"Network Interface"},
|
perfCounterNames: []string{"Network Interface"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrexceptions",
|
name: "netframework_clrexceptions",
|
||||||
builder: NewNETFramework_NETCLRExceptionsCollector,
|
builder: newNETFramework_NETCLRExceptionsCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrinterop",
|
name: "netframework_clrinterop",
|
||||||
builder: NewNETFramework_NETCLRInteropCollector,
|
builder: newNETFramework_NETCLRInteropCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrjit",
|
name: "netframework_clrjit",
|
||||||
builder: NewNETFramework_NETCLRJitCollector,
|
builder: newNETFramework_NETCLRJitCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrloading",
|
name: "netframework_clrloading",
|
||||||
builder: NewNETFramework_NETCLRLoadingCollector,
|
builder: newNETFramework_NETCLRLoadingCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrlocksandthreads",
|
name: "netframework_clrlocksandthreads",
|
||||||
builder: NewNETFramework_NETCLRLocksAndThreadsCollector,
|
builder: newNETFramework_NETCLRLocksAndThreadsCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrmemory",
|
name: "netframework_clrmemory",
|
||||||
builder: NewNETFramework_NETCLRMemoryCollector,
|
builder: newNETFramework_NETCLRMemoryCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrremoting",
|
name: "netframework_clrremoting",
|
||||||
builder: NewNETFramework_NETCLRRemotingCollector,
|
builder: newNETFramework_NETCLRRemotingCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "netframework_clrsecurity",
|
name: "netframework_clrsecurity",
|
||||||
builder: NewNETFramework_NETCLRSecurityCollector,
|
builder: newNETFramework_NETCLRSecurityCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "os",
|
name: "os",
|
||||||
builder: NewOSCollector,
|
builder: newOSCollector,
|
||||||
perfCounterNames: []string{"Paging File"},
|
perfCounterNames: []string{"Paging File"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -232,27 +232,27 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "remote_fx",
|
name: "remote_fx",
|
||||||
builder: NewRemoteFx,
|
builder: newRemoteFx,
|
||||||
perfCounterNames: []string{"RemoteFX Network"},
|
perfCounterNames: []string{"RemoteFX Network"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "scheduled_task",
|
name: "scheduled_task",
|
||||||
builder: NewScheduledTask,
|
builder: newScheduledTask,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "service",
|
name: "service",
|
||||||
builder: NewserviceCollector,
|
builder: newserviceCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "smtp",
|
name: "smtp",
|
||||||
builder: NewSMTPCollector,
|
builder: newSMTPCollector,
|
||||||
perfCounterNames: []string{"SMTP Server"},
|
perfCounterNames: []string{"SMTP Server"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "system",
|
name: "system",
|
||||||
builder: NewSystemCollector,
|
builder: newSystemCollector,
|
||||||
perfCounterNames: []string{"System"},
|
perfCounterNames: []string{"System"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -262,12 +262,12 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "tcp",
|
name: "tcp",
|
||||||
builder: NewTCPCollector,
|
builder: newTCPCollector,
|
||||||
perfCounterNames: []string{"TCPv4"},
|
perfCounterNames: []string{"TCPv4"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "terminal_services",
|
name: "terminal_services",
|
||||||
builder: NewTerminalServicesCollector,
|
builder: newTerminalServicesCollector,
|
||||||
perfCounterNames: []string{
|
perfCounterNames: []string{
|
||||||
"Terminal Services",
|
"Terminal Services",
|
||||||
"Terminal Services Session",
|
"Terminal Services Session",
|
||||||
@@ -276,12 +276,12 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "textfile",
|
name: "textfile",
|
||||||
builder: NewTextFileCollector,
|
builder: newTextFileCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "thermalzone",
|
name: "thermalzone",
|
||||||
builder: NewThermalZoneCollector,
|
builder: newThermalZoneCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -291,7 +291,7 @@ var collectors = []collectorInit{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "vmware",
|
name: "vmware",
|
||||||
builder: NewVmwareCollector,
|
builder: newVmwareCollector,
|
||||||
perfCounterNames: nil,
|
perfCounterNames: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ type LogicalDiskCollector struct {
|
|||||||
volumeBlacklistPattern *regexp.Regexp
|
volumeBlacklistPattern *regexp.Regexp
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewLogicalDiskCollector ...
|
// newLogicalDiskCollector ...
|
||||||
func NewLogicalDiskCollector() (Collector, error) {
|
func newLogicalDiskCollector() (Collector, error) {
|
||||||
const subsystem = "logical_disk"
|
const subsystem = "logical_disk"
|
||||||
|
|
||||||
return &LogicalDiskCollector{
|
return &LogicalDiskCollector{
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ func BenchmarkLogicalDiskCollector(b *testing.B) {
|
|||||||
localVolumeWhitelist := ".+"
|
localVolumeWhitelist := ".+"
|
||||||
volumeWhitelist = &localVolumeWhitelist
|
volumeWhitelist = &localVolumeWhitelist
|
||||||
|
|
||||||
benchmarkCollector(b, "logical_disk", NewLogicalDiskCollector)
|
benchmarkCollector(b, "logical_disk", newLogicalDiskCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ type LogonCollector struct {
|
|||||||
LogonType *prometheus.Desc
|
LogonType *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewLogonCollector ...
|
// newLogonCollector ...
|
||||||
func NewLogonCollector() (Collector, error) {
|
func newLogonCollector() (Collector, error) {
|
||||||
const subsystem = "logon"
|
const subsystem = "logon"
|
||||||
|
|
||||||
return &LogonCollector{
|
return &LogonCollector{
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkLogonCollector(b *testing.B) {
|
func BenchmarkLogonCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewLogonCollector)
|
benchmarkCollector(b, "", newLogonCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ type MemoryCollector struct {
|
|||||||
WriteCopiesTotal *prometheus.Desc
|
WriteCopiesTotal *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewMemoryCollector ...
|
// newMemoryCollector ...
|
||||||
func NewMemoryCollector() (Collector, error) {
|
func newMemoryCollector() (Collector, error) {
|
||||||
const subsystem = "memory"
|
const subsystem = "memory"
|
||||||
|
|
||||||
return &MemoryCollector{
|
return &MemoryCollector{
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkMemoryCollector(b *testing.B) {
|
func BenchmarkMemoryCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "memory", NewMemoryCollector)
|
benchmarkCollector(b, "memory", newMemoryCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type Win32_PerfRawData_MSMQ_MSMQQueueCollector struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewWin32_PerfRawData_MSMQ_MSMQQueueCollector ...
|
// NewWin32_PerfRawData_MSMQ_MSMQQueueCollector ...
|
||||||
func NewMSMQCollector() (Collector, error) {
|
func newMSMQCollector() (Collector, error) {
|
||||||
const subsystem = "msmq"
|
const subsystem = "msmq"
|
||||||
|
|
||||||
if *msmqWhereClause == "" {
|
if *msmqWhereClause == "" {
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkMsmqCollector(b *testing.B) {
|
func BenchmarkMsmqCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewMSMQCollector)
|
benchmarkCollector(b, "", newMSMQCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,8 +401,8 @@ type MSSQLCollector struct {
|
|||||||
mssqlChildCollectorFailure int
|
mssqlChildCollectorFailure int
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewMSSQLCollector ...
|
// newMSSQLCollector ...
|
||||||
func NewMSSQLCollector() (Collector, error) {
|
func newMSSQLCollector() (Collector, error) {
|
||||||
|
|
||||||
const subsystem = "mssql"
|
const subsystem = "mssql"
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkMSSQLCollector(b *testing.B) {
|
func BenchmarkMSSQLCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "mssql", NewMSSQLCollector)
|
benchmarkCollector(b, "mssql", newMSSQLCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ type NetworkCollector struct {
|
|||||||
nicBlacklistPattern *regexp.Regexp
|
nicBlacklistPattern *regexp.Regexp
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNetworkCollector ...
|
// newNetworkCollector ...
|
||||||
func NewNetworkCollector() (Collector, error) {
|
func newNetworkCollector() (Collector, error) {
|
||||||
const subsystem = "net"
|
const subsystem = "net"
|
||||||
|
|
||||||
return &NetworkCollector{
|
return &NetworkCollector{
|
||||||
|
|||||||
@@ -23,5 +23,5 @@ func BenchmarkNetCollector(b *testing.B) {
|
|||||||
// Whitelist is not set in testing context (kingpin flags not parsed), causing the collector to skip all interfaces.
|
// Whitelist is not set in testing context (kingpin flags not parsed), causing the collector to skip all interfaces.
|
||||||
localNicWhitelist := ".+"
|
localNicWhitelist := ".+"
|
||||||
nicWhitelist = &localNicWhitelist
|
nicWhitelist = &localNicWhitelist
|
||||||
benchmarkCollector(b, "net", NewNetworkCollector)
|
benchmarkCollector(b, "net", newNetworkCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ type NETFramework_NETCLRExceptionsCollector struct {
|
|||||||
ThrowToCatchDepth *prometheus.Desc
|
ThrowToCatchDepth *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRExceptionsCollector ...
|
// newNETFramework_NETCLRExceptionsCollector ...
|
||||||
func NewNETFramework_NETCLRExceptionsCollector() (Collector, error) {
|
func newNETFramework_NETCLRExceptionsCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrexceptions"
|
const subsystem = "netframework_clrexceptions"
|
||||||
return &NETFramework_NETCLRExceptionsCollector{
|
return &NETFramework_NETCLRExceptionsCollector{
|
||||||
NumberofExcepsThrown: prometheus.NewDesc(
|
NumberofExcepsThrown: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNetFrameworkNETCLRExceptionsCollector(b *testing.B) {
|
func BenchmarkNetFrameworkNETCLRExceptionsCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRExceptionsCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRExceptionsCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ type NETFramework_NETCLRInteropCollector struct {
|
|||||||
NumberofStubs *prometheus.Desc
|
NumberofStubs *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRInteropCollector ...
|
// newNETFramework_NETCLRInteropCollector ...
|
||||||
func NewNETFramework_NETCLRInteropCollector() (Collector, error) {
|
func newNETFramework_NETCLRInteropCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrinterop"
|
const subsystem = "netframework_clrinterop"
|
||||||
return &NETFramework_NETCLRInteropCollector{
|
return &NETFramework_NETCLRInteropCollector{
|
||||||
NumberofCCWs: prometheus.NewDesc(
|
NumberofCCWs: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNETFrameworkNETCLRInteropCollector(b *testing.B) {
|
func BenchmarkNETFrameworkNETCLRInteropCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRInteropCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRInteropCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ type NETFramework_NETCLRJitCollector struct {
|
|||||||
TotalNumberofILBytesJitted *prometheus.Desc
|
TotalNumberofILBytesJitted *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRJitCollector ...
|
// newNETFramework_NETCLRJitCollector ...
|
||||||
func NewNETFramework_NETCLRJitCollector() (Collector, error) {
|
func newNETFramework_NETCLRJitCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrjit"
|
const subsystem = "netframework_clrjit"
|
||||||
return &NETFramework_NETCLRJitCollector{
|
return &NETFramework_NETCLRJitCollector{
|
||||||
NumberofMethodsJitted: prometheus.NewDesc(
|
NumberofMethodsJitted: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNETFrameworkNETCLRJitCollector(b *testing.B) {
|
func BenchmarkNETFrameworkNETCLRJitCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRJitCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRJitCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ type NETFramework_NETCLRLoadingCollector struct {
|
|||||||
TotalNumberofLoadFailures *prometheus.Desc
|
TotalNumberofLoadFailures *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRLoadingCollector ...
|
// newNETFramework_NETCLRLoadingCollector ...
|
||||||
func NewNETFramework_NETCLRLoadingCollector() (Collector, error) {
|
func newNETFramework_NETCLRLoadingCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrloading"
|
const subsystem = "netframework_clrloading"
|
||||||
return &NETFramework_NETCLRLoadingCollector{
|
return &NETFramework_NETCLRLoadingCollector{
|
||||||
BytesinLoaderHeap: prometheus.NewDesc(
|
BytesinLoaderHeap: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNETFrameworkNETCLRLoadingCollector(b *testing.B) {
|
func BenchmarkNETFrameworkNETCLRLoadingCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRLoadingCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRLoadingCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ type NETFramework_NETCLRLocksAndThreadsCollector struct {
|
|||||||
TotalNumberofContentions *prometheus.Desc
|
TotalNumberofContentions *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRLocksAndThreadsCollector ...
|
// newNETFramework_NETCLRLocksAndThreadsCollector ...
|
||||||
func NewNETFramework_NETCLRLocksAndThreadsCollector() (Collector, error) {
|
func newNETFramework_NETCLRLocksAndThreadsCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrlocksandthreads"
|
const subsystem = "netframework_clrlocksandthreads"
|
||||||
return &NETFramework_NETCLRLocksAndThreadsCollector{
|
return &NETFramework_NETCLRLocksAndThreadsCollector{
|
||||||
CurrentQueueLength: prometheus.NewDesc(
|
CurrentQueueLength: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNETFrameworkNETCLRLocksAndThreadsCollector(b *testing.B) {
|
func BenchmarkNETFrameworkNETCLRLocksAndThreadsCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRLocksAndThreadsCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRLocksAndThreadsCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ type NETFramework_NETCLRMemoryCollector struct {
|
|||||||
PromotedMemoryfromGen1 *prometheus.Desc
|
PromotedMemoryfromGen1 *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRMemoryCollector ...
|
// newNETFramework_NETCLRMemoryCollector ...
|
||||||
func NewNETFramework_NETCLRMemoryCollector() (Collector, error) {
|
func newNETFramework_NETCLRMemoryCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrmemory"
|
const subsystem = "netframework_clrmemory"
|
||||||
return &NETFramework_NETCLRMemoryCollector{
|
return &NETFramework_NETCLRMemoryCollector{
|
||||||
AllocatedBytes: prometheus.NewDesc(
|
AllocatedBytes: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNETFrameworkNETCLRMemoryCollector(b *testing.B) {
|
func BenchmarkNETFrameworkNETCLRMemoryCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRMemoryCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRMemoryCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ type NETFramework_NETCLRRemotingCollector struct {
|
|||||||
TotalRemoteCalls *prometheus.Desc
|
TotalRemoteCalls *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRRemotingCollector ...
|
// newNETFramework_NETCLRRemotingCollector ...
|
||||||
func NewNETFramework_NETCLRRemotingCollector() (Collector, error) {
|
func newNETFramework_NETCLRRemotingCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrremoting"
|
const subsystem = "netframework_clrremoting"
|
||||||
return &NETFramework_NETCLRRemotingCollector{
|
return &NETFramework_NETCLRRemotingCollector{
|
||||||
Channels: prometheus.NewDesc(
|
Channels: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNETFrameworkNETCLRRemotingCollector(b *testing.B) {
|
func BenchmarkNETFrameworkNETCLRRemotingCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRRemotingCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRRemotingCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ type NETFramework_NETCLRSecurityCollector struct {
|
|||||||
TotalRuntimeChecks *prometheus.Desc
|
TotalRuntimeChecks *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNETFramework_NETCLRSecurityCollector ...
|
// newNETFramework_NETCLRSecurityCollector ...
|
||||||
func NewNETFramework_NETCLRSecurityCollector() (Collector, error) {
|
func newNETFramework_NETCLRSecurityCollector() (Collector, error) {
|
||||||
const subsystem = "netframework_clrsecurity"
|
const subsystem = "netframework_clrsecurity"
|
||||||
return &NETFramework_NETCLRSecurityCollector{
|
return &NETFramework_NETCLRSecurityCollector{
|
||||||
NumberLinkTimeChecks: prometheus.NewDesc(
|
NumberLinkTimeChecks: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func BenchmarkNETFrameworkNETCLRSecurityCollector(b *testing.B) {
|
func BenchmarkNETFrameworkNETCLRSecurityCollector(b *testing.B) {
|
||||||
// No context name required as collector source is WMI
|
// No context name required as collector source is WMI
|
||||||
benchmarkCollector(b, "", NewNETFramework_NETCLRSecurityCollector)
|
benchmarkCollector(b, "", newNETFramework_NETCLRSecurityCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ type pagingFileCounter struct {
|
|||||||
UsagePeak float64 `perflib:"% Usage Peak"`
|
UsagePeak float64 `perflib:"% Usage Peak"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewOSCollector ...
|
// newOSCollector ...
|
||||||
func NewOSCollector() (Collector, error) {
|
func newOSCollector() (Collector, error) {
|
||||||
const subsystem = "os"
|
const subsystem = "os"
|
||||||
|
|
||||||
return &OSCollector{
|
return &OSCollector{
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkOSCollector(b *testing.B) {
|
func BenchmarkOSCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "os", NewOSCollector)
|
benchmarkCollector(b, "os", newOSCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ type RemoteFxCollector struct {
|
|||||||
SourceFramesPerSecond *prometheus.Desc
|
SourceFramesPerSecond *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRemoteFx ...
|
// newRemoteFx ...
|
||||||
func NewRemoteFx() (Collector, error) {
|
func newRemoteFx() (Collector, error) {
|
||||||
const subsystem = "remote_fx"
|
const subsystem = "remote_fx"
|
||||||
return &RemoteFxCollector{
|
return &RemoteFxCollector{
|
||||||
// net
|
// net
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkRemoteFXCollector(b *testing.B) {
|
func BenchmarkRemoteFXCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "remote_fx", NewRemoteFx)
|
benchmarkCollector(b, "remote_fx", newRemoteFx)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ type ScheduledTask struct {
|
|||||||
|
|
||||||
type ScheduledTasks []ScheduledTask
|
type ScheduledTasks []ScheduledTask
|
||||||
|
|
||||||
// NewScheduledTask ...
|
// newScheduledTask ...
|
||||||
func NewScheduledTask() (Collector, error) {
|
func newScheduledTask() (Collector, error) {
|
||||||
const subsystem = "scheduled_task"
|
const subsystem = "scheduled_task"
|
||||||
|
|
||||||
runtime.LockOSThread()
|
runtime.LockOSThread()
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkScheduledTaskCollector(b *testing.B) {
|
func BenchmarkScheduledTaskCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "scheduled_task", NewScheduledTask)
|
benchmarkCollector(b, "scheduled_task", newScheduledTask)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ type serviceCollector struct {
|
|||||||
queryWhereClause string
|
queryWhereClause string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewserviceCollector ...
|
// newserviceCollector ...
|
||||||
func NewserviceCollector() (Collector, error) {
|
func newserviceCollector() (Collector, error) {
|
||||||
const subsystem = "service"
|
const subsystem = "service"
|
||||||
|
|
||||||
if *serviceWhereClause == "" {
|
if *serviceWhereClause == "" {
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkServiceCollector(b *testing.B) {
|
func BenchmarkServiceCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "service", NewserviceCollector)
|
benchmarkCollector(b, "service", newserviceCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ type SMTPCollector struct {
|
|||||||
serverBlacklistPattern *regexp.Regexp
|
serverBlacklistPattern *regexp.Regexp
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSMTPCollector() (Collector, error) {
|
func newSMTPCollector() (Collector, error) {
|
||||||
log.Info("smtp collector is in an experimental state! Metrics for this collector have not been tested.")
|
log.Info("smtp collector is in an experimental state! Metrics for this collector have not been tested.")
|
||||||
const subsystem = "smtp"
|
const subsystem = "smtp"
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkSmtpCollector(b *testing.B) {
|
func BenchmarkSmtpCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "smtp", NewSMTPCollector)
|
benchmarkCollector(b, "smtp", newSMTPCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ type SystemCollector struct {
|
|||||||
Threads *prometheus.Desc
|
Threads *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSystemCollector ...
|
// newSystemCollector ...
|
||||||
func NewSystemCollector() (Collector, error) {
|
func newSystemCollector() (Collector, error) {
|
||||||
const subsystem = "system"
|
const subsystem = "system"
|
||||||
|
|
||||||
return &SystemCollector{
|
return &SystemCollector{
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkSystemCollector(b *testing.B) {
|
func BenchmarkSystemCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "system", NewSystemCollector)
|
benchmarkCollector(b, "system", newSystemCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ type TCPCollector struct {
|
|||||||
SegmentsSentTotal *prometheus.Desc
|
SegmentsSentTotal *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTCPCollector ...
|
// newTCPCollector ...
|
||||||
func NewTCPCollector() (Collector, error) {
|
func newTCPCollector() (Collector, error) {
|
||||||
const subsystem = "tcp"
|
const subsystem = "tcp"
|
||||||
|
|
||||||
return &TCPCollector{
|
return &TCPCollector{
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkTCPCollector(b *testing.B) {
|
func BenchmarkTCPCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "tcp", NewTCPCollector)
|
benchmarkCollector(b, "tcp", newTCPCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ type TerminalServicesCollector struct {
|
|||||||
WorkingSetPeak *prometheus.Desc
|
WorkingSetPeak *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTerminalServicesCollector ...
|
// newTerminalServicesCollector ...
|
||||||
func NewTerminalServicesCollector() (Collector, error) {
|
func newTerminalServicesCollector() (Collector, error) {
|
||||||
const subsystem = "terminal_services"
|
const subsystem = "terminal_services"
|
||||||
return &TerminalServicesCollector{
|
return &TerminalServicesCollector{
|
||||||
LocalSessionCount: prometheus.NewDesc(
|
LocalSessionCount: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkTerminalServicesCollector(b *testing.B) {
|
func BenchmarkTerminalServicesCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "terminal_services", NewTerminalServicesCollector)
|
benchmarkCollector(b, "terminal_services", newTerminalServicesCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ type textFileCollector struct {
|
|||||||
mtime *float64
|
mtime *float64
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTextFileCollector returns a new Collector exposing metrics read from files
|
// newTextFileCollector returns a new Collector exposing metrics read from files
|
||||||
// in the given textfile directory.
|
// in the given textfile directory.
|
||||||
func NewTextFileCollector() (Collector, error) {
|
func newTextFileCollector() (Collector, error) {
|
||||||
return &textFileCollector{
|
return &textFileCollector{
|
||||||
path: *textFileDirectory,
|
path: *textFileDirectory,
|
||||||
}, nil
|
}, nil
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ type thermalZoneCollector struct {
|
|||||||
ThrottleReasons *prometheus.Desc
|
ThrottleReasons *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewThermalZoneCollector ...
|
// newThermalZoneCollector ...
|
||||||
func NewThermalZoneCollector() (Collector, error) {
|
func newThermalZoneCollector() (Collector, error) {
|
||||||
const subsystem = "thermalzone"
|
const subsystem = "thermalzone"
|
||||||
return &thermalZoneCollector{
|
return &thermalZoneCollector{
|
||||||
Temperature: prometheus.NewDesc(
|
Temperature: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkThermalZoneCollector(b *testing.B) {
|
func BenchmarkThermalZoneCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "thermalzone", NewThermalZoneCollector)
|
benchmarkCollector(b, "thermalzone", newThermalZoneCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ type VmwareCollector struct {
|
|||||||
HostProcessorSpeedMHz *prometheus.Desc
|
HostProcessorSpeedMHz *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewVmwareCollector constructs a new VmwareCollector
|
// newVmwareCollector constructs a new VmwareCollector
|
||||||
func NewVmwareCollector() (Collector, error) {
|
func newVmwareCollector() (Collector, error) {
|
||||||
const subsystem = "vmware"
|
const subsystem = "vmware"
|
||||||
return &VmwareCollector{
|
return &VmwareCollector{
|
||||||
MemActive: prometheus.NewDesc(
|
MemActive: prometheus.NewDesc(
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkVmwareCollector(b *testing.B) {
|
func BenchmarkVmwareCollector(b *testing.B) {
|
||||||
benchmarkCollector(b, "vmware", NewVmwareCollector)
|
benchmarkCollector(b, "vmware", newVmwareCollector)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user