Switch globalpromstats worker to use a data interface
This commit is contained in:
parent
0629a13da2
commit
8e179cb865
3 changed files with 50 additions and 5 deletions
27
workers/globalpromstats/models_interface.py
Normal file
27
workers/globalpromstats/models_interface.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from abc import ABCMeta, abstractmethod
|
||||
from six import add_metaclass
|
||||
|
||||
@add_metaclass(ABCMeta)
|
||||
class GlobalPromStatsWorkerDataInterface(object):
|
||||
"""
|
||||
Interface that represents all data store interactions required by the global prom stats worker.
|
||||
"""
|
||||
@abstractmethod
|
||||
def get_repository_count(self):
|
||||
""" Returns the number of repositories in the database. """
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_active_user_count(self):
|
||||
""" Returns the number of active users in the database. """
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_active_org_count(self):
|
||||
""" Returns the number of active organizations in the database. """
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_robot_count(self):
|
||||
""" Returns the number of robots in the database. """
|
||||
pass
|
Reference in a new issue