Documentation ¶
Overview ¶
Package stats ...
Index ¶
- type PTPStats
- func (ps PTPStats) CheckSource(k types.IFace, configName, processName string)
- func (ps PTPStats) HasMetricHelp(process string) map[string]string
- func (ps PTPStats) HasMetrics(process string) map[string]*event.PMetric
- func (ps PTPStats) New() PTPStats
- func (ps PTPStats) Reset()
- func (ps PTPStats) SetConfigAsDeleted(state bool)
- type PortState
- type Stats
- func (s *Stats) AddValue(val int64)
- func (s *Stats) Alias() string
- func (s *Stats) ClockClass() int64
- func (s *Stats) ConfigName() string
- func (s *Stats) Delay() int64
- func (s *Stats) DeleteAllMetrics(m []*prometheus.GaugeVec)
- func (s *Stats) FrequencyAdjustment() int64
- func (s *Stats) GetCurrentDependentEventState() ptp.SyncState
- func (s *Stats) GetDependsOnValueState(processName string, iface *string, key string) (int64, float64, ptp.SyncState, error)
- func (s *Stats) GetInterfaceByIndex(processName string, index int) *string
- func (s *Stats) GetStateState(processName string, iface *string) (ptp.SyncState, error)
- func (s *Stats) GetSyncE() (se *SyncEStats)
- func (s *Stats) HasProcessEnabled(processName string) bool
- func (s *Stats) LastOffset() int64
- func (s *Stats) LastSyncState() ptp.SyncState
- func (s *Stats) MaxAbs() int64
- func (s *Stats) Offset() int64
- func (s *Stats) OffsetSource() string
- func (s *Stats) ProcessName() string
- func (s *Stats) PtpDependentEventState() *event.PTPEventState
- func (s *Stats) Role() types.PtpPortRole
- func (s *Stats) SetAlias(val string)
- func (s *Stats) SetClockClass(val int64)
- func (s *Stats) SetDelay(val int64)
- func (s *Stats) SetFrequencyAdjustment(val int64)
- func (s *Stats) SetLastOffset(val int64)
- func (s *Stats) SetLastSyncState(val ptp.SyncState)
- func (s *Stats) SetOffsetSource(os string)
- func (s *Stats) SetProcessName(processName string)
- func (s *Stats) SetPtpDependentEventState(e event.ClockState, metrics map[string]*event.PMetric, help map[string]string)
- func (s *Stats) SetRole(role types.PtpPortRole)
- func (s *Stats) SetSyncE(se *SyncEStats)
- func (s *Stats) StDev() float64
- func (s *Stats) String() string
- func (s *Stats) SyncState() ptp.SyncState
- type SyncEStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PTPStats ¶
PTPStats ...
func (PTPStats) CheckSource ¶
CheckSource ... check key
func (PTPStats) HasMetricHelp ¶
HasMetricHelp ...
func (PTPStats) HasMetrics ¶
HasMetrics ...
func (PTPStats) SetConfigAsDeleted ¶
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 (*Stats) ClockClass ¶
ClockClass return last known ClockClass
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 ¶
FrequencyAdjustment ... get frequency adjustment value
func (*Stats) GetCurrentDependentEventState ¶
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 ¶
GetInterfaceByIndex ... get iface
func (*Stats) GetStateState ¶
GetStateState ... get state
func (*Stats) HasProcessEnabled ¶
HasProcessEnabled ... check if process is enabled
func (*Stats) LastSyncState ¶
LastSyncState ... last sync state
func (*Stats) OffsetSource ¶
OffsetSource ... get offset source
func (*Stats) ProcessName ¶
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) SetClockClass ¶
SetClockClass ... set last clock class value
func (*Stats) SetFrequencyAdjustment ¶
SetFrequencyAdjustment ... set frequency adjustment
func (*Stats) SetLastOffset ¶
SetLastOffset ... set last offset value
func (*Stats) SetLastSyncState ¶
SetLastSyncState ... set last sync state
func (*Stats) SetOffsetSource ¶
SetOffsetSource ... set offset source ptp4/phc2sys/master
func (*Stats) SetProcessName ¶
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
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 ...