Improve API calls for Top Clients and Forward Destinations #253

Merged
merged 13 commits into from Dec 23, 2016

Projects

None yet

3 participants

@DL6ER
Member
DL6ER commented Dec 15, 2016 edited

Changes proposed in this pull request:

  • Try to resolve client and upstream DNS server IPs to host names if corresponding settings are true

Upstream DNS servers: API_GET_UPSTREAM_DNS_HOSTNAME
Clients: API_GET_CLIENT_HOSTNAME

  • General speed improvements

http://pi.hole/admin/api.php?getForwardDestinations
devel: 5.8s
this PR: 3.3s

http://pi.hole/admin/api.php?getQuerySources
devel: 15.6s
this PR: 4.6s

@pi-hole/dashboard

@DL6ER DL6ER Try to resolve local IPs to hostnames if API_GET_CLIENT_HOSTNAME is true
f14b474
@DL6ER DL6ER added the Enhancement label Dec 15, 2016
@DL6ER DL6ER changed the title from Resolve client IPs to hostnames to [WIP] Improve API calls for Top Lists, Top Clients and Forward Destinations Dec 15, 2016
DL6ER added some commits Dec 15, 2016
@DL6ER DL6ER Implemented function resolveIPs(&$array) 90bc298
@DL6ER DL6ER Improved function getForwardDestinations() 433b3c6
@DL6ER DL6ER Add API_GET_UPSTREAM_DNS_HOSTNAME option
b6adeb5
@DL6ER DL6ER changed the title from [WIP] Improve API calls for Top Lists, Top Clients and Forward Destinations to [WIP] Improve API calls for Top Clients and Forward Destinations Dec 15, 2016
@DL6ER DL6ER Implemented the corresponding Settings part
cc7b03d
@DL6ER DL6ER added a commit to pi-hole/pi-hole that referenced this pull request Dec 15, 2016
@DL6ER DL6ER Implement backend for pi-hole/AdminLTE#253 afabb59
@DL6ER DL6ER referenced this pull request in pi-hole/pi-hole Dec 15, 2016
Merged

Implement backend for AdminLTE/#253 #989

6 of 6 tasks complete
@DL6ER DL6ER codacy fix: added missing `global` statements
41f3a80
@DL6ER DL6ER added this to the v2.1 milestone Dec 16, 2016
DL6ER added some commits Dec 17, 2016
@DL6ER DL6ER Pass pointer to variable to function istrue() to prevent "undefined v…
…ariable" errors
5cda21d
@DL6ER DL6ER Use $value instead of $array[$key] 04c1fed
@DL6ER DL6ER Refined function resolveIPs(&$array). It's now faster, cleaner and mo…
…re readable
a0b4083
@Mcat12
Member
Mcat12 commented Dec 20, 2016

Will this add lots of extra queries to the log?

@DL6ER
Member
DL6ER commented Dec 21, 2016 edited

It will add (max) 10+2 PTR requests each time. However, we will exclude [PTR] from being show in the query log in the future.

DL6ER added some commits Dec 21, 2016
@DL6ER DL6ER Merge branch 'devel' into clienthosts
40edcf6
@DL6ER DL6ER Only look for query[A, i.e. query[A] and query[AAAA] dfa2f07
@DL6ER DL6ER Change from getDnsQueriesAll($log) to getDnsQueries($log). Don't have…
… to check if the line includes "query" since we only collect "query" lines now
ad5f111
@DL6ER DL6ER changed the title from [WIP] Improve API calls for Top Clients and Forward Destinations to Improve API calls for Top Clients and Forward Destinations Dec 22, 2016
@DL6ER DL6ER Merge branch 'devel' into clienthosts
Conflicts:
	data.php
41cd382
@PromoFaux
Member

Hmmm, something in this PR set my PIHOLE_DNS_2 to none

I thought that was fixed in devel?

@PromoFaux
Member
PromoFaux commented Dec 23, 2016 edited

Approved

Approved with PullApprove

@PromoFaux PromoFaux merged commit f92d138 into devel Dec 23, 2016

3 checks passed

codacy/pr Good work! A positive pull request.
Details
code-review/pullapprove Approved by DL6ER, PromoFaux
Details
licence/cla Contributor License Agreement is signed.
Details
@PromoFaux PromoFaux deleted the clienthosts branch Dec 23, 2016
@DL6ER
Member
DL6ER commented Dec 23, 2016

Hmmm, something in this PR set my PIHOLE_DNS_2 to none
I thought that was fixed in devel?

Yes, I guess the branch was not up-to-date with devel. Should anyhow not cause problems when merged.

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