File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { getCommitChangesTime } from '../shared/commitChanges'
2+ import {
3+ getCommitHostEffectsTime ,
4+ getTotalEffects
5+ } from '../shared/hostEffects'
6+ import { getLifecycleTime , getTotalMethods } from '../shared/lifecycle'
7+
8+ import { getTotalTime } from '../shared/totalTime'
9+
10+ // Compute the total time
11+ export function computeTotalTime ( measures , componentTotalTime ) {
12+ let total = 0
13+
14+ {
15+ total = total || 0
16+ total += getTotalTime ( getCommitChangesTime ( measures ) )
17+ total += getTotalTime ( getCommitHostEffectsTime ( measures ) )
18+ total += getTotalTime ( getLifecycleTime ( measures ) )
19+ total += Number ( componentTotalTime )
20+ }
21+
22+ return total
23+ }
24+
25+ // Compute the results (host effects, lifecycle and committing change time)
26+ export function getResults ( measures ) {
27+ return {
28+ commitChangesTime : Number (
29+ getTotalTime ( getCommitChangesTime ( measures ) ) . toFixed ( 2 )
30+ ) ,
31+ totalEffects : Number ( getTotalEffects ( getCommitHostEffectsTime ( measures ) ) ) ,
32+ hostEffectsTime : Number (
33+ getTotalTime ( getCommitHostEffectsTime ( measures ) ) . toFixed ( 2 )
34+ ) ,
35+ totalLifecycleMethods : Number ( getTotalMethods ( getLifecycleTime ( measures ) ) ) ,
36+ lifecycleTime : Number ( getTotalTime ( getLifecycleTime ( measures ) ) . toFixed ( 2 ) )
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments