Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcp_connection_duration should be measured in seconds #2207

Open
olix0r opened this issue Feb 5, 2019 · 3 comments
Open

tcp_connection_duration should be measured in seconds #2207

olix0r opened this issue Feb 5, 2019 · 3 comments

Comments

@olix0r
Copy link
Member

olix0r commented Feb 5, 2019

We currently measure connection durations in milliseconds. It's probably more appropriate to measure connection durations in terms of seconds. In either case, we should use a histogram that makes sense for connection durations:

tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="1"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="2"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="3"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="4"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="5"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="10"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="20"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="30"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="40"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="50"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="100"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="200"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="300"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="400"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="500"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="1000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="2000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="3000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="4000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="5000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="10000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="20000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="30000"} 1
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="40000"} 1
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="50000"} 1
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="+Inf"} 5
tcp_connection_duration_ms_count{direction="inbound",peer="src",tls="true",errno="ENOTCONN"} 5
tcp_connection_duration_ms_sum{direction="inbound",peer="src",tls="true",errno="ENOTCONN"} 28334607
@zaharidichev
Copy link
Member

@olix0r Based on your observations, what seconds - measured buckets would make more senes ?

@psinghal20
Copy link
Contributor

Hi @olix0r, I am new to this project and would love to take up this issue if it is still relevant. Can you help me out with some pointers to tackle this issue?

@psinghal20
Copy link
Contributor

hi @olix0r, I looked through the codebase and found latency::Ms being used for the calculation of connection_duration. I added a similar implementation for latency::Sec using the same bounds. I modified the EosMetrics to use this new type and changed its name to tcp_connection_duration_s. Did I get it correct? If yes, I can raise a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants