# Transaction Response time

**URL:** <https://community.grafana.com/t/transaction-response-time/98838>\
**Category:** OSS Support\
**Created:** [February 10, 2022, 5:38am UTC](https://community.grafana.com/t/transaction-response-time/98838 "2022-02-10T05:38:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerardlj](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gerardlj](https://community.grafana.com/u/gerardlj)\
**Post date:** [February 10, 2022, 5:38am UTC](https://community.grafana.com/t/transaction-response-time/98838/1 "2022-02-10T05:38:38Z")

</div>

Hi Team,

New to K6, is there is a way to get individual transaction (group) response time like avg, median, min, max, and percentile.

---

<div class="post-metadata">

**Author:** ![BobRuub](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@BobRuub](https://community.grafana.com/u/BobRuub)\
**Post date:** [February 10, 2022, 7:31am UTC](https://community.grafana.com/t/transaction-response-time/98838/2 "2022-02-10T07:31:19Z")

</div>

1. In the init section define your measurements.

```auto
const Login = new Trend('01Login');

```

1. after the call assign a value to the measurement

```auto
const loginResponse = http.post(loginUrl.toString(), loginPayload,{loginParams,responseCallback: only422callback});
Login.add(loginResponse.timings.duration);

```

1. at the end of the test the summary will report on the measurement, alongside the default metrics

```auto
     ✓ response body

     01Login........................: avg=403.911 min=403.911 med=403.911 max=403.911 p(90)=403.911 p(95)=403.911 
     checks.........................: 100.00% ✓ 2 ✗ 0
     data_received..................: 268 B 645 B/s
     data_sent......................: 148 B 356 B/s
     http_req_blocked...............: avg=379µs min=379µs med=379µs max=379µs p(90)=379µs p(95)=379µs   
     http_req_connecting............: avg=203µs min=203µs med=203µs max=203µs p(90)=203µs p(95)=203µs   
     http_req_duration..............: avg=403.91ms min=403.91ms med=403.91ms max=403.91ms p(90)=403.91ms p(95)=403.91ms
       { expected_response:true }...: avg=403.91ms min=403.91ms med=403.91ms max=403.91ms p(90)=403.91ms p(95)=403.91ms
     http_req_failed................: 0.00% ✓ 0 ✗ 1
     http_req_receiving.............: avg=1.13ms min=1.13ms med=1.13ms max=1.13ms p(90)=1.13ms p(95)=1.13ms  
     http_req_sending...............: avg=369µs min=369µs med=369µs max=369µs p(90)=369µs p(95)=369µs   
     http_req_tls_handshaking.......: avg=0s min=0s med=0s max=0s p(90)=0s p(95)=0s      
     http_req_waiting...............: avg=402.4ms min=402.4ms med=402.4ms max=402.4ms p(90)=402.4ms p(95)=402.4ms 
     http_reqs......................: 1 2.407359/s
     iteration_duration.............: avg=408.12ms min=408.12ms med=408.12ms max=408.12ms p(90)=408.12ms p(95)=408.12ms
     iterations.....................: 1 2.407359/s

```

---

<div class="post-metadata">

**Author:** ![gerardlj](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gerardlj](https://community.grafana.com/u/gerardlj)\
**Post date:** [February 10, 2022, 10:43am UTC](https://community.grafana.com/t/transaction-response-time/98838/3 "2022-02-10T10:43:06Z")

</div>

Thanks, @BobRuub . How do we add the response time of multiple request timings to a single transaction?  
Ex 01\_Transaction=resp duration Req 01 + resp duration Req 02 + resp duration Req 03

Also how to handle the parallel request

---

<div class="post-metadata">

**Author:** ![BobRuub](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@BobRuub](https://community.grafana.com/u/BobRuub)\
**Post date:** [February 10, 2022, 10:51am UTC](https://community.grafana.com/t/transaction-response-time/98838/4 "2022-02-10T10:51:56Z")

</div>

Yes, adding the durations works if that’s what you require.

never used it myself but http batch seems to be what you are looking for…

> **[batch( requests )](https://k6.io/docs/javascript-api/k6-http/batch/)**
>
> Issue multiple HTTP requests in parallel (like e.g. browsers tend to do).

---

<div class="post-metadata">

**Author:** ![Gobinath](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Gobinath](https://community.grafana.com/u/Gobinath)\
**Post date:** [July 13, 2023, 8:50am UTC](https://community.grafana.com/t/transaction-response-time/98838/6 "2023-07-13T08:50:33Z")

</div>

Hi Gerard,

I am also looking for the same response time calculation. I you have the solution for this, can you please share the same?
