Skip to content

Commit

Permalink
server: api metrics add vulnsearch counts
Browse files Browse the repository at this point in the history
  • Loading branch information
bodik committed Oct 28, 2023
1 parent e136be2 commit df8c54b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sner/server/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sner.server.extensions import db

from sner.server.scheduler.models import Heatmap, Job, Queue, Readynet, Target
from sner.server.storage.models import Host, Note, Service, Vuln, VersionInfo
from sner.server.storage.models import Host, Note, Service, VersionInfo, Vuln, Vulnsearch


def get_metrics():
Expand All @@ -23,6 +23,7 @@ def get_metrics():
metrics['sner_storage_vulns_total'] = Vuln.query.count()
metrics['sner_storage_notes_total'] = Note.query.count()
metrics['sner_storage_versioninfo_total'] = VersionInfo.query.count()
metrics['sner_storage_vulnsearch_total'] = Vulnsearch.query.count()

queue_targets = db.session.query(Queue.name, func.count(Target.id).label('cnt')).select_from(Queue).outerjoin(Target).group_by(Queue.name).all()
for queue, targets in queue_targets:
Expand Down

0 comments on commit df8c54b

Please sign in to comment.