| |
@@ -30,6 +30,7 @@
|
| |
from coprs.models import BuildChroot
|
| |
from .coprs_logic import MockChrootsLogic
|
| |
from coprs.logic.packages_logic import PackagesLogic
|
| |
+ from coprs.logic.stat_logic import CounterStatLogic
|
| |
|
| |
log = app.logger
|
| |
|
| |
@@ -169,7 +170,7 @@
|
| |
@classmethod
|
| |
def get_task_graph_data(cls, type):
|
| |
data = [["pending"], ["running"], ["avg running"], ["time"]]
|
| |
- params = cls.get_graph_parameters(type)
|
| |
+ params = CounterStatLogic.get_graph_parameters(type)
|
| |
cached_data = cls.get_cached_graph_data(params)
|
| |
data[0].extend(cached_data["pending"])
|
| |
data[1].extend(cached_data["running"])
|
| |
@@ -197,7 +198,7 @@
|
| |
@classmethod
|
| |
def get_small_graph_data(cls, type):
|
| |
data = [[""]]
|
| |
- params = cls.get_graph_parameters(type)
|
| |
+ params = CounterStatLogic.get_graph_parameters(type)
|
| |
cached_data = cls.get_cached_graph_data(params)
|
| |
data[0].extend(cached_data["running"])
|
| |
|
| |
@@ -231,33 +232,6 @@
|
| |
db.session.rollback()
|
| |
|
| |
@classmethod
|
| |
- def get_graph_parameters(cls, type):
|
| |
- if type is "10min":
|
| |
- # 24 hours with 10 minute intervals
|
| |
- step = 600
|
| |
- steps = 144
|
| |
- elif type is "30min":
|
| |
- # 24 hours with 30 minute intervals
|
| |
- step = 1800
|
| |
- steps = 48
|
| |
- elif type is "24h":
|
| |
- # 90 days with 24 hour intervals
|
| |
- step = 86400
|
| |
- steps = 90
|
| |
-
|
| |
- end = int(time.time())
|
| |
- end = end - (end % step) # align graph interval to a multiple of step
|
| |
- start = end - (steps * step)
|
| |
-
|
| |
- return {
|
| |
- "type": type,
|
| |
- "step": step,
|
| |
- "steps": steps,
|
| |
- "start": start,
|
| |
- "end": end,
|
| |
- }
|
| |
-
|
| |
- @classmethod
|
| |
def get_build_importing_queue(cls, background=None):
|
| |
"""
|
| |
Returns Builds which are waiting to be uploaded to dist git
|
| |
Here I add actions to graphs on /status/stats, soon I will add here a description of what are builds and actions.