Пример #1
0
 def get_test_details(self):
     test_details = {}
     test_details['sct_git_commit'] = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip()
     test_details['job_name'] = get_job_name()
     test_details['job_url'] = os.environ.get('BUILD_URL', '')
     test_details['start_host'] = platform.node()
     test_details['test_duration'] = self.params.get(key='test_duration', default=60)
     test_details['start_time'] = time.time()
     test_details['grafana_snapshot'] = ""
     return test_details
Пример #2
0
 def get_test_details(self):
     test_details = {}
     test_details['sct_git_commit'] = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip()
     test_details['job_name'] = get_job_name()
     test_details['job_url'] = os.environ.get('BUILD_URL', '')
     test_details['start_host'] = platform.node()
     test_details['test_duration'] = self.params.get(key='test_duration', default=60)
     test_details['start_time'] = time.time()
     test_details['grafana_snapshot'] = ""
     test_details['prometheus_report'] = ""
     return test_details
    def get_test_details(self):
        # avoid cyclic-decencies between cluster and db_stats
        from sdcm.cluster import Setup

        test_details = {}
        test_details['sct_git_commit'] = subprocess.check_output(
            ['git', 'rev-parse', 'HEAD']).strip()
        test_details['job_name'] = get_job_name()
        test_details['job_url'] = os.environ.get('BUILD_URL', '')
        test_details['start_host'] = platform.node()
        test_details['test_duration'] = self.params.get(key='test_duration',
                                                        default=60)
        test_details['start_time'] = time.time()
        test_details['grafana_snapshot'] = []
        test_details['prometheus_data'] = ""
        test_details['test_id'] = Setup.test_id()
        test_details['log_files'] = {}
        return test_details
Пример #4
0
# -*- coding: utf-8 -*-
"""
Created on Dec 7th 2020

@author: Benson.Chen [email protected]
"""

from handlers.haozu import Haozu
from handlers.db import ODBC, get_sql_list
from jobs import keys
from utils import TIME, PATH, DB, Email, get_job_name

PATH['SITE'] = 'haozu'
PATH['LOG_PATH'] = PATH['LOG_DIR'] + '\\' + get_job_name() + '.log'
DB['DETAIL_TABLE'] = 'Scrapy_' + PATH['SITE']
DB['INFO_TABLE'] = 'Scrapy_' + PATH['SITE'] + '_Info'

with ODBC(config=keys.dbconfig_mkt) as exist_db:
    condition_done = '[Timestamp] >= {0} AND [Source] = {1}'\
        .format(get_sql_list(TIME['TODAY']), get_sql_list(PATH['SITE']))
    entities_run = exist_db.get_to_runs(table_name=DB['LOG_TABLE_NAME'],
                                        condition=condition_done,
                                        source=PATH['SITE'])

for entity in entities_run:
    entity_object = Haozu(entity)
    entity_object.run()

    with ODBC(config=keys.dbconfig_mkt) as entity_db:
        entity_db.upload(df=entity_object.df['df'],
                         table_name=DB['DETAIL_TABLE'],