Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

save data in ms

Blue Mouse8f48e8bb9ff0
diff --git a/src/analytics/analytics.controller.ts b/src/analytics/analytics.controller.ts
index f2fef0bb4..0f2ced3e9 100644
--- a/src/analytics/analytics.controller.ts
+++ b/src/analytics/analytics.controller.ts
@@ -6,6 +6,7 @@ import * as _last from 'lodash/last'
import * as _pick from 'lodash/pick'
import * as _map from 'lodash/map'
import * as _uniqBy from 'lodash/uniqBy'
+import * as _round from 'lodash/round'
import * as dayjs from 'dayjs'
import * as utc from 'dayjs/plugin/utc'
import * as timezone from 'dayjs/plugin/timezone'
@@ -129,14 +130,14 @@ const performanceDTO = (
pg,
dv,
br,
- dns,
- tls,
- conn,
- response,
- render,
- domLoad,
- pageLoad,
- ttfb,
+ _round(dns),
+ _round(tls),
+ _round(conn),
+ _round(response),
+ _round(render),
+ _round(domLoad),
+ _round(pageLoad),
+ _round(ttfb),
dayjs.utc().format('YYYY-MM-DD HH:mm:ss'),
]
}
@@ -203,7 +204,7 @@ export class AnalyticsController {
private readonly analyticsService: AnalyticsService,
private readonly logger: AppLoggerService,
private readonly taskManagerService: TaskManagerService,
- ) {}
+ ) { }
@Get('/')
async getData(