(
req: FastifyRequest<{
Params: { projectId: string };
Querystring: z.infer<typeof zGetMetricsQuery>;
}>,
reply: FastifyReply
)
| 144 | }); |
| 145 | |
| 146 | export async function getMetrics( |
| 147 | req: FastifyRequest<{ |
| 148 | Params: { projectId: string }; |
| 149 | Querystring: z.infer<typeof zGetMetricsQuery>; |
| 150 | }>, |
| 151 | reply: FastifyReply |
| 152 | ) { |
| 153 | const projectId = await getProjectId(req as RequestWithProjectParam); |
| 154 | const { timezone } = await getSettingsForProject(projectId); |
| 155 | const { startDate, endDate } = getChartStartEndDate(req.query, timezone); |
| 156 | reply.send( |
| 157 | await overviewService.getMetrics({ |
| 158 | projectId, |
| 159 | filters: req.query.filters, |
| 160 | startDate, |
| 161 | endDate, |
| 162 | interval: getDefaultIntervalByDates(startDate, endDate) ?? 'day', |
| 163 | timezone, |
| 164 | }) |
| 165 | ); |
| 166 | } |
| 167 | |
| 168 | // --------------------------------------------------------------------------- |
| 169 | // Analytics — live visitors |
nothing calls this directly
no test coverage detected