# Impossible metric for Snowflake proxy

**URL:** https://forum.torproject.org/t/impossible-metric-for-snowflake-proxy/9941
**Category:** Relay Operator
**Tags:** snowflake
**Created:** [October 27, 2023, 2:13pm UTC](https://forum.torproject.org/t/impossible-metric-for-snowflake-proxy/9941 "2023-10-27T14:13:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hnapel4tor](https://forum.torproject.org/letter_avatar_proxy/v4/letter/h/3d9bf3/32.png) [@hnapel4tor](https://forum.torproject.org/u/hnapel4tor)
#### Post date: [October 27, 2023, 2:13pm UTC](https://forum.torproject.org/t/impossible-metric-for-snowflake-proxy/9941/1 "2023-10-27T14:13:36Z")

</div>

I’m running one of my Snowflake proxies from an ISP that only has like about 10Mbps upload speed, now I discovered the following metric that seems quite impossible:

2023/10/27 10:08:30 In the last 1h0m0s, there were 4 connections. Traffic Relayed ↓ 24784414 KB, ↑ 1207934 KB.

In my calculations having 10Mbps available (and note everything that comes down must go up) means at most around 4.5 GB (10x3600/8=4500MB) should have been able to get transferred during that hour, not 24+ GB. So what’s going on? I think I know the reason and this is that the amount of traffic send / received is only determined at the end of a session, so what we are seeing is the aggregated result of one (or more) sessions that have been active for like 6 hours. Perhaps this can be looked into and it would be possible to confirm by code inspection, the amount of data send received should perhaps be updated during a session too.

---

<div class="post-metadata">

### Author: ![trinity-1686a](https://forum.torproject.org/user_avatar/forum.torproject.org/trinity-1686a/32/1679_2.png) [@trinity-1686a](https://forum.torproject.org/u/trinity-1686a)
#### Post date: [October 27, 2023, 8:05pm UTC](https://forum.torproject.org/t/impossible-metric-for-snowflake-proxy/9941/2 "2023-10-27T20:05:55Z")

</div>

> I think I know the reason and this is that the amount of traffic send / received is only determined at the end of a session, so what we are seeing is the aggregated result of one (or more) sessions that have been active for like 6 hours.

The relevant code is [here](https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/blob/778e3af09a4e30ed8339a711f73e70fb1cc6cb23/proxy/lib/pt_event_logger.go#L29-39), and it looks like your intuition is right, it only adds to the count when a connection is over.

---

<div class="post-metadata">

### Author: ![arma](https://forum.torproject.org/user_avatar/forum.torproject.org/arma/32/25_2.png) [@arma](https://forum.torproject.org/u/arma)
#### Post date: [October 28, 2023, 5:53am UTC](https://forum.torproject.org/t/impossible-metric-for-snowflake-proxy/9941/3 "2023-10-28T05:53:26Z")

</div>

Agreed, I ran into this issue today too, and MarkC from irc pointed me to this forum thread.

I opened this snowflake gitlab ticket for the issue: [Proxy hourly stats did not actually happen during that hour (#40302) · Issues · The Tor Project / Anti-censorship / Pluggable Transports / Snowflake · GitLab](https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40302)

---

<div class="post-metadata">

### Author: ![system](https://forum.torproject.org/uploads/default/original/2X/d/d3424bed34f4ec18b2e99178c2801ba6dfb655d6.png) [@system](https://forum.torproject.org/u/system)
#### Post date: [October 29, 2023, 5:53am UTC](https://forum.torproject.org/t/impossible-metric-for-snowflake-proxy/9941/4 "2023-10-29T05:53:56Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![cecylia](https://forum.torproject.org/user_avatar/forum.torproject.org/cecylia/32/309_2.png) [@cecylia](https://forum.torproject.org/u/cecylia)
#### Post date: [October 30, 2023, 4:47pm UTC](https://forum.torproject.org/t/impossible-metric-for-snowflake-proxy/9941/5 "2023-10-30T16:47:07Z")

</div>

We just merged a fix for this: [Proxy stats log only what occurred that time interval (!202) · Merge requests · The Tor Project / Anti-censorship / Pluggable Transports / Snowflake · GitLab](https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/202)

Feel free to reopen the issue if it does not work for you.
