From 34467b1d7a40c4cfc9493ca2af778ffba49340fe Mon Sep 17 00:00:00 2001 From: tyltr Date: Mon, 29 Jan 2024 20:09:38 +0800 Subject: [PATCH] chore:remove constant from function (#2884) Signed-off-by: tyltr --- collector/timex.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/collector/timex.go b/collector/timex.go index c444d3ea..69cbc1a1 100644 --- a/collector/timex.go +++ b/collector/timex.go @@ -38,6 +38,9 @@ const ( // 1 second in nanoSeconds = 1000000000 microSeconds = 1000000 + + // See NOTES in adjtimex(2). + ppm16frac = 1000000.0 * 65536.0 ) type timexCollector struct { @@ -183,8 +186,6 @@ func (c *timexCollector) Update(ch chan<- prometheus.Metric) error { } else { divisor = microSeconds } - // See NOTES in adjtimex(2). - const ppm16frac = 1000000.0 * 65536.0 ch <- c.syncStatus.mustNewConstMetric(syncStatus) ch <- c.offset.mustNewConstMetric(float64(timex.Offset) / divisor)