Skip to content

Commit

Permalink
chore:remove constant from function (prometheus#2884)
Browse files Browse the repository at this point in the history
Signed-off-by: tyltr <[email protected]>
Signed-off-by: Vitaly Zhuravlev <[email protected]>
  • Loading branch information
tylitianrui authored and v-zhuravlev committed Nov 1, 2024
1 parent 0b02a80 commit 11c8736
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions collector/timex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 11c8736

Please sign in to comment.