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:
Ben Reedy 2022-12-21 15:44:29 +10:00
parent 9214a87d0d
commit 04257a1b25
No known key found for this signature in database
GPG Key ID: 235C15B6086C9D7E
66 changed files with 127 additions and 127 deletions

View File

@ -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(

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkADCollector(b *testing.B) {
benchmarkCollector(b, "ad", NewADCollector)
benchmarkCollector(b, "ad", newADCollector)
}

View File

@ -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(

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkContainerCollector(b *testing.B) {
benchmarkCollector(b, "container", NewContainerMetricsCollector)
benchmarkCollector(b, "container", newContainerMetricsCollector)
}

View File

@ -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{

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkCsCollector(b *testing.B) {
benchmarkCollector(b, "cs", NewCSCollector)
benchmarkCollector(b, "cs", newCSCollector)
}

View File

@ -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"

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkDFSRCollector(b *testing.B) {
benchmarkCollector(b, "dfsr", NewDFSRCollector)
benchmarkCollector(b, "dfsr", newDFSRCollector)
}

View File

@ -36,7 +36,7 @@ type DhcpCollector struct {
FailoverBndupdDropped *prometheus.Desc
}
func NewDhcpCollector() (Collector, error) {
func newDhcpCollector() (Collector, error) {
const subsystem = "dhcp"
return &DhcpCollector{

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkDHCPCollector(b *testing.B) {
benchmarkCollector(b, "dhcp", NewDhcpCollector)
benchmarkCollector(b, "dhcp", newDhcpCollector)
}

View File

@ -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(

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkDNSCollector(b *testing.B) {
benchmarkCollector(b, "dns", NewDNSCollector)
benchmarkCollector(b, "dns", newDNSCollector)
}

View File

@ -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(

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkHypervCollector(b *testing.B) {
benchmarkCollector(b, "hyperv", NewHyperVCollector)
benchmarkCollector(b, "hyperv", newHyperVCollector)
}

View File

@ -191,7 +191,7 @@ type IISCollector struct {
iis_version simple_version
}
func NewIISCollector() (Collector, error) {
func newIISCollector() (Collector, error) {
const subsystem = "iis"
return &IISCollector{

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkIISCollector(b *testing.B) {
benchmarkCollector(b, "iis", NewIISCollector)
benchmarkCollector(b, "iis", newIISCollector)
}

View File

@ -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,
},
{

View File

@ -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{

View File

@ -9,5 +9,5 @@ func BenchmarkLogicalDiskCollector(b *testing.B) {
localVolumeWhitelist := ".+"
volumeWhitelist = &localVolumeWhitelist
benchmarkCollector(b, "logical_disk", NewLogicalDiskCollector)
benchmarkCollector(b, "logical_disk", newLogicalDiskCollector)
}

View File

@ -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{

View File

@ -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)
}

View File

@ -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{

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkMemoryCollector(b *testing.B) {
benchmarkCollector(b, "memory", NewMemoryCollector)
benchmarkCollector(b, "memory", newMemoryCollector)
}

View File

@ -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 == "" {

View File

@ -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)
}

View File

@ -401,8 +401,8 @@ type MSSQLCollector struct {
mssqlChildCollectorFailure int
}
// NewMSSQLCollector ...
func NewMSSQLCollector() (Collector, error) {
// newMSSQLCollector ...
func newMSSQLCollector() (Collector, error) {
const subsystem = "mssql"

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkMSSQLCollector(b *testing.B) {
benchmarkCollector(b, "mssql", NewMSSQLCollector)
benchmarkCollector(b, "mssql", newMSSQLCollector)
}

View File

@ -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{

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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(

View File

@ -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)
}

View File

@ -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{

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkOSCollector(b *testing.B) {
benchmarkCollector(b, "os", NewOSCollector)
benchmarkCollector(b, "os", newOSCollector)
}

View File

@ -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

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkRemoteFXCollector(b *testing.B) {
benchmarkCollector(b, "remote_fx", NewRemoteFx)
benchmarkCollector(b, "remote_fx", newRemoteFx)
}

View File

@ -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()

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkScheduledTaskCollector(b *testing.B) {
benchmarkCollector(b, "scheduled_task", NewScheduledTask)
benchmarkCollector(b, "scheduled_task", newScheduledTask)
}

View File

@ -37,8 +37,8 @@ type serviceCollector struct {
queryWhereClause string
}
// NewserviceCollector ...
func NewserviceCollector() (Collector, error) {
// newserviceCollector ...
func newserviceCollector() (Collector, error) {
const subsystem = "service"
if *serviceWhereClause == "" {

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkServiceCollector(b *testing.B) {
benchmarkCollector(b, "service", NewserviceCollector)
benchmarkCollector(b, "service", newserviceCollector)
}

View File

@ -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"

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkSmtpCollector(b *testing.B) {
benchmarkCollector(b, "smtp", NewSMTPCollector)
benchmarkCollector(b, "smtp", newSMTPCollector)
}

View File

@ -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{

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkSystemCollector(b *testing.B) {
benchmarkCollector(b, "system", NewSystemCollector)
benchmarkCollector(b, "system", newSystemCollector)
}

View File

@ -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{

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkTCPCollector(b *testing.B) {
benchmarkCollector(b, "tcp", NewTCPCollector)
benchmarkCollector(b, "tcp", newTCPCollector)
}

View File

@ -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(

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkTerminalServicesCollector(b *testing.B) {
benchmarkCollector(b, "terminal_services", NewTerminalServicesCollector)
benchmarkCollector(b, "terminal_services", newTerminalServicesCollector)
}

View File

@ -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

View File

@ -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(

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkThermalZoneCollector(b *testing.B) {
benchmarkCollector(b, "thermalzone", NewThermalZoneCollector)
benchmarkCollector(b, "thermalzone", newThermalZoneCollector)
}

View File

@ -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(

View File

@ -5,5 +5,5 @@ import (
)
func BenchmarkVmwareCollector(b *testing.B) {
benchmarkCollector(b, "vmware", NewVmwareCollector)
benchmarkCollector(b, "vmware", newVmwareCollector)
}