Quantifying data saved

Hi folks :slight_smile:

I am currently working on extending pi hole as a project. Its not massive what I am looking to do I don't believe its more of an excersise of the workflow of compiling a custom version.

I have ran into a snag though that is entirely due to my inexperience and I was told posting in the community might get some positive results!

I am looking at using the total amount of queries in the last x interval and performing a calculation on this - Basically so the PiHole can quantify the amount of data that is saved (from binning queries only - I dont think I can predict how big the data would be from a sucessfull query).

I have an idea of how this would look in terms of modifying the adminLTE php/html to display a neat new box for the new statistic however what I cant figure out is where the index.php pulls the data from that populates the 4 stats of total queries, percentage blocked etc. My ideal solution would be to take the accurate size of each query from the packet as I have seen them appear in wireguard for each query however again, newbie. My initial goal is to get a simple one going to start with using some presumed parameters(query length).

I have spent some time scouring the code and am thinking it might be in index.js where i do this however being a newbie I'm having a lot of difficulty understanding the codebase.

Thanks for taking the time to read my problem
-Jayde :slight_smile:

You already have the amount of blocked queries for x=24 hours.
That value is immutable, unless you are willing to compile Pi-hole for yourself.

However, multiplying that number of blocked queries by any arbitrary value to arrive at a byte sized value wouldn't produce any meaningful statistics.

How much data is actually saved isn't influenced by DNS traffic (the DNS query is happening anyhow, whether it is blocked or not), but by other factors like the frequency of elements referring to the same domain in an HTML page or the size of the resources that would have been accessed by those elements - and all of those factors require client-side knowledge, which Pi-hole as a server will never be able to know.

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