Skip to content

Commit bfcba49

Browse files
author
dummy
committed
Fix millisecond calculation for millisecs_diff()
Previously, millisecs_diff() did not return milliseconds correctly, so it was not collecting according to the period settings for the profile and history.
1 parent d61a869 commit bfcba49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: collector.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ static int64
306306
millisecs_diff(TimestampTz tz1, TimestampTz tz2)
307307
{
308308
long secs;
309-
int millisecs;
309+
int microsecs;
310310

311-
TimestampDifference(tz1, tz2, &secs, &millisecs);
311+
TimestampDifference(tz1, tz2, &secs, &microsecs);
312312

313-
return secs * 1000 + millisecs;
313+
return secs * 1000 + microsecs / 1000;
314314

315315
}
316316

0 commit comments

Comments
 (0)