log = (...args) => {
console.log(...args);
const line = args.join(" ");
const match = /(\S+) (\d+)ms (\S+)/.exec(line);
logs.push(line);
if (match) {
const [_, label, millis, operation] = match;
viewof latency_measurements.value.push({
client: label.replace("-s", "").replace("-w", ""),
latency: Number.parseInt(millis),
operation:
operation.startsWith("PUT") || operation == "CLEANUP"
? "PUT"
: operation === "SWEEP" ||
operation === "POLL_TIME" ||
operation == "LOOK_BACK" ||
operation == "GET_CONTENT" ||
operation == "GET_LATEST"
? "GET"
: operation
});
viewof latency_measurements.dispatchEvent(new Event("input"));
}
}