From 8be464ec9ca38ca3dcf66a00754798f85bfb045a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=96=87=E6=B3=A2?= <1010589661@qq.com> Date: Tue, 22 Apr 2025 19:51:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E5=BC=80=E5=8F=91=E8=87=AA?= =?UTF-8?q?=E6=8F=90=E3=80=91=E3=80=90mstt=E3=80=91mstx2commop=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=9C=80=E6=96=B0=E7=9A=84db=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recipes/mstx2commop/mstx2commop.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py b/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py index 6ca80230a..daba502ef 100644 --- a/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py +++ b/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +import json import os import pandas as pd @@ -82,13 +82,11 @@ class Mstx2Commop(BaseRecipeAnalysis): logger.warning(f"There is no stats data in {profiler_db_path}.") return None - df['value_list'] = df['value'].apply(lambda x: x.split(',')) - df['value_list_len'] = df['value_list'].apply(len) - df = df[df['value_list_len'] == 4] - df['opType_primal'] = df['value_list'].apply(lambda x: 'hcom_' + x[0][9:] + '_') - df['groupName_primal'] = df['value_list'].apply(lambda x: x[1]) - df['dataType'] = df['value_list'].apply(lambda x: x[2]) - df['count'] = df['value_list'].apply(lambda x: x[3]) + df['value'] = df['value'].apply(lambda x: json.load(x)) + df['opType_primal'] = df['value'].apply(lambda x: x['opName'] + '_') + df['groupName_primal'] = df['value'].apply(lambda x: x['groupName']) + df['dataType'] = df['value'].apply(lambda x: x['dataType']) + df['count'] = df['value'].apply(lambda x: x['count']) df['groupName_hash'] = df['groupName_primal'].apply(double_hash).apply(str) -- Gitee From 3fe1d801b4c95eacda78fda1c3d43eca92214bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=96=87=E6=B3=A2?= <1010589661@qq.com> Date: Thu, 24 Apr 2025 14:31:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E5=BC=80=E5=8F=91=E8=87=AA?= =?UTF-8?q?=E6=8F=90=E3=80=91=E3=80=90mstt=E3=80=91mstx2commop=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=9C=80=E6=96=B0=E7=9A=84db=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cluster_analyse/recipes/mstx2commop/mstx2commop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py b/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py index daba502ef..edc654992 100644 --- a/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py +++ b/profiler/msprof_analyze/cluster_analyse/recipes/mstx2commop/mstx2commop.py @@ -82,7 +82,7 @@ class Mstx2Commop(BaseRecipeAnalysis): logger.warning(f"There is no stats data in {profiler_db_path}.") return None - df['value'] = df['value'].apply(lambda x: json.load(x)) + df['value'] = df['value'].apply(lambda x: json.loads(x)) df['opType_primal'] = df['value'].apply(lambda x: x['opName'] + '_') df['groupName_primal'] = df['value'].apply(lambda x: x['groupName']) df['dataType'] = df['value'].apply(lambda x: x['dataType']) -- Gitee