feat(index): add back hot stats (#14664)

This commit is contained in:
Tony
2024-03-05 13:55:39 +08:00
committed by GitHub
parent 0f51d2f93a
commit d17ebe81d0
7 changed files with 128 additions and 26 deletions
+16 -1
View File
@@ -1,8 +1,23 @@
const debug = {
type DebugInfo = {
hitCache: number;
request: number;
etag: number;
error: number;
paths: Record<string, number>;
routes: Record<string, number>;
errorPaths: Record<string, number>;
errorRoutes: Record<string, number>;
};
const debug: DebugInfo = {
hitCache: 0,
request: 0,
etag: 0,
error: 0,
routes: {},
paths: {},
errorRoutes: {},
errorPaths: {},
};
export const getDebugInfo = () => debug;
+1 -1
View File
@@ -1,7 +1,7 @@
import gitRevSync from 'git-rev-sync';
let gitHash = process.env.HEROKU_SLUG_COMMIT?.slice(0, 8) || process.env.VERCEL_GIT_COMMIT_SHA?.slice(0, 8);
let gitDate;
let gitDate: Date | undefined;
if (!gitHash) {
try {
gitHash = gitRevSync.short(undefined, 8);