-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Limit number of clients returned by /api/history/clients #1832
Conversation
… to 20. This can be overwritten at compile-time and at run-time using the query parameter ?N=... Signed-off-by: DL6ER <[email protected]>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-for-a-lot-of-ipv6-clients/66987/7 |
…id possible overflows for very large N and add N=0 as special option to return all clients (even if the user does not know how many there are) Signed-off-by: DL6ER <[email protected]>
Could you implement a "all-other-clients" client with the sum of all their queries for every client exceeding |
…as not been included due to more clients being active than being returned (due to limited N) Signed-off-by: DL6ER <[email protected]>
… at the border of being still readable Signed-off-by: DL6ER <[email protected]>
Thanks for the suggestion. I added this and also reduced the default |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: DL6ER <[email protected]>
Conflicts have been resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected, but I have a wish and one point for discussion.
-
Can we make this a config option -> users can set whatever N they want for their web interface to be displayed
-
Now we limit to the most active overall clients. However, the issue we want to solve is: to many clients per time slot (rendering the graph useless). Imagine a situation where we have only 10 clients in the morning and 10 different clients in the afternoon (each within one time slot). Despite both not exceeding N on per-timeslot basis, 10 of them will be removed. How about (I know, much more code) to limit the number of clients returned on per-timeslot basis with a lower N (e.g. 3-5)
… to be returned for the client activity graph. This setting can be overwritten at run-time Signed-off-by: DL6ER <[email protected]>
Sorry, I missed your comment before.
Yes, I did just add this.
I think this will reintroduce part of the problem - even when N is further reduces. We have 240 timeslots in 24 hours, even with N = 3, this is close to 1000. But even when this is surely worst-case thinking, I guess we will get massive confusion with repeated colors as some of your morning clients (smart coffee maker) may be red until 10AM, then they are replaced by some other component (solar system reporting tool) which got the same red color because if limited colors available. |
Signed-off-by: DL6ER <[email protected]>
I see your valid point. It's a tricky decision. The current implementation can lead to situations where "other clients" is the biggest/only client within a certain timeslot, making it a bit sensless. However, this should not stop this PR. Depending on use feedback we could change it later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit pick: the order in which objects in the json are returned is clients
first, and history
second. In the documentation it's the other way round.
Signed-off-by: DL6ER <[email protected]>
What does this implement/fix?
Limit number of clients returned by the
/api/history/clients
endpoint to 20 (default value).This can be overwritten at compile-time and at run-time using the query parameter
?N=...
Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.