- const performanceRecord = new PerformanceRecord()
- await this.orm?.em.persistAndFlush(performanceRecord)
+ this.setPerformanceStatistics(performanceStatistics)
+ await this.orm?.em.upsert({
+ ...performanceStatistics,
+ statisticsData: Array.from(performanceStatistics.statisticsData, ([name, value]) => ({
+ name,
+ ...value
+ }))
+ } satisfies PerformanceRecord)