mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
Add counters of nodes with assigned bucket
This commit is contained in:
parent
3b93920fda
commit
e23d296a14
@ -710,6 +710,7 @@ collect_prefixes_ip4_helper(struct aggregator_proto *p, struct net_addr_ip4 *add
|
|||||||
assert(node->bucket != NULL);
|
assert(node->bucket != NULL);
|
||||||
create_route_ip4(p, node->bucket, addr);
|
create_route_ip4(p, node->bucket, addr);
|
||||||
*count += 1;
|
*count += 1;
|
||||||
|
p->leaves++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -718,6 +719,7 @@ collect_prefixes_ip4_helper(struct aggregator_proto *p, struct net_addr_ip4 *add
|
|||||||
{
|
{
|
||||||
create_route_ip4(p, node->bucket, addr);
|
create_route_ip4(p, node->bucket, addr);
|
||||||
*count += 1;
|
*count += 1;
|
||||||
|
p->internal_nodes++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->child[0])
|
if (node->child[0])
|
||||||
@ -746,6 +748,7 @@ collect_prefixes_ip6_helper(struct aggregator_proto *p, struct net_addr_ip6 *add
|
|||||||
assert(node->bucket != NULL);
|
assert(node->bucket != NULL);
|
||||||
create_route_ip6(p, node->bucket, addr);
|
create_route_ip6(p, node->bucket, addr);
|
||||||
*count += 1;
|
*count += 1;
|
||||||
|
p->leaves++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -754,6 +757,7 @@ collect_prefixes_ip6_helper(struct aggregator_proto *p, struct net_addr_ip6 *add
|
|||||||
{
|
{
|
||||||
create_route_ip6(p, node->bucket, addr);
|
create_route_ip6(p, node->bucket, addr);
|
||||||
*count += 1;
|
*count += 1;
|
||||||
|
p->internal_nodes++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->child[0])
|
if (node->child[0])
|
||||||
@ -863,6 +867,8 @@ run_aggregation(struct aggregator_proto *p)
|
|||||||
|
|
||||||
log("%d prefixes before aggregation", p->before_count);
|
log("%d prefixes before aggregation", p->before_count);
|
||||||
log("%d prefixes after aggregation", p->after_count);
|
log("%d prefixes after aggregation", p->after_count);
|
||||||
|
log("%d internal nodes with bucket", p->internal_nodes);
|
||||||
|
log("%d leaves with bucket", p->leaves);
|
||||||
log("==== AGGREGATION DONE ====");
|
log("==== AGGREGATION DONE ====");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -906,6 +912,8 @@ aggregate_on_feed_end(struct channel *C)
|
|||||||
p->root = NULL;
|
p->root = NULL;
|
||||||
p->before_count = 0;
|
p->before_count = 0;
|
||||||
p->after_count = 0;
|
p->after_count = 0;
|
||||||
|
p->internal_nodes = 0;
|
||||||
|
p->leaves = 0;
|
||||||
|
|
||||||
if (p->first_run)
|
if (p->first_run)
|
||||||
p->first_run = 0;
|
p->first_run = 0;
|
||||||
@ -1678,6 +1686,8 @@ aggregator_cleanup(struct proto *P)
|
|||||||
|
|
||||||
p->before_count = 0;
|
p->before_count = 0;
|
||||||
p->after_count = 0;
|
p->after_count = 0;
|
||||||
|
p->internal_nodes = 0;
|
||||||
|
p->leaves = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -81,6 +81,8 @@ struct aggregator_proto {
|
|||||||
struct settle notify_settle;
|
struct settle notify_settle;
|
||||||
int before_count;
|
int before_count;
|
||||||
int after_count;
|
int after_count;
|
||||||
|
int internal_nodes;
|
||||||
|
int leaves;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum aggr_item_type {
|
enum aggr_item_type {
|
||||||
|
Loading…
Reference in New Issue
Block a user