It is licensed by interfaces. It is made per interface connection, eg. intf1->intf2, intf1->intf3 is 2 interfaces even though it's really just getting data from intf1
This is how it counts them as shown in the code snippet below:
{ '$match' => {
'in_if' => { '$ne' => '*' },
'out_if' => { '$ne' => '*' },
'admin_status' => 'active'
}},
{ '$group' => {
_id => '$agent',
'in_if' => { '$addToSet' => '$in_if' },
'out_if' => { '$addToSet' => '$out_if'}
}},
{ '$project' => {
_id => 1,
interfaces => { '$setUnion' => [ '$in_if','$out_if' ] }
}},
{ '$project' => {
_id => 1,
'nrintfs' => { '$size' => '$interfaces'}
}},
{ '$group' => {
_id => undef,
'totalintfs' => { '$sum' => '$nrintfs'}
}},