Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions metrics_utility/anonymized_rollups/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
load_anonymized_rollup_data,
)
from .base_anonymized_rollup import BaseAnonymizedRollup
from .compute_anonymized_rollup import compute_anonymized_rollup
from .events_modules_anonymized_rollup import EventModulesAnonymizedRollup
from .execution_environments_anonymized_rollup import ExecutionEnvironmentsAnonymizedRollup
from .helpers import sanitize_json
Expand All @@ -23,6 +24,7 @@
'JobsAnonymizedRollup',
'anonymize_data',
'anonymize_rollups',
'compute_anonymized_rollup',
'compute_anonymized_rollup_from_raw_data',
'create_anonymized_object',
'flatten_json_report',
Expand Down
39 changes: 33 additions & 6 deletions metrics_utility/anonymized_rollups/compute_anonymized_rollup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
from metrics_utility.anonymized_rollups.anonymized_rollups import compute_anonymized_rollup_from_raw_data
from metrics_utility.anonymized_rollups.anonymized_rollups import (
compute_anonymized_rollup_from_raw_data,
)

# from metrics_utility.test.util import run_gather_int
from metrics_utility.library.collectors.controller import execution_environments, job_host_summary_service, main_jobevent_service, unified_jobs
from metrics_utility.library.collectors.controller import (
execution_environments,
job_host_summary_service,
main_jobevent_service,
unified_jobs,
)
from metrics_utility.logger import logger


def compute_anonymized_rollup(db, salt, since, until, ship_path, save_rollups: bool = True):
# This will contain list of files that belongs to particular collector
execution_environments_data = execution_environments(db=db).gather()
unified_jobs_data = unified_jobs(db=db, since=since, until=until).gather()
job_host_summary_data = job_host_summary_service(db=db, since=since, until=until).gather()
main_jobevent_data = main_jobevent_service(db=db, since=since, until=until).gather()
execution_environments_data = []
try:
execution_environments_data = execution_environments(db=db).gather()
except Exception as e:
logger.error(f'Failed to gather execution_environments data: {e}')

unified_jobs_data = []
try:
unified_jobs_data = unified_jobs(db=db, since=since, until=until).gather()
except Exception as e:
logger.error(f'Failed to gather unified_jobs data: {e}')

job_host_summary_data = []
try:
job_host_summary_data = job_host_summary_service(db=db, since=since, until=until).gather()
except Exception as e:
logger.error(f'Failed to gather job_host_summary data: {e}')

main_jobevent_data = []
try:
main_jobevent_data = main_jobevent_service(db=db, since=since, until=until).gather()
except Exception as e:
logger.error(f'Failed to gather main_jobevent data: {e}')

input_data = {
'execution_environments': execution_environments_data,
Expand Down