Documentation ¶
Index ¶
- Constants
- Variables
- func GetDevStatusUpdate(nodePTPDev *ptpv1.NodePtpDevice) (*ptpv1.NodePtpDevice, error)
- func HelloWorld()
- func RegisterMetrics(nodeName string)
- func RunDeviceStatusUpdate(ptpClient *ptpclient.Clientset, nodeName string, hwconfigs *[]ptpv1.HwConfig)
- func StartMetricsServer(bindAddress string)
- func UpdateInterfaceRoleMetrics(process string, iface string, role ptpPortRole)
- func UpdateProcessStatusMetrics(process, cfgName string, status int64)
- type Daemon
- type LinuxPTPConfUpdate
- type PluginManager
- type ProcessManager
Constants ¶
View Source
const ( PtpNamespace = "ptp" PTP4L_CONF_FILE_PATH = "/etc/ptp4l.conf" PTP4L_CONF_DIR = "/ptp4l-conf" ClockClassChangeIndicator = "selected best master clock" )
View Source
const ( PTPNamespace = "openshift" PTPSubsystem = "ptp" )
View Source
const ( //LOCKED ... LOCKED string = "LOCKED" //FREERUN ... FREERUN = "FREERUN" )
View Source
const ( PtpProcessDown int64 = 0 PtpProcessUp int64 = 1 )
View Source
const ( PASSIVE ptpPortRole = iota SLAVE MASTER FAULTY UNKNOWN )
Variables ¶
View Source
var ( NodeName = "" Offset = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "offset_ns", Help: "", }, []string{"from", "process", "node", "iface"}) MaxOffset = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "max_offset_ns", Help: "", }, []string{"from", "process", "node", "iface"}) FrequencyAdjustment = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "frequency_adjustment_ns", Help: "", }, []string{"from", "process", "node", "iface"}) Delay = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "delay_ns", Help: "", }, []string{"from", "process", "node", "iface"}) // ClockState metrics to show current clock state ClockState = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "clock_state", Help: "0 = FREERUN, 1 = LOCKED, 2 = HOLDOVER", }, []string{"process", "node", "iface"}) // Threshold metrics to show current ptp threshold InterfaceRole = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "interface_role", Help: "0 = PASSIVE, 1 = SLAVE, 2 = MASTER, 3 = FAULTY, 4 = UNKNOWN", }, []string{"process", "node", "iface"}) ProcessStatus = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "process_status", Help: "0 = DOWN, 1 = UP", }, []string{"process", "node", "config"}) ProcessRestartCount = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: PTPNamespace, Subsystem: PTPSubsystem, Name: "process_restart_count", Help: "", }, []string{"process", "node", "config"}) )
Functions ¶
func GetDevStatusUpdate ¶
func GetDevStatusUpdate(nodePTPDev *ptpv1.NodePtpDevice) (*ptpv1.NodePtpDevice, error)
func HelloWorld ¶
func HelloWorld()
func RegisterMetrics ¶
func RegisterMetrics(nodeName string)
func RunDeviceStatusUpdate ¶
func StartMetricsServer ¶
func StartMetricsServer(bindAddress string)
StartMetricsServer runs the prometheus listner so that metrics can be collected
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the main structure for linuxptp instance. It contains all the necessary data to run linuxptp instance.
type LinuxPTPConfUpdate ¶
type LinuxPTPConfUpdate struct { UpdateCh chan bool NodeProfiles []ptpv1.PtpProfile // contains filtered or unexported fields }
LinuxPTPUpdate controls whether to update linuxPTP conf and contains linuxPTP conf to be updated. It's rendered and passed to linuxptp instance by daemon.
func NewLinuxPTPConfUpdate ¶
func NewLinuxPTPConfUpdate() (*LinuxPTPConfUpdate, error)
func (*LinuxPTPConfUpdate) UpdateConfig ¶
func (l *LinuxPTPConfUpdate) UpdateConfig(nodeProfilesJson []byte) error
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
func (*PluginManager) OnPTPConfigChange ¶
func (pm *PluginManager) OnPTPConfigChange(nodeProfile *ptpv1.PtpProfile)
func (*PluginManager) PopulateHwConfig ¶
func (pm *PluginManager) PopulateHwConfig(hwconfigs *[]ptpv1.HwConfig)
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
ProcessManager manages a set of ptpProcess which could be ptp4l, phc2sys or timemaster. Processes in ProcessManager will be started or stopped simultaneously.
Click to show internal directories.
Click to hide internal directories.