1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

clock-skew: truncate skews to integer seconds

This commit is contained in:
dmiller
2016-10-24 20:17:08 +00:00
parent d4fd11fc91
commit 949297e5aa

View File

@@ -88,6 +88,10 @@ end
hostaction = function(host)
local mean, stddev = formulas.mean_stddev(host.registry.datetime_skew)
local median = formulas.median(host.registry.datetime_skew)
-- truncate to integers; we don't care about fractional seconds)
mean = math.modf(mean)
stddev = math.modf(stddev)
median = math.modf(median)
record_stats(host, mean, stddev, median)
local out = {mean = mean, stddev = stddev, median = median}
return out, ("mean: %s, deviation: %s, median: %s"):format(