network

package
v1.67.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	STATE_DOWN    = "down"
	STATE_UP      = "up"
	FLAG_STATE_UP = "up"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkSample

type NetworkSample struct {
	sample.BaseEvent

	InterfaceName   string `json:"interfaceName"`
	HardwareAddress string `json:"hardwareAddress"`
	IpV4Address     string `json:"ipV4Address,omitempty"`
	IpV6Address     string `json:"ipV6Address,omitempty"`
	State           string `json:"state,omitempty"`

	ReceiveBytesPerSec   *float64 `json:"receiveBytesPerSecond,omitempty"`
	ReceivePacketsPerSec *float64 `json:"receivePacketsPerSecond,omitempty"`
	ReceiveErrorsPerSec  *float64 `json:"receiveErrorsPerSecond,omitempty"`
	ReceiveDroppedPerSec *float64 `json:"receiveDroppedPerSecond,omitempty"`

	TransmitBytesPerSec   *float64 `json:"transmitBytesPerSecond,omitempty"`
	TransmitPacketsPerSec *float64 `json:"transmitPacketsPerSecond,omitempty"`
	TransmitErrorsPerSec  *float64 `json:"transmitErrorsPerSecond,omitempty"`
	TransmitDroppedPerSec *float64 `json:"transmitDroppedPerSecond,omitempty"`
}

We use pointers to floats instead of plain floats so that if we don't set one of the values, it will not be sent to Dirac. (Not using pointers would mean that Go would always send a default value of 0.)

type NetworkSampler

type NetworkSampler struct {
	// contains filtered or unexported fields
}

func NewNetworkSampler

func NewNetworkSampler(context agent.AgentContext) *NetworkSampler

func (*NetworkSampler) Disabled

func (ns *NetworkSampler) Disabled() bool

func (*NetworkSampler) Interval

func (ns *NetworkSampler) Interval() time.Duration

func (*NetworkSampler) Name

func (ns *NetworkSampler) Name() string

func (*NetworkSampler) OnStartup

func (ns *NetworkSampler) OnStartup()

func (*NetworkSampler) Sample

func (ss *NetworkSampler) Sample() (results sample.EventBatch, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL