MCPcopy
hub / github.com/prometheus/prometheus / f

Function f

web/ui/react-app/src/utils/index.ts:89–98  ·  view source on GitHub ↗
(unit: string, mult: number, exact: boolean)

Source from the content-addressed store, hash-verified

87 }
88
89 const f = (unit: string, mult: number, exact: boolean) => {
90 if (exact && ms % mult !== 0) {
91 return;
92 }
93 const v = Math.floor(ms / mult);
94 if (v > 0) {
95 r += `${v}${unit}`;
96 ms -= v * mult;
97 }
98 };
99
100 // Only format years and weeks if the remainder is zero, as it is often
101 // easier to read 90d than 12w6d.

Callers 15

PopulateBlockMethod · 0.85
IterateExemplarsMethod · 0.85
TraverseOpenReadsMethod · 0.85
ReadPostingsOffsetTableFunction · 0.85
IterMethod · 0.85
IterateAllChunksMethod · 0.85
IterMethod · 0.85
runMethod · 0.85
nextSegmentMethod · 0.85
retryFunction · 0.85

Calls

no outgoing calls

Tested by 8

PopulateBlockMethod · 0.68
retryFunction · 0.68
AcceptMethod · 0.68
visitMockQueriersFunction · 0.68
foreachAppendableFunction · 0.68