【发布时间】:2021-01-18 15:25:47
【问题描述】:
我想将库 xmlhttprequest 或 xhr2 与 K6 性能测试工具一起使用。
由于 k6 不支持 node 模块,我收到以下错误
GoError: Module specifier "xhr2" was tried to be loaded as remote module by prepending "https://" to it, which didn't work. If you are trying to import a nodejs module, this is not supported as k6 is _not_ nodejs based. Please read https://k6.io/docs/using-k6/modules for more information. Remote resolution error: "Get "https://xhr2": dial tcp: lookup xhr2: no such host" at reflect.methodValueCall (native)
有没有办法可以在本地下载这些库并使用它们。感谢您的帮助。
【问题讨论】:
-
答案是否定的。但是有什么特别的原因要使用它们而不是内置的 k6 HTTP 库 k6.io/docs/javascript-api/k6-http 吗?
-
我有一些带有 xmlhttprequest 的代码,我想在 k6 中重用它们。当我尝试将其转换为 k6 http 库时出现错误
标签: javascript xmlhttprequest k6