(chunk, controller)
| 222 | |
| 223 | const counting = new TransformStream<unknown, unknown>({ |
| 224 | transform(chunk, controller) { |
| 225 | const written = byteLengthOf(chunk); |
| 226 | const writeAt = Date.now(); |
| 227 | connection.chunks += 1; |
| 228 | connection.bytes += written; |
| 229 | connection.lastWriteAt = writeAt; |
| 230 | totalBytesForwarded += written; |
| 231 | maybeEmitPeriodicSnapshot(writeAt, OTEL_MAX_SPAN_QUEUE_SIZE); |
| 232 | controller.enqueue(chunk); |
| 233 | }, |
| 234 | flush() { |
| 235 | closeConnection(connection, "normal", OTEL_MAX_SPAN_QUEUE_SIZE); |
| 236 | }, |
no test coverage detected