stats

package
v0.0.0-...-319b14c Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package stats ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PTPStats

type PTPStats map[types.IFace]*Stats

PTPStats ...

func (PTPStats) CheckSource

func (ps PTPStats) CheckSource(k types.IFace, configName, processName string)

CheckSource ... check key

func (PTPStats) HasMetricHelp

func (ps PTPStats) HasMetricHelp(process string) map[string]string

HasMetricHelp ...

func (PTPStats) HasMetrics

func (ps PTPStats) HasMetrics(process string) map[string]*event.PMetric

HasMetrics ...

func (PTPStats) New

func (ps PTPStats) New() PTPStats

New ...

func (PTPStats) Reset

func (ps PTPStats) Reset()

Reset ...all values to empty

func (PTPStats) SetConfigAsDeleted

func (ps PTPStats) SetConfigAsDeleted(state bool)

SetConfigAsDeleted ...

type PortState

type PortState struct {
	Name               string        // iface name or port name
	State              ptp.SyncState // over all state will be device state for now
	ClockQuality       string
	QL                 byte
	ExtQL              byte
	ExtendedTvlEnabled bool
	LastQLState        int
}

PortState ... interface states as EEX_LOCKED / LOCKED

type Stats

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

Stats calculates stats nolint:unused

func NewStats

func NewStats(configName string) *Stats

NewStats ... create new stats

func (*Stats) AddValue

func (s *Stats) AddValue(val int64)

AddValue ...add value

func (*Stats) Alias

func (s *Stats) Alias() string

Alias return alias name

func (*Stats) ClockClass

func (s *Stats) ClockClass() int64

ClockClass return last known ClockClass

func (*Stats) ConfigName

func (s *Stats) ConfigName() string

ConfigName ...get config name

func (*Stats) Delay

func (s *Stats) Delay() int64

Delay ... get delay value

func (*Stats) DeleteAllMetrics

func (s *Stats) DeleteAllMetrics(m []*prometheus.GaugeVec)

DeleteAllMetrics ... delete all metrics

write a functions to delete meteric from dependson object

func (*Stats) FrequencyAdjustment

func (s *Stats) FrequencyAdjustment() int64

FrequencyAdjustment ... get frequency adjustment value

func (*Stats) GetCurrentDependentEventState

func (s *Stats) GetCurrentDependentEventState() ptp.SyncState

GetCurrentDependentEventState ... get current dependent event state

func (*Stats) GetDependsOnValueState

func (s *Stats) GetDependsOnValueState(processName string, iface *string, key string) (int64, float64, ptp.SyncState, error)

GetDependsOnValueState ... get value offset and state

func (*Stats) GetInterfaceByIndex

func (s *Stats) GetInterfaceByIndex(processName string, index int) *string

GetInterfaceByIndex ... get iface

func (*Stats) GetStateState

func (s *Stats) GetStateState(processName string, iface *string) (ptp.SyncState, error)

GetStateState ... get state

func (*Stats) GetSyncE

func (s *Stats) GetSyncE() (se *SyncEStats)

GetSyncE ... get synce Stats

func (*Stats) HasProcessEnabled

func (s *Stats) HasProcessEnabled(processName string) bool

HasProcessEnabled ... check if process is enabled

func (*Stats) LastOffset

func (s *Stats) LastOffset() int64

LastOffset ... last offset value

func (*Stats) LastSyncState

func (s *Stats) LastSyncState() ptp.SyncState

LastSyncState ... last sync state

func (*Stats) MaxAbs

func (s *Stats) MaxAbs() int64

MaxAbs ... get Max abs value

func (*Stats) Offset

func (s *Stats) Offset() int64

Offset return last known offset

func (*Stats) OffsetSource

func (s *Stats) OffsetSource() string

OffsetSource ... get offset source

func (*Stats) ProcessName

func (s *Stats) ProcessName() string

ProcessName ... name of the process either ptp4l or phc2sys

func (*Stats) PtpDependentEventState

func (s *Stats) PtpDependentEventState() *event.PTPEventState

PtpDependentEventState ... get ptp dependent event state

func (*Stats) Role

func (s *Stats) Role() types.PtpPortRole

Role ... get role name

func (*Stats) SetAlias

func (s *Stats) SetAlias(val string)

SetAlias ... set alias name for slave port

func (*Stats) SetClockClass

func (s *Stats) SetClockClass(val int64)

SetClockClass ... set last clock class value

func (*Stats) SetDelay

func (s *Stats) SetDelay(val int64)

SetDelay ... set delay value

func (*Stats) SetFrequencyAdjustment

func (s *Stats) SetFrequencyAdjustment(val int64)

SetFrequencyAdjustment ... set frequency adjustment

func (*Stats) SetLastOffset

func (s *Stats) SetLastOffset(val int64)

SetLastOffset ... set last offset value

func (*Stats) SetLastSyncState

func (s *Stats) SetLastSyncState(val ptp.SyncState)

SetLastSyncState ... set last sync state

func (*Stats) SetOffsetSource

func (s *Stats) SetOffsetSource(os string)

SetOffsetSource ... set offset source ptp4/phc2sys/master

func (*Stats) SetProcessName

func (s *Stats) SetProcessName(processName string)

SetProcessName ... set process name

func (*Stats) SetPtpDependentEventState

func (s *Stats) SetPtpDependentEventState(e event.ClockState, metrics map[string]*event.PMetric, help map[string]string)

SetPtpDependentEventState ... set ptp dependent event state

func (*Stats) SetRole

func (s *Stats) SetRole(role types.PtpPortRole)

SetRole ... set role name

func (*Stats) SetSyncE

func (s *Stats) SetSyncE(se *SyncEStats)

SetSyncE ... set synce Stats

func (*Stats) StDev

func (s *Stats) StDev() float64

StDev ... set dev

func (*Stats) String

func (s *Stats) String() string

func (*Stats) SyncState

func (s *Stats) SyncState() ptp.SyncState

SyncState return last known SyncState state

type SyncEStats

type SyncEStats struct {
	Name          string
	ExtSource     string                // gnss SMA
	Port          map[string]*PortState // interface name is the key
	ClockState    ptp.SyncState
	NetworkOption int // 1 or 2
}

SyncEStats collects stats for synceE

func (*SyncEStats) GetSyncEPortStats

func (ss *SyncEStats) GetSyncEPortStats(source string) (p *PortState)

GetSyncEPortStats ... get synce port Stats

func (*SyncEStats) UpdateSyncEClockState

func (ss *SyncEStats) UpdateSyncEClockState()

UpdateSyncEClockState ...

Jump to

Keyboard shortcuts

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