Skip to content

Commit 1964c15

Browse files
committed
Removes perf_hooks usage since it proved to be a never-ending rabbithole of import errors
1 parent 8850513 commit 1964c15

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/core/src/mapping-kit/liquid-directive.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Liquid } from 'liquidjs'
22
import { StatsContext } from '../destination-kit'
3-
import { performance } from 'perf_hooks'
43

54
const liquidEngine = new Liquid({
65
renderLimit: 500, // 500 ms
@@ -75,20 +74,20 @@ export function evaluateLiquid(liquidValue: any, event: any, statsContext?: Stat
7574
}
7675

7776
let res
78-
const start = performance.now()
77+
const start = Date.now()
7978
let duration
8079
try {
8180
res = liquidEngine.parseAndRenderSync(liquidValue, event)
8281
} catch (e) {
83-
duration = performance.now() - start
82+
duration = Date.now() - start
8483

8584
statsContext?.statsClient?.histogram('liquid.template.evaluation_ms', duration, [
8685
...statsContext.tags,
8786
`result:fail` // status = success/fail, not in the psudocode for simplicity
8887
])
8988
throw e
9089
}
91-
duration = performance.now() - start
90+
duration = Date.now() - start
9291

9392
statsContext?.statsClient?.histogram('liquid.template.evaluation_ms', duration, [
9493
...statsContext.tags,

0 commit comments

Comments
 (0)