Skip to content

Commit

Permalink
instrumentation: add logged metric for how long serializeMDX takes (#815
Browse files Browse the repository at this point in the history
)
  • Loading branch information
abvthecity authored May 7, 2024
1 parent 487fc56 commit c6b3915
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/ui/docs-bundle/src/utils/getDocsPageProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ export async function getDocsPageProps(
throw new Error("Failed to fetch docs");
}

return convertDocsToDocsPageProps({ docs: docs.body, slug, url, xFernHost });
const start2 = Date.now();
const toRet = convertDocsToDocsPageProps({ docs: docs.body, slug, url, xFernHost });
const end2 = Date.now();

// eslint-disable-next-line no-console
console.log(`[getDocsPageProps] serializeMdx completed in ${end2 - start2}ms for ${url}`);
return toRet;
}

export async function getPrivateDocsPageProps(
Expand Down

0 comments on commit c6b3915

Please sign in to comment.