chore: Fix linter findings for `revive:enforce-repeated-arg-type-style` in `plugins/inputs/[h-n]*` (#15850)
This commit is contained in:
parent
28299c1102
commit
ffee74c188
|
|
@ -111,7 +111,7 @@ func getHTTPSClient() *http.Client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createURL(listener *HTTPListenerV2, scheme string, path string, rawquery string) string {
|
func createURL(listener *HTTPListenerV2, scheme, path, rawquery string) string {
|
||||||
var port int
|
var port int
|
||||||
if strings.HasPrefix(listener.ServiceAddress, "tcp://") {
|
if strings.HasPrefix(listener.ServiceAddress, "tcp://") {
|
||||||
port = listener.listener.Addr().(*net.TCPAddr).Port
|
port = listener.listener.Addr().(*net.TCPAddr).Port
|
||||||
|
|
|
||||||
|
|
@ -149,14 +149,7 @@ func setUpTestMux() http.Handler {
|
||||||
return mux
|
return mux
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkOutput(
|
func checkOutput(t *testing.T, acc *testutil.Accumulator, presentFields, presentTags map[string]interface{}, absentFields, absentTags []string) {
|
||||||
t *testing.T,
|
|
||||||
acc *testutil.Accumulator,
|
|
||||||
presentFields map[string]interface{},
|
|
||||||
presentTags map[string]interface{},
|
|
||||||
absentFields []string,
|
|
||||||
absentTags []string,
|
|
||||||
) {
|
|
||||||
t.Helper()
|
t.Helper()
|
||||||
if presentFields != nil {
|
if presentFields != nil {
|
||||||
checkFields(t, presentFields, acc)
|
checkFields(t, presentFields, acc)
|
||||||
|
|
|
||||||
|
|
@ -152,12 +152,7 @@ func (h *Hugepages) gatherStatsPerNode(acc telegraf.Accumulator) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Hugepages) gatherFromHugepagePath(
|
func (h *Hugepages) gatherFromHugepagePath(acc telegraf.Accumulator, measurement, path string, fileFilter, defaultTags map[string]string) error {
|
||||||
acc telegraf.Accumulator,
|
|
||||||
measurement, path string,
|
|
||||||
fileFilter map[string]string,
|
|
||||||
defaultTags map[string]string,
|
|
||||||
) error {
|
|
||||||
// read metrics from: hugepages/hugepages-*/*
|
// read metrics from: hugepages/hugepages-*/*
|
||||||
hugepagesDirs, err := os.ReadDir(path)
|
hugepagesDirs, err := os.ReadDir(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ func (i *Infiniband) Gather(acc telegraf.Accumulator) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the statistics to the accumulator
|
// Add the statistics to the accumulator
|
||||||
func addStats(dev string, port string, stats []rdmamap.RdmaStatEntry, acc telegraf.Accumulator) {
|
func addStats(dev, port string, stats []rdmamap.RdmaStatEntry, acc telegraf.Accumulator) {
|
||||||
// Allow users to filter by card and port
|
// Allow users to filter by card and port
|
||||||
tags := map[string]string{"device": dev, "port": port}
|
tags := map[string]string{"device": dev, "port": port}
|
||||||
fields := make(map[string]interface{})
|
fields := make(map[string]interface{})
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ func getSecureClient() *http.Client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createURL(listener *InfluxDBListener, scheme string, path string, rawquery string) string {
|
func createURL(listener *InfluxDBListener, scheme, path, rawquery string) string {
|
||||||
u := url.URL{
|
u := url.URL{
|
||||||
Scheme: scheme,
|
Scheme: scheme,
|
||||||
Host: "localhost:" + strconv.Itoa(listener.port),
|
Host: "localhost:" + strconv.Itoa(listener.port),
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ func getSecureClient() *http.Client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createURL(listener *InfluxDBV2Listener, scheme string, path string, rawquery string) string {
|
func createURL(listener *InfluxDBV2Listener, scheme, path, rawquery string) string {
|
||||||
u := url.URL{
|
u := url.URL{
|
||||||
Scheme: scheme,
|
Scheme: scheme,
|
||||||
Host: "localhost:" + strconv.Itoa(listener.port),
|
Host: "localhost:" + strconv.Itoa(listener.port),
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ func getTelemSample(s sample, buf []byte, offset uint64) (uint64, error) {
|
||||||
// Returns:
|
// Returns:
|
||||||
//
|
//
|
||||||
// error - error if getting values has failed, if sample IDref is missing or if equation evaluation has failed.
|
// error - error if getting values has failed, if sample IDref is missing or if equation evaluation has failed.
|
||||||
func (p *IntelPMT) aggregateSamples(acc telegraf.Accumulator, guid string, data []byte, numaNode string, pciBdf string) error {
|
func (p *IntelPMT) aggregateSamples(acc telegraf.Accumulator, guid string, data []byte, numaNode, pciBdf string) error {
|
||||||
results, err := p.getSampleValues(guid, data)
|
results, err := p.getSampleValues(guid, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func createTempFile(t *testing.T, dir string, pattern string, data []byte) (*os.File, os.FileInfo) {
|
func createTempFile(t *testing.T, dir, pattern string, data []byte) (*os.File, os.FileInfo) {
|
||||||
tempFile, err := os.CreateTemp(dir, pattern)
|
tempFile, err := os.CreateTemp(dir, pattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("error creating a temporary file %v: %v", tempFile.Name(), err)
|
t.Fatalf("error creating a temporary file %v: %v", tempFile.Name(), err)
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ func (p *IntelPMT) readXMLs() error {
|
||||||
// Returns:
|
// Returns:
|
||||||
//
|
//
|
||||||
// error - if reading XML has failed.
|
// error - if reading XML has failed.
|
||||||
func (p *IntelPMT) getAllXMLData(guid string, dtMetricsFound map[string]bool, smFound map[string]bool) error {
|
func (p *IntelPMT) getAllXMLData(guid string, dtMetricsFound, smFound map[string]bool) error {
|
||||||
for _, mapping := range p.pmtMetadata.Mappings.Mapping {
|
for _, mapping := range p.pmtMetadata.Mappings.Mapping {
|
||||||
if mapping.GUID == guid {
|
if mapping.GUID == guid {
|
||||||
basedir := mapping.XMLSet.Basedir
|
basedir := mapping.XMLSet.Basedir
|
||||||
|
|
@ -246,7 +246,7 @@ func (a *aggregator) calculateMasks() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func computeMask(msb uint64, lsb uint64) uint64 {
|
func computeMask(msb, lsb uint64) uint64 {
|
||||||
msbMask := uint64(0xffffffffffffffff) & ((1 << (msb + 1)) - 1)
|
msbMask := uint64(0xffffffffffffffff) & ((1 << (msb + 1)) - 1)
|
||||||
lsbMask := uint64(0xffffffffffffffff) & (1<<lsb - 1)
|
lsbMask := uint64(0xffffffffffffffff) & (1<<lsb - 1)
|
||||||
return msbMask & (^lsbMask)
|
return msbMask & (^lsbMask)
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ func parseIDs(allIDsStrings []string) ([]int, error) {
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeDuplicateValues(intSlice []int) (result []int, duplicates []int) {
|
func removeDuplicateValues(intSlice []int) (result, duplicates []int) {
|
||||||
keys := make(map[int]bool)
|
keys := make(map[int]bool)
|
||||||
|
|
||||||
for _, entry := range intSlice {
|
for _, entry := range intSlice {
|
||||||
|
|
@ -224,7 +224,7 @@ func removeDuplicateValues(intSlice []int) (result []int, duplicates []int) {
|
||||||
return result, duplicates
|
return result, duplicates
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeDuplicateStrings(strSlice []string) (result []string, duplicates []string) {
|
func removeDuplicateStrings(strSlice []string) (result, duplicates []string) {
|
||||||
keys := make(map[string]bool)
|
keys := make(map[string]bool)
|
||||||
|
|
||||||
for _, entry := range strSlice {
|
for _, entry := range strSlice {
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ func estimateUncoreFd(entities []*UncoreEventEntity) (uint64, error) {
|
||||||
return number, nil
|
return number, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func multiplyAndAdd(factorA uint64, factorB uint64, sum uint64) (uint64, error) {
|
func multiplyAndAdd(factorA, factorB, sum uint64) (uint64, error) {
|
||||||
bigA := new(big.Int).SetUint64(factorA)
|
bigA := new(big.Int).SetUint64(factorA)
|
||||||
bigB := new(big.Int).SetUint64(factorB)
|
bigB := new(big.Int).SetUint64(factorB)
|
||||||
activeEvents := new(big.Int).Mul(bigA, bigB)
|
activeEvents := new(big.Int).Mul(bigA, bigB)
|
||||||
|
|
|
||||||
|
|
@ -399,7 +399,7 @@ func TestEstimateCoresFd(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeEvents(number int, pmusNumber int) []*eventWithQuals {
|
func makeEvents(number, pmusNumber int) []*eventWithQuals {
|
||||||
a := make([]*eventWithQuals, number)
|
a := make([]*eventWithQuals, number)
|
||||||
for i := range a {
|
for i := range a {
|
||||||
b := make([]ia.NamedPMUType, pmusNumber)
|
b := make([]ia.NamedPMUType, pmusNumber)
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ func (e *iaEntitiesResolver) resolveEntities(coreEntities []*CoreEventEntity, un
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *iaEntitiesResolver) resolveAllEvents() (coreEvents []*eventWithQuals, uncoreEvents []*eventWithQuals, err error) {
|
func (e *iaEntitiesResolver) resolveAllEvents() (coreEvents, uncoreEvents []*eventWithQuals, err error) {
|
||||||
if e.transformer == nil {
|
if e.transformer == nil {
|
||||||
return nil, nil, errors.New("transformer is nil")
|
return nil, nil, errors.New("transformer is nil")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -537,7 +537,7 @@ func (p *PowerStat) addPerCPUPerfMetrics(acc telegraf.Accumulator, cpuID, coreID
|
||||||
}
|
}
|
||||||
|
|
||||||
// getDataCPUID takes a topologyFetcher and CPU ID, and returns the core ID and package ID corresponding to the CPU ID.
|
// getDataCPUID takes a topologyFetcher and CPU ID, and returns the core ID and package ID corresponding to the CPU ID.
|
||||||
func getDataCPUID(t topologyFetcher, cpuID int) (coreID int, packageID int, err error) {
|
func getDataCPUID(t topologyFetcher, cpuID int) (coreID, packageID int, err error) {
|
||||||
coreID, err = t.GetCPUCoreID(cpuID)
|
coreID, err = t.GetCPUCoreID(cpuID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, fmt.Errorf("failed to get core ID from CPU ID %v: %w", cpuID, err)
|
return 0, 0, fmt.Errorf("failed to get core ID from CPU ID %v: %w", cpuID, err)
|
||||||
|
|
@ -977,7 +977,7 @@ func (p *PowerStat) addUncoreFrequencyCurrentValues(acc telegraf.Accumulator, pa
|
||||||
}
|
}
|
||||||
|
|
||||||
// getUncoreFreqInitialLimits returns the initial uncore frequency limits of a given package ID and die ID.
|
// getUncoreFreqInitialLimits returns the initial uncore frequency limits of a given package ID and die ID.
|
||||||
func getUncoreFreqInitialLimits(fetcher metricFetcher, packageID, dieID int) (initialMin float64, initialMax float64, err error) {
|
func getUncoreFreqInitialLimits(fetcher metricFetcher, packageID, dieID int) (initialMin, initialMax float64, err error) {
|
||||||
initialMin, err = fetcher.GetInitialUncoreFrequencyMin(packageID, dieID)
|
initialMin, err = fetcher.GetInitialUncoreFrequencyMin(packageID, dieID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0.0, 0.0, fmt.Errorf("failed to get initial minimum uncore frequency limit: %w", err)
|
return 0.0, 0.0, fmt.Errorf("failed to get initial minimum uncore frequency limit: %w", err)
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,7 @@ func arrayToString(array []int) string {
|
||||||
return strings.TrimSuffix(result, ",")
|
return strings.TrimSuffix(result, ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkForDuplicates(values []int, valuesToCheck []int) bool {
|
func checkForDuplicates(values, valuesToCheck []int) bool {
|
||||||
for _, value := range values {
|
for _, value := range values {
|
||||||
for _, valueToCheck := range valuesToCheck {
|
for _, valueToCheck := range valuesToCheck {
|
||||||
if value == valueToCheck {
|
if value == valueToCheck {
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ func (m *Ipmi) Gather(acc telegraf.Accumulator) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Ipmi) parse(acc telegraf.Accumulator, server string, sensor string) error {
|
func (m *Ipmi) parse(acc telegraf.Accumulator, server, sensor string) error {
|
||||||
var command []string
|
var command []string
|
||||||
switch sensor {
|
switch sensor {
|
||||||
case "sdr":
|
case "sdr":
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ func (e APIError) Error() string {
|
||||||
return fmt.Sprintf("[%s] %s", e.URL, e.Title)
|
return fmt.Sprintf("[%s] %s", e.URL, e.Title)
|
||||||
}
|
}
|
||||||
|
|
||||||
func createGetRequest(url string, username, password string, sessionCookie *http.Cookie) (*http.Request, error) {
|
func createGetRequest(url, username, password string, sessionCookie *http.Cookie) (*http.Request, error) {
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ type message struct {
|
||||||
value interface{}
|
value interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func produceKnxEvent(t *testing.T, address string, datapoint string, value interface{}) *knx.GroupEvent {
|
func produceKnxEvent(t *testing.T, address, datapoint string, value interface{}) *knx.GroupEvent {
|
||||||
addr, err := cemi.NewGroupAddrString(address)
|
addr, err := cemi.NewGroupAddrString(address)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ type client struct {
|
||||||
*kubernetes.Clientset
|
*kubernetes.Clientset
|
||||||
}
|
}
|
||||||
|
|
||||||
func newClient(baseURL, namespace, bearerTokenFile string, bearerToken string, timeout time.Duration, tlsConfig tls.ClientConfig) (*client, error) {
|
func newClient(baseURL, namespace, bearerTokenFile, bearerToken string, timeout time.Duration, tlsConfig tls.ClientConfig) (*client, error) {
|
||||||
var clientConfig *rest.Config
|
var clientConfig *rest.Config
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ func main() {
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
func testMain(t *testing.T, code string, endpoint string, serverType ServerType) {
|
func testMain(t *testing.T, code, endpoint string, serverType ServerType) {
|
||||||
executable := "snmpwalk"
|
executable := "snmpwalk"
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
executable = "snmpwalk.exe"
|
executable = "snmpwalk.exe"
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ func (m *Mcrouter) Gather(acc telegraf.Accumulator) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseAddress parses an address string into 'host:port' and 'protocol' parts
|
// ParseAddress parses an address string into 'host:port' and 'protocol' parts
|
||||||
func (m *Mcrouter) ParseAddress(address string) (parsedAddress string, protocol string, err error) {
|
func (m *Mcrouter) ParseAddress(address string) (parsedAddress, protocol string, err error) {
|
||||||
var host string
|
var host string
|
||||||
var port string
|
var port string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ func (s *Server) authLog(err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) runCommand(database string, cmd interface{}, result interface{}) error {
|
func (s *Server) runCommand(database string, cmd, result interface{}) error {
|
||||||
r := s.client.Database(database).RunCommand(context.Background(), cmd)
|
r := s.client.Database(database).RunCommand(context.Background(), cmd)
|
||||||
if r.Err() != nil {
|
if r.Err() != nil {
|
||||||
return r.Err()
|
return r.Err()
|
||||||
|
|
@ -270,14 +270,7 @@ func (s *Server) gatherCollectionStats(colStatsDbs []string) (*colStats, error)
|
||||||
return results, nil
|
return results, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) gatherData(
|
func (s *Server) gatherData(acc telegraf.Accumulator, gatherClusterStatus, gatherDbStats, gatherColStats, gatherTopStat bool, colStatsDbs []string) error {
|
||||||
acc telegraf.Accumulator,
|
|
||||||
gatherClusterStatus bool,
|
|
||||||
gatherDbStats bool,
|
|
||||||
gatherColStats bool,
|
|
||||||
gatherTopStat bool,
|
|
||||||
colStatsDbs []string,
|
|
||||||
) error {
|
|
||||||
serverStatus, err := s.gatherServerStatus()
|
serverStatus, err := s.gatherServerStatus()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -925,7 +925,7 @@ func computeLockDiffs(prevLocks, curLocks map[string]lockUsage) []lockUsage {
|
||||||
return lockUsages
|
return lockUsages
|
||||||
}
|
}
|
||||||
|
|
||||||
func diff(newVal, oldVal, sampleTime int64) (avg int64, newValue int64) {
|
func diff(newVal, oldVal, sampleTime int64) (avg, newValue int64) {
|
||||||
d := newVal - oldVal
|
d := newVal - oldVal
|
||||||
if d < 0 {
|
if d < 0 {
|
||||||
d = newVal
|
d = newVal
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ func (p *TopicParser) Parse(metric telegraf.Metric, topic string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *TopicParser) convertToFieldType(value string, key string) (interface{}, error) {
|
func (p *TopicParser) convertToFieldType(value, key string) (interface{}, error) {
|
||||||
// If the user configured inputs.mqtt_consumer.topic.types, check for the desired type
|
// If the user configured inputs.mqtt_consumer.topic.types, check for the desired type
|
||||||
desiredType, ok := p.fieldTypes[key]
|
desiredType, ok := p.fieldTypes[key]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
||||||
|
|
@ -1815,7 +1815,7 @@ func (m *Mysql) gatherTableSchema(db *sql.DB, servtag string, acc telegraf.Accum
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Mysql) gatherSchemaForDB(db *sql.DB, database string, servtag string, acc telegraf.Accumulator) error {
|
func (m *Mysql) gatherSchemaForDB(db *sql.DB, database, servtag string, acc telegraf.Accumulator) error {
|
||||||
rows, err := db.Query(fmt.Sprintf(tableSchemaQuery, database))
|
rows, err := db.Query(fmt.Sprintf(tableSchemaQuery, database))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ func convertToUint64(line []string) ([]uint64, error) {
|
||||||
return nline, nil
|
return nline, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *NFSClient) parseStat(mountpoint string, export string, version string, line []string, acc telegraf.Accumulator) error {
|
func (n *NFSClient) parseStat(mountpoint, export, version string, line []string, acc telegraf.Accumulator) error {
|
||||||
tags := map[string]string{"mountpoint": mountpoint, "serverexport": export}
|
tags := map[string]string{"mountpoint": mountpoint, "serverexport": export}
|
||||||
nline, err := convertToUint64(line)
|
nline, err := convertToUint64(line)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -1552,7 +1552,7 @@ func prepareAddr(t *testing.T, ts *httptest.Server) (*url.URL, string, string) {
|
||||||
return addr, host, port
|
return addr, host, port
|
||||||
}
|
}
|
||||||
|
|
||||||
func prepareEndpoint(t *testing.T, path string, payload string) (*httptest.Server, *NginxPlusAPI) {
|
func prepareEndpoint(t *testing.T, path, payload string) (*httptest.Server, *NginxPlusAPI) {
|
||||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
require.Equal(t, r.URL.Path, fmt.Sprintf("/api/%d/%s", defaultAPIVersion, path), "unknown request path")
|
require.Equal(t, r.URL.Path, fmt.Sprintf("/api/%d/%s", defaultAPIVersion, path), "unknown request path")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ var defaultBinary = "/usr/sbin/nsd-control"
|
||||||
var defaultTimeout = config.Duration(time.Second)
|
var defaultTimeout = config.Duration(time.Second)
|
||||||
|
|
||||||
// Shell out to nsd_stat and return the output
|
// Shell out to nsd_stat and return the output
|
||||||
func nsdRunner(cmdName string, timeout config.Duration, useSudo bool, server string, configFile string) (*bytes.Buffer, error) {
|
func nsdRunner(cmdName string, timeout config.Duration, useSudo bool, server, configFile string) (*bytes.Buffer, error) {
|
||||||
cmdArgs := []string{"stats_noreset"}
|
cmdArgs := []string{"stats_noreset"}
|
||||||
|
|
||||||
if server != "" {
|
if server != "" {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue