mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-24 14:34:21 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
34 lines
621 B
TypeScript
34 lines
621 B
TypeScript
import type { RenovateSplit } from '../config/types.ts';
|
|
|
|
let startTime = 0;
|
|
let lastTime = 0;
|
|
let splits: Record<RenovateSplit, number> = {
|
|
init: 0,
|
|
onboarding: 0,
|
|
extract: 0,
|
|
lookup: 0,
|
|
update: 0,
|
|
};
|
|
|
|
export function splitInit(): void {
|
|
splits = {
|
|
init: 0,
|
|
onboarding: 0,
|
|
extract: 0,
|
|
lookup: 0,
|
|
update: 0,
|
|
};
|
|
startTime = Date.now();
|
|
lastTime = startTime;
|
|
}
|
|
|
|
export function addSplit(name: RenovateSplit): void {
|
|
const now = Date.now();
|
|
splits[name] = now - lastTime;
|
|
lastTime = now;
|
|
}
|
|
|
|
export function getSplits(): any {
|
|
return { splits, total: Date.now() - startTime };
|
|
}
|