From a758d2013b4a7ae13f96aff3fef25649ac5b0d70 Mon Sep 17 00:00:00 2001 From: Tatiana Korchuganova Date: Fri, 15 Nov 2024 10:34:35 +0100 Subject: [PATCH 1/3] errorSummary | clean up --- core/pandajob/summary_error.py | 46 ---------------------------------- 1 file changed, 46 deletions(-) diff --git a/core/pandajob/summary_error.py b/core/pandajob/summary_error.py index 0e71071a..1bd1f74c 100644 --- a/core/pandajob/summary_error.py +++ b/core/pandajob/summary_error.py @@ -418,52 +418,6 @@ def errorSummaryDict(jobs, is_test_jobs=False, sortby='count', is_user_req=False return errsByCountL, errsBySiteL, errsByUserL, errsByTaskL, suml, error_histograms -def get_job_error_categories(job): - """ - Get shortened error category string by error field and error code - :param job: dict, name of error field - :return: error_category_list: list of str, shortened error category string - """ - error_category_list = [] - for k in list(const.JOB_ERROR_CATEGORIES): - if k['error'] in job and job[k['error']] is not None and job[k['error']] != '' and int(job[k['error']]) > 0: - error_category_list.append(f'{k['name']}:{job[k['error']]}') - - return error_category_list - - -def prepare_binned_and_total_data(df, column): - # resample in 10-minute bins and count occurrences for each unique value in the specified column - resampled = df.groupby([pd.Grouper(freq='10T'), column]).size().unstack(fill_value=0) - - # calculate total counts across all bins for pie chart - total_counts = resampled.sum().to_dict() - - # convert binned data to Chart.js format - header = ["timestamp"] + list(resampled.columns) - binned_data = [header] + [[timestamp.strftime(settings.DATETIME_FORMAT)] + list(row) for timestamp, row in resampled.iterrows()] - - return { - 'binned': binned_data, - 'total': total_counts - } - - -def categorize_low_impact_by_percentage(df, column, threshold_percent): - # Count occurrences of each unique value across the entire dataset - counts = df[column].value_counts() - total_count = counts.sum() - - # Calculate threshold in terms of counts - threshold_count = total_count * (threshold_percent / 100.0) - - # Identify low-impact values below this threshold - low_impact_values = counts[counts < threshold_count].index - - # Replace low-impact values with "Other" - df[column] = df[column].apply(lambda x: "Other" if x in low_impact_values else x) - return df - def build_error_histograms(jobs): """ Prepare histograms data by different categories From 6318a36b27e15172faf1c30bc1d816f98e155caa Mon Sep 17 00:00:00 2001 From: Tatiana Korchuganova Date: Tue, 19 Nov 2024 10:23:15 +0100 Subject: [PATCH 2/3] core | add framework column to JediTask model --- core/common/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/common/models.py b/core/common/models.py index 58394bf7..211d5d95 100644 --- a/core/common/models.py +++ b/core/common/models.py @@ -309,6 +309,7 @@ class JediTasksBase(models.Model): memoryleakcore = models.BigIntegerField(null=True, db_column='memory_leak_core', blank=True) memoryleakx2 = models.BigIntegerField(null=True, db_column='memory_leak_x2', blank=True) modificationtime = models.DateTimeField(db_column='realmodificationtime') + framework = models.CharField(max_length=100, db_column='framework', blank=True) def get_fields_by_type(self, ftype='integer'): field_list = [str(f.name) for f in self._meta.fields if ftype in str(f.description).lower()] From 7c488e4c1407821668cb4b413860a66e305fd43d Mon Sep 17 00:00:00 2001 From: Tatiana Korchuganova Date: Tue, 19 Nov 2024 12:01:13 +0100 Subject: [PATCH 3/3] core | fix wildcards if no actual str specified, just * --- core/libs/sqlcustom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/libs/sqlcustom.py b/core/libs/sqlcustom.py index dc701c0f..6da2c241 100644 --- a/core/libs/sqlcustom.py +++ b/core/libs/sqlcustom.py @@ -64,7 +64,7 @@ def preprocess_wild_card_string(strToProcess, fieldToLookAt, **kwargs): for parameter in cardParametersRaw: leadStar = False trailStar = False - if len(parameter) > 0: + if currentParCount < countParameters - 1: if currentParCount - 1 >= 0: leadStar = True