MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / measure

Function measure

packages/backend/src/utils.ts:12–20  ·  view source on GitHub ↗
(cb: () => Promise<T>)

Source from the content-addressed store, hash-verified

10import { isOctokitRequestError } from "./github.js";
11
12export const measure = async <T>(cb: () => Promise<T>) => {
13 const start = Date.now();
14 const data = await cb();
15 const durationMs = Date.now() - start;
16 return {
17 data,
18 durationMs
19 }
20}
21
22export const marshalBool = (value?: boolean) => {
23 return !!value ? '1' : '0';

Callers 15

indexRepositoryMethod · 0.70
getReposOwnedByUsersFunction · 0.70
getReposForOrgsFunction · 0.70
getReposFunction · 0.70
getGitLabReposFromConfigFunction · 0.70
getReposOwnedByUsersFunction · 0.70
getReposForOrgsFunction · 0.70
getReposFunction · 0.70
getReposForOrganizationsFunction · 0.70
getReposForProjectsFunction · 0.70
getReposFunction · 0.70
getGerritReposFromConfigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected