View | Details | Raw Unified | Return to bug 1277 | Differences between
and this patch

Collapse All | Expand All

(-)b/daemon/remote.c (+2 lines)
 Lines 787-792   print_stats(SSL* ssl, const char* nm, struct ub_stats_info* s) Link Here 
787
		(unsigned long)s->svr.num_queries)) return 0;
787
		(unsigned long)s->svr.num_queries)) return 0;
788
	if(!ssl_printf(ssl, "%s.num.queries_ip_ratelimited"SQ"%lu\n", nm,
788
	if(!ssl_printf(ssl, "%s.num.queries_ip_ratelimited"SQ"%lu\n", nm,
789
		(unsigned long)s->svr.num_queries_ip_ratelimited)) return 0;
789
		(unsigned long)s->svr.num_queries_ip_ratelimited)) return 0;
790
	if(!ssl_printf(ssl, "%s.num.queries_ratelimited"SQ"%lu\n", nm,
791
		(unsigned long)s->svr.num_queries_ratelimited)) return 0;
790
	if(!ssl_printf(ssl, "%s.num.cachehits"SQ"%lu\n", nm, 
792
	if(!ssl_printf(ssl, "%s.num.cachehits"SQ"%lu\n", nm, 
791
		(unsigned long)(s->svr.num_queries 
793
		(unsigned long)(s->svr.num_queries 
792
			- s->svr.num_queries_missed_cache))) return 0;
794
			- s->svr.num_queries_missed_cache))) return 0;
(-)b/daemon/stats.c (-2 / +4 lines)
 Lines 103-115   void server_stats_log(struct ub_server_stats* stats, struct worker* worker, Link Here 
103
{
103
{
104
	log_info("server stats for thread %d: %u queries, "
104
	log_info("server stats for thread %d: %u queries, "
105
		"%u answers from cache, %u recursions, %u prefetch, %u rejected by "
105
		"%u answers from cache, %u recursions, %u prefetch, %u rejected by "
106
		"ip ratelimiting",
106
		"ip ratelimiting, %u rejected by ratelimiting",
107
		threadnum, (unsigned)stats->num_queries, 
107
		threadnum, (unsigned)stats->num_queries, 
108
		(unsigned)(stats->num_queries - 
108
		(unsigned)(stats->num_queries - 
109
			stats->num_queries_missed_cache),
109
			stats->num_queries_missed_cache),
110
		(unsigned)stats->num_queries_missed_cache,
110
		(unsigned)stats->num_queries_missed_cache,
111
		(unsigned)stats->num_queries_prefetch,
111
		(unsigned)stats->num_queries_prefetch,
112
		(unsigned)stats->num_queries_ip_ratelimited);
112
		(unsigned)stats->num_queries_ip_ratelimited,
113
		(unsigned)stats->num_queries_ratelimited);
113
	log_info("server stats for thread %d: requestlist max %u avg %g "
114
	log_info("server stats for thread %d: requestlist max %u avg %g "
114
		"exceeded %u jostled %u", threadnum,
115
		"exceeded %u jostled %u", threadnum,
115
		(unsigned)stats->max_query_list_size,
116
		(unsigned)stats->max_query_list_size,
 Lines 230-235   void server_stats_add(struct ub_stats_info* total, struct ub_stats_info* a) Link Here 
230
{
231
{
231
	total->svr.num_queries += a->svr.num_queries;
232
	total->svr.num_queries += a->svr.num_queries;
232
	total->svr.num_queries_ip_ratelimited += a->svr.num_queries_ip_ratelimited;
233
	total->svr.num_queries_ip_ratelimited += a->svr.num_queries_ip_ratelimited;
234
	total->svr.num_queries_ratelimited += a->svr.num_queries_ratelimited;
233
	total->svr.num_queries_missed_cache += a->svr.num_queries_missed_cache;
235
	total->svr.num_queries_missed_cache += a->svr.num_queries_missed_cache;
234
	total->svr.num_queries_prefetch += a->svr.num_queries_prefetch;
236
	total->svr.num_queries_prefetch += a->svr.num_queries_prefetch;
235
	total->svr.sum_query_list_size += a->svr.sum_query_list_size;
237
	total->svr.sum_query_list_size += a->svr.sum_query_list_size;
(-)b/iterator/iterator.c (+4 lines)
 Lines 1279-1284   processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq, Link Here 
1279
				log_nametypeclass(VERB_ALGO, "ratelimit exceeded with "
1279
				log_nametypeclass(VERB_ALGO, "ratelimit exceeded with "
1280
					"delegation point", iq->dp->name,
1280
					"delegation point", iq->dp->name,
1281
					LDNS_RR_TYPE_NS, LDNS_RR_CLASS_IN);
1281
					LDNS_RR_TYPE_NS, LDNS_RR_CLASS_IN);
1282
				if(qstate->env->worker)
1283
					qstate->env->worker->stats.num_queries_ratelimited++;
1282
				return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
1284
				return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
1283
			}
1285
			}
1284
		}
1286
		}
 Lines 2065-2070   processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq, Link Here 
2065
		if(!infra_ratelimit_inc(qstate->env->infra_cache, iq->dp->name,
2067
		if(!infra_ratelimit_inc(qstate->env->infra_cache, iq->dp->name,
2066
			iq->dp->namelen, *qstate->env->now)) {
2068
			iq->dp->namelen, *qstate->env->now)) {
2067
			verbose(VERB_ALGO, "query exceeded ratelimits");
2069
			verbose(VERB_ALGO, "query exceeded ratelimits");
2070
			if(qstate->env->worker)
2071
				qstate->env->worker->stats.num_queries_ratelimited++;
2068
			return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
2072
			return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
2069
		}
2073
		}
2070
	}
2074
	}
(-)b/iterator/iterator.h (+1 lines)
 Lines 45-50    Link Here 
45
#include "services/outbound_list.h"
45
#include "services/outbound_list.h"
46
#include "util/data/msgreply.h"
46
#include "util/data/msgreply.h"
47
#include "util/module.h"
47
#include "util/module.h"
48
#include "daemon/worker.h"
48
struct delegpt;
49
struct delegpt;
49
struct iter_hints;
50
struct iter_hints;
50
struct iter_forwards;
51
struct iter_forwards;
(-)b/libunbound/unbound.h (+2 lines)
 Lines 642-647   struct ub_server_stats { Link Here 
642
	long long num_queries;
642
	long long num_queries;
643
	/** number of queries that have been dropped/ratelimited by ip. */
643
	/** number of queries that have been dropped/ratelimited by ip. */
644
	long long num_queries_ip_ratelimited;
644
	long long num_queries_ip_ratelimited;
645
	/** number of queries that have been ratelimited by domain recursion. */
646
	long long num_queries_ratelimited;
645
	/** number of queries that had a cache-miss. */
647
	/** number of queries that had a cache-miss. */
646
	long long num_queries_missed_cache;
648
	long long num_queries_missed_cache;
647
	/** number of prefetch queries - cachehits with prefetch */
649
	/** number of prefetch queries - cachehits with prefetch */
(-)b/smallapp/unbound-control.c (-1 / +3 lines)
 Lines 193-200   static void pr_stats(const char* nm, struct ub_stats_info* s) Link Here 
193
{
193
{
194
	struct timeval sumwait, avg;
194
	struct timeval sumwait, avg;
195
	PR_UL_NM("num.queries", s->svr.num_queries);
195
	PR_UL_NM("num.queries", s->svr.num_queries);
196
	PR_UL_NM("num.queries_ip_ratelimited", 
196
	PR_UL_NM("num.queries_ip_ratelimited",
197
		s->svr.num_queries_ip_ratelimited);
197
		s->svr.num_queries_ip_ratelimited);
198
	PR_UL_NM("num.queries_ratelimited",
199
		s->svr.num_queries_ratelimited);
198
	PR_UL_NM("num.cachehits",
200
	PR_UL_NM("num.cachehits",
199
		s->svr.num_queries - s->svr.num_queries_missed_cache);
201
		s->svr.num_queries - s->svr.num_queries_missed_cache);
200
	PR_UL_NM("num.cachemiss", s->svr.num_queries_missed_cache);
202
	PR_UL_NM("num.cachemiss", s->svr.num_queries_missed_cache);

Return to bug 1277