Skip to content

Commit

Permalink
Add 99th percentile
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Mar 5, 2024
1 parent 4ef71cd commit b952ad1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions library/src/agent/InspectionStatistics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ t.test("it keeps track of amount of calls", async () => {
75: 0.1,
90: 0.1,
95: 0.1,
99: 0.1,
},
},
});
Expand All @@ -51,6 +52,7 @@ t.test("it keeps track of amount of calls", async () => {
75: 0.1,
90: 0.1,
95: 0.1,
99: 0.1,
},
},
});
Expand All @@ -72,6 +74,7 @@ t.test("it keeps track of amount of calls", async () => {
75: 0.1,
90: 0.1,
95: 0.1,
99: 0.1,
},
},
});
Expand All @@ -98,6 +101,7 @@ t.test("it keeps track of amount of calls", async () => {
75: 0.1,
90: 0.1,
95: 0.1,
99: 0.1,
},
},
});
Expand All @@ -124,6 +128,7 @@ t.test("it keeps track of amount of calls", async () => {
75: 0.3,
90: 0.3,
95: 0.3,
99: 0.3,
},
},
});
Expand Down
6 changes: 5 additions & 1 deletion library/src/agent/InspectionStatistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ export class InspectionStatistics {
};

if (timings.length > 0) {
const [p50, p75, p90, p95] = percentiles([50, 75, 90, 99], timings);
const [p50, p75, p90, p95, p99] = percentiles(
[50, 75, 90, 95, 99],
timings
);
stats[module].percentiles = {
"50": p50,
"75": p75,
"90": p90,
"95": p95,
"99": p99,
};
}
}
Expand Down

0 comments on commit b952ad1

Please sign in to comment.