/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/specs/cli/otel_basic/node_http_metric.ts
19 строк
433 B
Yoshiya Hinosawa
test(otel): add test of otel integration of node http server (#28461)
11 мар 2025, 17:11
Не верифицирован
11 мар 2025, 17:11
6ddf0f2
Код
Авторство
О чём код?
import http from "node:http"; import { text } from "node:stream/consumers"; const server = http.createServer((req, res) => { res.end("foo"); }); server.listen(0, async () => { const port = server.address().port; for (const _ of Array(3)) { await new Promise((resolve) => { http.get(`http://localhost:${port}`, async (res) => { await text(res); resolve(); }); }); } server.close(); });