diff --git a/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py b/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py index 4f19f701c..8742adbf9 100644 --- a/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py +++ b/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py @@ -12,17 +12,16 @@ # See the Mulan PSL v2 for more details. alpha = 1e-10 +#Define a minimum number of errors +#function name: detect +#description: Calculate whether the data has abrupt changes based on the average value +#arguments: data1, data2, threshold,method +#return value: bool +#date: 2022/8/ +#contact: 1865997821 def detect(data1, data2, threshold=0.5, method='bool'): - """ - Calculate whether the data has abrupt changes based on the average value - :param data1: input data array - :param data2: input data array - :param threshold: Mutation rate - :param method: The way to calculate the mutation - :return: bool - """ if not isinstance(data1, list) or not isinstance(data2, list): raise TypeError("The format of the input data is wrong.") avg1 = sum(data1) / len(data1) if data1 else 0