mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
* stub in poetry for pipenv * re-add tester image * add pre-commit / formatting * fix ghactions * revert test data whitespace, exclude tests/data * revert ws * decruft, rm tox/pipenv * install dev packages for base image * add lgtm config to force to py3
27 lines
765 B
Python
27 lines
765 B
Python
"""
|
|
load and maintain global stats
|
|
"""
|
|
|
|
from peeringdb_server.models import (
|
|
Facility,
|
|
InternetExchange,
|
|
Network,
|
|
NetworkFacility,
|
|
NetworkIXLan,
|
|
)
|
|
|
|
|
|
def stats():
|
|
return {
|
|
Network.handleref.tag: Network.handleref.filter(status="ok").count(),
|
|
InternetExchange.handleref.tag: InternetExchange.handleref.filter(
|
|
status="ok"
|
|
).count(),
|
|
Facility.handleref.tag: Facility.handleref.filter(status="ok").count(),
|
|
NetworkIXLan.handleref.tag: NetworkIXLan.handleref.filter(status="ok").count(),
|
|
NetworkFacility.handleref.tag: NetworkFacility.handleref.filter(
|
|
status="ok"
|
|
).count(),
|
|
"automated_nets": Network.handleref.filter(allow_ixp_update=True).count(),
|
|
}
|