瀏覽代碼

k6: Check that body size is not NaN before metering it

DarthSim 1 年之前
父節點
當前提交
7f9ec5a5bd
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      k6/index.js

+ 1 - 1
k6/index.js

@@ -68,5 +68,5 @@ export default function() {
   group_durations[url.group].add(res.timings.duration);
   group_durations[url.group].add(res.timings.duration);
 
 
   const body_size = Math.round(parseInt(res.headers["Content-Length"]) / 10.24) / 100;
   const body_size = Math.round(parseInt(res.headers["Content-Length"]) / 10.24) / 100;
-  group_sizes[url.group].add(body_size);
+  if (!isNaN(body_size)) group_sizes[url.group].add(body_size);
 }
 }