{"action":"created","issue":{"url":"https://api.github.com/repos/containous/traefik/issues/1650","repository_url":"https://api.github.com/repos/containous/traefik","labels_url":"https://api.github.com/repos/containous/traefik/issues/1650/labels{/name}","comments_url":"https://api.github.com/repos/containous/traefik/issues/1650/comments","events_url":"https://api.github.com/repos/containous/traefik/issues/1650/events","html_url":"https://github.com/containous/traefik/issues/1650","id":230391737,"number":1650,"title":"ConnLimit load-balancer visualisation","user":{"login":"mihaitodor","id":788216,"avatar_url":"https://avatars0.githubusercontent.com/u/788216?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaitodor","html_url":"https://github.com/mihaitodor","followers_url":"https://api.github.com/users/mihaitodor/followers","following_url":"https://api.github.com/users/mihaitodor/following{/other_user}","gists_url":"https://api.github.com/users/mihaitodor/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaitodor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaitodor/subscriptions","organizations_url":"https://api.github.com/users/mihaitodor/orgs","repos_url":"https://api.github.com/users/mihaitodor/repos","events_url":"https://api.github.com/users/mihaitodor/events{/privacy}","received_events_url":"https://api.github.com/users/mihaitodor/received_events","type":"User","site_admin":false},"labels":[{"id":589599863,"url":"https://api.github.com/repos/containous/traefik/labels/area/api","name":"area/api","color":"bfdadc","default":false},{"id":587478415,"url":"https://api.github.com/repos/containous/traefik/labels/area/webui","name":"area/webui","color":"1d76db","default":false},{"id":259872488,"url":"https://api.github.com/repos/containous/traefik/labels/kind/enhancement","name":"kind/enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-22T13:14:13Z","updated_at":"2017-05-22T14:12:40Z","closed_at":null,"body":"### Do you want to request a *feature* or report a *bug*?\r\n\r\nfeature\r\n\r\n### Description\r\n\r\nCurrently, the Traefik REST API and UI do not expose the number of active connections and the total number of connections when the ConnLimit load-balancer is enabled for (some) backends.\r\n\r\nIn this sense, I wrote [some code](https://github.com/mihaitodor/traefik/commits/backend-conn-stats) which exposes these numbers through the REST API for each backend that has ConnLimit enabled and I added some UI graphs which help us visualise the Historical Connection Counts through a line chart and the Current Connection Counts (versus the max counts) through a discrete bar chart. Here is a preview of the UI additions:\r\n\r\n![](https://media.giphy.com/media/xUPGcITQd0LHupfPYk/giphy.gif)\r\n\r\nIn order to make this work, I needed access to some [private data](https://github.com/containous/oxy/blob/f88530866c561d24a6b5aac49f76d6351b788b9f/connlimit/connlimit.go#L19) from your fork of [vulcand/oxy](https://github.com/containous/oxy), which I extracted via a reflection hack [here](https://github.com/mihaitodor/traefik/commit/ff1302dc436ddb9467b74de8d0ffa29589b222c1#diff-a3520fb65206c9e232f10baaff310c7aR394). If you are interested in maintaining extra changes to this oxy fork, I'm more than happy to push a PR to it, in order to not need reflection for extracting the connection counts. This shouldn't have any impact on the performance, so I don't mind keeping the reflection code.\r\n\r\nRegarding the REST API, I created 2 new routes: [`api/conn_stats`](https://github.com/mihaitodor/traefik/commit/ff1302dc436ddb9467b74de8d0ffa29589b222c1#diff-a3520fb65206c9e232f10baaff310c7aR128) and [`api/providers/{provider}/backends/{backend}/conn_stats`](https://github.com/mihaitodor/traefik/commit/ff1302dc436ddb9467b74de8d0ffa29589b222c1#diff-a3520fb65206c9e232f10baaff310c7aR129). The UI additions [require only the first route](https://github.com/mihaitodor/traefik/commit/77b1e06a0683f5e411efe22db1097333c5176ab5#diff-74137107f6bef14865fd3a0d9740d950R13), but I think it might be handy to have the second one as well, in case somebody else wants to implement some sort of drill-down functionality in the UI (or some 3rd party plugin).\r\n\r\nPlease let me know what you think and I will rebase my changes and create a PR if you find this feature useful.\r\n"},"comment":{"url":"https://api.github.com/repos/containous/traefik/issues/comments/303111742","html_url":"https://github.com/containous/traefik/issues/1650#issuecomment-303111742","issue_url":"https://api.github.com/repos/containous/traefik/issues/1650","id":303111742,"user":{"login":"timoreimann","id":694826,"avatar_url":"https://avatars2.githubusercontent.com/u/694826?v=3","gravatar_id":"","url":"https://api.github.com/users/timoreimann","html_url":"https://github.com/timoreimann","followers_url":"https://api.github.com/users/timoreimann/followers","following_url":"https://api.github.com/users/timoreimann/following{/other_user}","gists_url":"https://api.github.com/users/timoreimann/gists{/gist_id}","starred_url":"https://api.github.com/users/timoreimann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timoreimann/subscriptions","organizations_url":"https://api.github.com/users/timoreimann/orgs","repos_url":"https://api.github.com/users/timoreimann/repos","events_url":"https://api.github.com/users/timoreimann/events{/privacy}","received_events_url":"https://api.github.com/users/timoreimann/received_events","type":"User","site_admin":false},"created_at":"2017-05-22T14:12:40Z","updated_at":"2017-05-22T14:12:40Z","body":"@mihaitodor in general, Go mutexes are implemented quite efficiently. But you're right that it's still a performance question, something that should likely be measured accurately. Personally, I'm okay with starting with the safe route of coupling to ConnLimits. 👍 \r\n\r\n@emilevauge should have a look on the feature request too."}}
{"actor":{"display_login":"timoreimann"}}