Skip to content

Commit

Permalink
Add subnets instead of IPs to bench more code
Browse files Browse the repository at this point in the history
  • Loading branch information
gmjosack committed Jan 23, 2015
1 parent 4708ac2 commit dcdc6c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def test_create_1024(session, admin, site):
uid = admin.id
sid = site.id

address = u"10.0.0.0/22"
address = u"10.0.0.0/20"
models.Network.create(session, uid, sid, address)
models.Attribute.create(session, uid, resource_name="Network", site_id=sid, name="aaaa")

start = time.time()
network = ipaddress.ip_network(address)
for ip in network.hosts():
for ip in network.subnets(new_prefix=30):
models.Network.create(session, uid, sid, ip.exploded, {
"aaaa": "value",
})
Expand Down

0 comments on commit dcdc6c9

Please sign in to comment.