MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / ratio

Function ratio

apps/api/src/agents/tools/profile.ts:267–274  ·  view source on GitHub ↗
(a: number, b: number)

Source from the content-addressed store, hash-verified

265 };
266
267 const ratio = (a: number, b: number): { ratio: number; label: 'above' | 'below' | 'equal' } => {
268 if (b === 0) return { ratio: 0, label: a > 0 ? 'above' : 'equal' };
269 const r = a / b;
270 return {
271 ratio: Number(r.toFixed(2)),
272 label: r > 1.05 ? 'above' : r < 0.95 ? 'below' : 'equal',
273 };
274 };
275
276 return {
277 profile: thisMetrics,

Callers 1

profile.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected