# Proposal: add a connection\_id to requests

**URL:** <https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706>\
**Category:** Analysis\
**Created:** [April 1, 2016, 8:37pm UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706 "2016-04-01T20:37:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![robgjansen](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@robgjansen](https://discuss.httparchive.org/u/robgjansen)\
**Post date:** [April 1, 2016, 8:37pm UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706/1 "2016-04-01T20:37:40Z")

</div>

Could we add a connection\_id to the requests table, and start populating that field by tracking which requests went over the same connection? The connection\_id could be unique per page. This would be helpful in understanding the full distribution of requests per connection; as I understand it, currently only the average is average as reqTotal/\_connections.

---

<div class="post-metadata">

**Author:** ![patmeenan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/patmeenan/32/605_2.png) [@patmeenan](https://discuss.httparchive.org/u/patmeenan)\
**Post date:** [April 1, 2016, 8:53pm UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706/2 "2016-04-01T20:53:18Z")

</div>

FWIW, I am pretty sure the connection ID is in the raw HAR data and can be queried in bigquery (there is already one reported by WPT that is unique per page and used for the “connection view” waterfalls).

---

<div class="post-metadata">

**Author:** ![igrigorik](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/igrigorik/32/925_2.png) [@igrigorik](https://discuss.httparchive.org/u/igrigorik)\
**Post date:** [April 2, 2016, 2:36am UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706/3 "2016-04-02T02:36:25Z")

</div>

Yep, as Pat said, we already track this data in the HAR dumps. A quick example:

```sql
SELECT socket, count(socket) as num_requests 
FROM (
  SELECT 
    JSON_EXTRACT(payload, '$._socket') AS socket,
    url, page
  FROM [har.android_feb_15_2016_requests]
  WHERE page == 'http://www.amazon.com/'
) 
GROUP by socket
ORDER BY num_requests desc

```

Results:  
 ![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/httparchive/original/1X/c67c35b50e284cdafa10c95b3e7aff94332f8f08.png)

[Amazon.com](http://Amazon.com): 49 sockets in total, sorted by number of requests per socket.

---

<div class="post-metadata">

**Author:** ![robgjansen](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@robgjansen](https://discuss.httparchive.org/u/robgjansen)\
**Post date:** [April 5, 2016, 9:27pm UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706/4 "2016-04-05T21:27:41Z")

</div>

Great! I was hoping it could be added to the mysql dumps, so it’s good to know it’s available in the HAR dumps.

---

<div class="post-metadata">

**Author:** ![robgjansen](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@robgjansen](https://discuss.httparchive.org/u/robgjansen)\
**Post date:** [April 8, 2016, 12:21pm UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706/5 "2016-04-08T12:21:22Z")

</div>

Is this something that makes more sense to propose on the github page? Or is the code that produces the mysql dumps hosted somewhere else? Thanks!

---

<div class="post-metadata">

**Author:** ![steve\_discussha](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@steve\_discussha](https://discuss.httparchive.org/u/steve_discussha)\
**Post date:** [April 8, 2016, 2:38pm UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706/6 "2016-04-08T14:38:46Z")

</div>

Yes, please open a github issue here: [https://github.com/HTTPArchive/httparchive/issues](https://github.com/HTTPArchive/httparchive/issues)

---

<div class="post-metadata">

**Author:** ![robgjansen](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@robgjansen](https://discuss.httparchive.org/u/robgjansen)\
**Post date:** [April 8, 2016, 4:11pm UTC](https://discuss.httparchive.org/t/proposal-add-a-connection-id-to-requests/706/7 "2016-04-08T16:11:37Z")

</div>

Done!  
[https://github.com/HTTPArchive/httparchive/issues/61](https://github.com/HTTPArchive/httparchive/issues/61)
