Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ybrill committed Dec 13, 2023
1 parent 0b9a2f5 commit 4383ae7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
6 changes: 1 addition & 5 deletions src/constants/externalResources.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("getTaskTraceUrl", () => {
});
});

describe("getTaskSystemMetricsUrl", () => {
describe("getHoneycombSystemMetricsUrl", () => {
it("generates the correct url", () => {
expect(
getHoneycombSystemMetricsUrl(
Expand All @@ -77,11 +77,7 @@ describe("getTaskSystemMetricsUrl", () => {
).toBe(
`/datasets/evergreen?query={"calculations":[{"op":"AVG","column":"system.memory.usage.used"},{"op":"AVG","column":"system.cpu.utilization"},{"op":"RATE_AVG","column":"system.network.io.transmit"},{"op":"RATE_AVG","column":"system.network.io.receive"}],"filters":[{"op":"=","column":"evergreen.task.id","value":"task_12345"}],"start_time":1688756921,"end_time":1688760000}&omitMissingValues`
);
});
});

describe("getTaskSystemMetricsUrlWithDisks", () => {
it("generates the correct url", () => {
expect(
getHoneycombSystemMetricsUrl(
"task_12345",
Expand Down
22 changes: 10 additions & 12 deletions src/constants/externalResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,16 @@ export const getHoneycombSystemMetricsUrl = (
{ op: "RATE_AVG", column: "system.network.io.transmit" },
{ op: "RATE_AVG", column: "system.network.io.receive" },
].concat(
diskDevices
.map((device) => [
{ op: "RATE_AVG", column: `system.disk.io.${device}.read` },
{ op: "RATE_AVG", column: `system.disk.io.${device}.write` },
{ op: "RATE_AVG", column: `system.disk.operations.${device}.read` },
{
op: "RATE_AVG",
column: `system.disk.operations.${device}.write`,
},
{ op: "RATE_AVG", column: `system.disk.io_time.${device}` },
])
.flat()
diskDevices.flatMap((device) => [
{ op: "RATE_AVG", column: `system.disk.io.${device}.read` },
{ op: "RATE_AVG", column: `system.disk.io.${device}.write` },
{ op: "RATE_AVG", column: `system.disk.operations.${device}.read` },
{
op: "RATE_AVG",
column: `system.disk.operations.${device}.write`,
},
{ op: "RATE_AVG", column: `system.disk.io_time.${device}` },
])
),
filters: [{ op: "=", column: "evergreen.task.id", value: taskId }],
start_time: getUnixTime(new Date(startTs)),
Expand Down

0 comments on commit 4383ae7

Please sign in to comment.