finish() {
    this.response.output.body = new TextEncoder().encode(JSON.stringify(this.response.output.body))
    this.passThroughParams.response = this.response
    this.onComplete(this.passThroughParams)

    this.segment.touch()
  }
Encodes the output body into a Uint8Array, updates the pass through
parameters with the compiled response object, and invokes the response
handler. The trace segment is also updated to mark the end of the stream
processing and account for the time it took to process the stream within
the trace.