feat(devops): separate public page server timing diagnostics
This commit is contained in:
1 parent
d5091d1a73
commit
baeb54aeb5
15 files changed
+315
-29
No files matched your search
@@ -85,3 +85,22 @@ it("does not change a completed snapshot when background work finishes", async (
|
||||
await background;
|
||||
expect(result.metrics.external.count).toBe(0);
|
||||
});
|
||||
|
||||
it("reports timings on failure without replacing the application error", async () => {
|
||||
const error = new Error("original");
|
||||
let captured = 0;
|
||||
await expect(
|
||||
collectPerformance(
|
||||
async () => {
|
||||
await measureDependency("database", async () => {
|
||||
throw error;
|
||||
});
|
||||
},
|
||||
(metrics) => {
|
||||
captured = metrics.database.errors;
|
||||
throw Error("telemetry failure");
|
||||
},
|
||||
),
|
||||
).rejects.toBe(error);
|
||||
expect(captured).toBe(1);
|
||||
});
|
||||
Reference in new issue
Block a user