mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-01-30 03:13:21 +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:
parent
9214a87d0d
commit
04257a1b25
@ -76,8 +76,8 @@ type ADCollector struct {
|
||||
TombstonedObjectsVisitedTotal *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewADCollector ...
|
||||
func NewADCollector() (Collector, error) {
|
||||
// newADCollector ...
|
||||
func newADCollector() (Collector, error) {
|
||||
const subsystem = "ad"
|
||||
return &ADCollector{
|
||||
AddressBookOperationsTotal: prometheus.NewDesc(
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkADCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "ad", NewADCollector)
|
||||
benchmarkCollector(b, "ad", newADCollector)
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ type ContainerMetricsCollector struct {
|
||||
WriteSizeBytes *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewContainerMetricsCollector constructs a new ContainerMetricsCollector
|
||||
func NewContainerMetricsCollector() (Collector, error) {
|
||||
// newContainerMetricsCollector constructs a new ContainerMetricsCollector
|
||||
func newContainerMetricsCollector() (Collector, error) {
|
||||
const subsystem = "container"
|
||||
return &ContainerMetricsCollector{
|
||||
ContainerAvailable: prometheus.NewDesc(
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkContainerCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "container", NewContainerMetricsCollector)
|
||||
benchmarkCollector(b, "container", newContainerMetricsCollector)
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ type CSCollector struct {
|
||||
Hostname *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewCSCollector ...
|
||||
func NewCSCollector() (Collector, error) {
|
||||
// newCSCollector ...
|
||||
func newCSCollector() (Collector, error) {
|
||||
const subsystem = "cs"
|
||||
|
||||
return &CSCollector{
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
// NewDFSRCollector is registered
|
||||
func NewDFSRCollector() (Collector, error) {
|
||||
// newDFSRCollector is registered
|
||||
func newDFSRCollector() (Collector, error) {
|
||||
log.Info("dfsr collector is in an experimental state! Metrics for this collector have not been tested.")
|
||||
const subsystem = "dfsr"
|
||||
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkDFSRCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "dfsr", NewDFSRCollector)
|
||||
benchmarkCollector(b, "dfsr", newDFSRCollector)
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ type DhcpCollector struct {
|
||||
FailoverBndupdDropped *prometheus.Desc
|
||||
}
|
||||
|
||||
func NewDhcpCollector() (Collector, error) {
|
||||
func newDhcpCollector() (Collector, error) {
|
||||
const subsystem = "dhcp"
|
||||
|
||||
return &DhcpCollector{
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkDHCPCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "dhcp", NewDhcpCollector)
|
||||
benchmarkCollector(b, "dhcp", newDhcpCollector)
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ type DNSCollector struct {
|
||||
UnmatchedResponsesReceived *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewDNSCollector ...
|
||||
func NewDNSCollector() (Collector, error) {
|
||||
// newDNSCollector ...
|
||||
func newDNSCollector() (Collector, error) {
|
||||
const subsystem = "dns"
|
||||
return &DNSCollector{
|
||||
ZoneTransferRequestsReceived: prometheus.NewDesc(
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkDNSCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "dns", NewDNSCollector)
|
||||
benchmarkCollector(b, "dns", newDNSCollector)
|
||||
}
|
||||
|
@ -126,8 +126,8 @@ type HyperVCollector struct {
|
||||
VMMemoryRemovedMemory *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewHyperVCollector ...
|
||||
func NewHyperVCollector() (Collector, error) {
|
||||
// newHyperVCollector ...
|
||||
func newHyperVCollector() (Collector, error) {
|
||||
buildSubsystemName := func(component string) string { return "hyperv_" + component }
|
||||
return &HyperVCollector{
|
||||
HealthCritical: prometheus.NewDesc(
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkHypervCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "hyperv", NewHyperVCollector)
|
||||
benchmarkCollector(b, "hyperv", newHyperVCollector)
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ type IISCollector struct {
|
||||
iis_version simple_version
|
||||
}
|
||||
|
||||
func NewIISCollector() (Collector, error) {
|
||||
func newIISCollector() (Collector, error) {
|
||||
const subsystem = "iis"
|
||||
|
||||
return &IISCollector{
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkIISCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "iis", NewIISCollector)
|
||||
benchmarkCollector(b, "iis", newIISCollector)
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ func getDFSRCollectorDeps() []string {
|
||||
var collectors = []collectorInit{
|
||||
{
|
||||
name: "ad",
|
||||
builder: NewADCollector,
|
||||
builder: newADCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
@ -53,7 +53,7 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "container",
|
||||
builder: NewContainerMetricsCollector,
|
||||
builder: newContainerMetricsCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
@ -68,17 +68,17 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "cs",
|
||||
builder: NewCSCollector,
|
||||
builder: newCSCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "dfsr",
|
||||
builder: NewDFSRCollector,
|
||||
builder: newDFSRCollector,
|
||||
perfCounterNames: getDFSRCollectorDeps(),
|
||||
},
|
||||
{
|
||||
name: "dhcp",
|
||||
builder: NewDhcpCollector,
|
||||
builder: newDhcpCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
@ -88,7 +88,7 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "dns",
|
||||
builder: NewDNSCollector,
|
||||
builder: newDNSCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
@ -113,12 +113,12 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "hyperv",
|
||||
builder: NewHyperVCollector,
|
||||
builder: newHyperVCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "iis",
|
||||
builder: NewIISCollector,
|
||||
builder: newIISCollector,
|
||||
perfCounterNames: []string{"Web Service",
|
||||
"APP_POOL_WAS",
|
||||
"Web Service Cache",
|
||||
@ -127,17 +127,17 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "logical_disk",
|
||||
builder: NewLogicalDiskCollector,
|
||||
builder: newLogicalDiskCollector,
|
||||
perfCounterNames: []string{"LogicalDisk"},
|
||||
},
|
||||
{
|
||||
name: "logon",
|
||||
builder: NewLogonCollector,
|
||||
builder: newLogonCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "memory",
|
||||
builder: NewMemoryCollector,
|
||||
builder: newMemoryCollector,
|
||||
perfCounterNames: []string{"Memory"},
|
||||
},
|
||||
{
|
||||
@ -167,62 +167,62 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "msmq",
|
||||
builder: NewMSMQCollector,
|
||||
builder: newMSMQCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "mssql",
|
||||
builder: NewMSSQLCollector,
|
||||
builder: newMSSQLCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "net",
|
||||
builder: NewNetworkCollector,
|
||||
builder: newNetworkCollector,
|
||||
perfCounterNames: []string{"Network Interface"},
|
||||
},
|
||||
{
|
||||
name: "netframework_clrexceptions",
|
||||
builder: NewNETFramework_NETCLRExceptionsCollector,
|
||||
builder: newNETFramework_NETCLRExceptionsCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "netframework_clrinterop",
|
||||
builder: NewNETFramework_NETCLRInteropCollector,
|
||||
builder: newNETFramework_NETCLRInteropCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "netframework_clrjit",
|
||||
builder: NewNETFramework_NETCLRJitCollector,
|
||||
builder: newNETFramework_NETCLRJitCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "netframework_clrloading",
|
||||
builder: NewNETFramework_NETCLRLoadingCollector,
|
||||
builder: newNETFramework_NETCLRLoadingCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "netframework_clrlocksandthreads",
|
||||
builder: NewNETFramework_NETCLRLocksAndThreadsCollector,
|
||||
builder: newNETFramework_NETCLRLocksAndThreadsCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "netframework_clrmemory",
|
||||
builder: NewNETFramework_NETCLRMemoryCollector,
|
||||
builder: newNETFramework_NETCLRMemoryCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "netframework_clrremoting",
|
||||
builder: NewNETFramework_NETCLRRemotingCollector,
|
||||
builder: newNETFramework_NETCLRRemotingCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "netframework_clrsecurity",
|
||||
builder: NewNETFramework_NETCLRSecurityCollector,
|
||||
builder: newNETFramework_NETCLRSecurityCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "os",
|
||||
builder: NewOSCollector,
|
||||
builder: newOSCollector,
|
||||
perfCounterNames: []string{"Paging File"},
|
||||
},
|
||||
{
|
||||
@ -232,27 +232,27 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "remote_fx",
|
||||
builder: NewRemoteFx,
|
||||
builder: newRemoteFx,
|
||||
perfCounterNames: []string{"RemoteFX Network"},
|
||||
},
|
||||
{
|
||||
name: "scheduled_task",
|
||||
builder: NewScheduledTask,
|
||||
builder: newScheduledTask,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "service",
|
||||
builder: NewserviceCollector,
|
||||
builder: newserviceCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "smtp",
|
||||
builder: NewSMTPCollector,
|
||||
builder: newSMTPCollector,
|
||||
perfCounterNames: []string{"SMTP Server"},
|
||||
},
|
||||
{
|
||||
name: "system",
|
||||
builder: NewSystemCollector,
|
||||
builder: newSystemCollector,
|
||||
perfCounterNames: []string{"System"},
|
||||
},
|
||||
{
|
||||
@ -262,12 +262,12 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "tcp",
|
||||
builder: NewTCPCollector,
|
||||
builder: newTCPCollector,
|
||||
perfCounterNames: []string{"TCPv4"},
|
||||
},
|
||||
{
|
||||
name: "terminal_services",
|
||||
builder: NewTerminalServicesCollector,
|
||||
builder: newTerminalServicesCollector,
|
||||
perfCounterNames: []string{
|
||||
"Terminal Services",
|
||||
"Terminal Services Session",
|
||||
@ -276,12 +276,12 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "textfile",
|
||||
builder: NewTextFileCollector,
|
||||
builder: newTextFileCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
name: "thermalzone",
|
||||
builder: NewThermalZoneCollector,
|
||||
builder: newThermalZoneCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
@ -291,7 +291,7 @@ var collectors = []collectorInit{
|
||||
},
|
||||
{
|
||||
name: "vmware",
|
||||
builder: NewVmwareCollector,
|
||||
builder: newVmwareCollector,
|
||||
perfCounterNames: nil,
|
||||
},
|
||||
{
|
||||
|
@ -46,8 +46,8 @@ type LogicalDiskCollector struct {
|
||||
volumeBlacklistPattern *regexp.Regexp
|
||||
}
|
||||
|
||||
// NewLogicalDiskCollector ...
|
||||
func NewLogicalDiskCollector() (Collector, error) {
|
||||
// newLogicalDiskCollector ...
|
||||
func newLogicalDiskCollector() (Collector, error) {
|
||||
const subsystem = "logical_disk"
|
||||
|
||||
return &LogicalDiskCollector{
|
||||
|
@ -9,5 +9,5 @@ func BenchmarkLogicalDiskCollector(b *testing.B) {
|
||||
localVolumeWhitelist := ".+"
|
||||
volumeWhitelist = &localVolumeWhitelist
|
||||
|
||||
benchmarkCollector(b, "logical_disk", NewLogicalDiskCollector)
|
||||
benchmarkCollector(b, "logical_disk", newLogicalDiskCollector)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ type LogonCollector struct {
|
||||
LogonType *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewLogonCollector ...
|
||||
func NewLogonCollector() (Collector, error) {
|
||||
// newLogonCollector ...
|
||||
func newLogonCollector() (Collector, error) {
|
||||
const subsystem = "logon"
|
||||
|
||||
return &LogonCollector{
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkLogonCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewMemoryCollector ...
|
||||
func NewMemoryCollector() (Collector, error) {
|
||||
// newMemoryCollector ...
|
||||
func newMemoryCollector() (Collector, error) {
|
||||
const subsystem = "memory"
|
||||
|
||||
return &MemoryCollector{
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
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 ...
|
||||
func NewMSMQCollector() (Collector, error) {
|
||||
func newMSMQCollector() (Collector, error) {
|
||||
const subsystem = "msmq"
|
||||
|
||||
if *msmqWhereClause == "" {
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkMsmqCollector(b *testing.B) {
|
||||
// No context name required as collector source is WMI
|
||||
benchmarkCollector(b, "", NewMSMQCollector)
|
||||
benchmarkCollector(b, "", newMSMQCollector)
|
||||
}
|
||||
|
@ -401,8 +401,8 @@ type MSSQLCollector struct {
|
||||
mssqlChildCollectorFailure int
|
||||
}
|
||||
|
||||
// NewMSSQLCollector ...
|
||||
func NewMSSQLCollector() (Collector, error) {
|
||||
// newMSSQLCollector ...
|
||||
func newMSSQLCollector() (Collector, error) {
|
||||
|
||||
const subsystem = "mssql"
|
||||
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkMSSQLCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "mssql", NewMSSQLCollector)
|
||||
benchmarkCollector(b, "mssql", newMSSQLCollector)
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ type NetworkCollector struct {
|
||||
nicBlacklistPattern *regexp.Regexp
|
||||
}
|
||||
|
||||
// NewNetworkCollector ...
|
||||
func NewNetworkCollector() (Collector, error) {
|
||||
// newNetworkCollector ...
|
||||
func newNetworkCollector() (Collector, error) {
|
||||
const subsystem = "net"
|
||||
|
||||
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.
|
||||
localNicWhitelist := ".+"
|
||||
nicWhitelist = &localNicWhitelist
|
||||
benchmarkCollector(b, "net", NewNetworkCollector)
|
||||
benchmarkCollector(b, "net", newNetworkCollector)
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ type NETFramework_NETCLRExceptionsCollector struct {
|
||||
ThrowToCatchDepth *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRExceptionsCollector ...
|
||||
func NewNETFramework_NETCLRExceptionsCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRExceptionsCollector ...
|
||||
func newNETFramework_NETCLRExceptionsCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrexceptions"
|
||||
return &NETFramework_NETCLRExceptionsCollector{
|
||||
NumberofExcepsThrown: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNetFrameworkNETCLRExceptionsCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRInteropCollector ...
|
||||
func NewNETFramework_NETCLRInteropCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRInteropCollector ...
|
||||
func newNETFramework_NETCLRInteropCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrinterop"
|
||||
return &NETFramework_NETCLRInteropCollector{
|
||||
NumberofCCWs: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNETFrameworkNETCLRInteropCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRJitCollector ...
|
||||
func NewNETFramework_NETCLRJitCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRJitCollector ...
|
||||
func newNETFramework_NETCLRJitCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrjit"
|
||||
return &NETFramework_NETCLRJitCollector{
|
||||
NumberofMethodsJitted: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNETFrameworkNETCLRJitCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRLoadingCollector ...
|
||||
func NewNETFramework_NETCLRLoadingCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRLoadingCollector ...
|
||||
func newNETFramework_NETCLRLoadingCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrloading"
|
||||
return &NETFramework_NETCLRLoadingCollector{
|
||||
BytesinLoaderHeap: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNETFrameworkNETCLRLoadingCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRLocksAndThreadsCollector ...
|
||||
func NewNETFramework_NETCLRLocksAndThreadsCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRLocksAndThreadsCollector ...
|
||||
func newNETFramework_NETCLRLocksAndThreadsCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrlocksandthreads"
|
||||
return &NETFramework_NETCLRLocksAndThreadsCollector{
|
||||
CurrentQueueLength: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNETFrameworkNETCLRLocksAndThreadsCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRMemoryCollector ...
|
||||
func NewNETFramework_NETCLRMemoryCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRMemoryCollector ...
|
||||
func newNETFramework_NETCLRMemoryCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrmemory"
|
||||
return &NETFramework_NETCLRMemoryCollector{
|
||||
AllocatedBytes: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNETFrameworkNETCLRMemoryCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRRemotingCollector ...
|
||||
func NewNETFramework_NETCLRRemotingCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRRemotingCollector ...
|
||||
func newNETFramework_NETCLRRemotingCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrremoting"
|
||||
return &NETFramework_NETCLRRemotingCollector{
|
||||
Channels: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNETFrameworkNETCLRRemotingCollector(b *testing.B) {
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewNETFramework_NETCLRSecurityCollector ...
|
||||
func NewNETFramework_NETCLRSecurityCollector() (Collector, error) {
|
||||
// newNETFramework_NETCLRSecurityCollector ...
|
||||
func newNETFramework_NETCLRSecurityCollector() (Collector, error) {
|
||||
const subsystem = "netframework_clrsecurity"
|
||||
return &NETFramework_NETCLRSecurityCollector{
|
||||
NumberLinkTimeChecks: prometheus.NewDesc(
|
||||
|
@ -6,5 +6,5 @@ import (
|
||||
|
||||
func BenchmarkNETFrameworkNETCLRSecurityCollector(b *testing.B) {
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// NewOSCollector ...
|
||||
func NewOSCollector() (Collector, error) {
|
||||
// newOSCollector ...
|
||||
func newOSCollector() (Collector, error) {
|
||||
const subsystem = "os"
|
||||
|
||||
return &OSCollector{
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkOSCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "os", NewOSCollector)
|
||||
benchmarkCollector(b, "os", newOSCollector)
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ type RemoteFxCollector struct {
|
||||
SourceFramesPerSecond *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewRemoteFx ...
|
||||
func NewRemoteFx() (Collector, error) {
|
||||
// newRemoteFx ...
|
||||
func newRemoteFx() (Collector, error) {
|
||||
const subsystem = "remote_fx"
|
||||
return &RemoteFxCollector{
|
||||
// net
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
// NewScheduledTask ...
|
||||
func NewScheduledTask() (Collector, error) {
|
||||
// newScheduledTask ...
|
||||
func newScheduledTask() (Collector, error) {
|
||||
const subsystem = "scheduled_task"
|
||||
|
||||
runtime.LockOSThread()
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkScheduledTaskCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "scheduled_task", NewScheduledTask)
|
||||
benchmarkCollector(b, "scheduled_task", newScheduledTask)
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ type serviceCollector struct {
|
||||
queryWhereClause string
|
||||
}
|
||||
|
||||
// NewserviceCollector ...
|
||||
func NewserviceCollector() (Collector, error) {
|
||||
// newserviceCollector ...
|
||||
func newserviceCollector() (Collector, error) {
|
||||
const subsystem = "service"
|
||||
|
||||
if *serviceWhereClause == "" {
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkServiceCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "service", NewserviceCollector)
|
||||
benchmarkCollector(b, "service", newserviceCollector)
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ type SMTPCollector struct {
|
||||
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.")
|
||||
const subsystem = "smtp"
|
||||
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkSmtpCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "smtp", NewSMTPCollector)
|
||||
benchmarkCollector(b, "smtp", newSMTPCollector)
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ type SystemCollector struct {
|
||||
Threads *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewSystemCollector ...
|
||||
func NewSystemCollector() (Collector, error) {
|
||||
// newSystemCollector ...
|
||||
func newSystemCollector() (Collector, error) {
|
||||
const subsystem = "system"
|
||||
|
||||
return &SystemCollector{
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkSystemCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "system", NewSystemCollector)
|
||||
benchmarkCollector(b, "system", newSystemCollector)
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ type TCPCollector struct {
|
||||
SegmentsSentTotal *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewTCPCollector ...
|
||||
func NewTCPCollector() (Collector, error) {
|
||||
// newTCPCollector ...
|
||||
func newTCPCollector() (Collector, error) {
|
||||
const subsystem = "tcp"
|
||||
|
||||
return &TCPCollector{
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkTCPCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "tcp", NewTCPCollector)
|
||||
benchmarkCollector(b, "tcp", newTCPCollector)
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ type TerminalServicesCollector struct {
|
||||
WorkingSetPeak *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewTerminalServicesCollector ...
|
||||
func NewTerminalServicesCollector() (Collector, error) {
|
||||
// newTerminalServicesCollector ...
|
||||
func newTerminalServicesCollector() (Collector, error) {
|
||||
const subsystem = "terminal_services"
|
||||
return &TerminalServicesCollector{
|
||||
LocalSessionCount: prometheus.NewDesc(
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkTerminalServicesCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "terminal_services", NewTerminalServicesCollector)
|
||||
benchmarkCollector(b, "terminal_services", newTerminalServicesCollector)
|
||||
}
|
||||
|
@ -55,9 +55,9 @@ type textFileCollector struct {
|
||||
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.
|
||||
func NewTextFileCollector() (Collector, error) {
|
||||
func newTextFileCollector() (Collector, error) {
|
||||
return &textFileCollector{
|
||||
path: *textFileDirectory,
|
||||
}, nil
|
||||
|
@ -15,8 +15,8 @@ type thermalZoneCollector struct {
|
||||
ThrottleReasons *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewThermalZoneCollector ...
|
||||
func NewThermalZoneCollector() (Collector, error) {
|
||||
// newThermalZoneCollector ...
|
||||
func newThermalZoneCollector() (Collector, error) {
|
||||
const subsystem = "thermalzone"
|
||||
return &thermalZoneCollector{
|
||||
Temperature: prometheus.NewDesc(
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkThermalZoneCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "thermalzone", NewThermalZoneCollector)
|
||||
benchmarkCollector(b, "thermalzone", newThermalZoneCollector)
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ type VmwareCollector struct {
|
||||
HostProcessorSpeedMHz *prometheus.Desc
|
||||
}
|
||||
|
||||
// NewVmwareCollector constructs a new VmwareCollector
|
||||
func NewVmwareCollector() (Collector, error) {
|
||||
// newVmwareCollector constructs a new VmwareCollector
|
||||
func newVmwareCollector() (Collector, error) {
|
||||
const subsystem = "vmware"
|
||||
return &VmwareCollector{
|
||||
MemActive: prometheus.NewDesc(
|
||||
|
@ -5,5 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkVmwareCollector(b *testing.B) {
|
||||
benchmarkCollector(b, "vmware", NewVmwareCollector)
|
||||
benchmarkCollector(b, "vmware", newVmwareCollector)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user