c4u

package
v0.0.0-...-b56da86 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

c4u

Config generator for ptp4u. It collects clock data from different sources, builds PTP-compatible ClockClass and ClockAccuracy over specified time interval applying specified aggregation. Currently 2 data sources implemented:

Run

Default arguments are good for most of the cases. However, there is a lot of room for customisation:

/usr/local/bin/c4u -sample 600 -path /tmp/config.txt -apply

This will run c4u with sliding windown of 600 samples and generate /tmp/config.txt config

Config generation

$ cat /etc/ptp4u.yaml
clockaccuracy: 33
clockclass: 6
draininterval: 30s
maxsubduration: 1h0m0s
metricinterval: 1m0s
minsubinterval: 1s
utcoffset: 37s

Math

By default clockAccuracy will be calculated using 3 sigma rule from ts2phc + oscillatord offsets. ClockClass is calculated using a simple p99 aggregation from oscillatord values.

Monitoring

By default c4u runs http server serving json monitoring data. Ex:

$ curl localhost:8889 | jq
{
  "clockaccuracy": 254,
  "clockclass": 52,
  "dataerror": 13,
  "oscillatoroffset_ns": 0,
  "phcoffset_ns": 0,
  "reload": 0,
  "utcoffset_sec": 37
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(config *Config, rb *clock.RingBuffer, st stats.Stats) error

Run config generation once

func SdNotify

func SdNotify() error

SdNotify notifies systemd about service successful start

Types

type Config

type Config struct {
	Apply               bool
	Path                string
	Pid                 string
	Sample              int
	AccuracyExpr        string
	ClassExpr           string
	LockBaseLine        ptp.ClockAccuracy
	CalibratingBaseLine ptp.ClockAccuracy
	HoldoverBaseLine    ptp.ClockAccuracy
}

Config is a struct representing the config of the c4u

Directories

Path Synopsis
Package stats implements statistics collection and reporting.
Package stats implements statistics collection and reporting.

Jump to

Keyboard shortcuts

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