From f5feea787d9ae821793d0bd5a1863850dc64236a Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Fri, 15 Mar 2024 15:24:39 -0500 Subject: [PATCH] chore: restore instructor dashboard chart ids --- .../pythonpath/performance_metrics.py | 10 ++++--- .../dashboards/Instructor_Dashboard.yaml | 28 +++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/performance_metrics.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/performance_metrics.py index e2e064456..45da19870 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/performance_metrics.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/performance_metrics.py @@ -26,11 +26,10 @@ UUID = str(uuid.uuid4())[0:6] RUN_ID = f"aspects-{ASPECTS_VERSION}-{UUID}" -report_format = "{i}. {slice}\n" "Superset time: {superset_time}\n" +report_format = "{i}. {slice}\n" "Superset time: {superset_time} (s).\n" query_format = ( - "-----------------------------------\n" - "Query duration: {query_duration_ms} s.\n" + "Query duration: {query_duration_ms} (s).\n" "Result rows: {result_rows}\n" "Memory Usage (MB): {memory_usage_mb}\n" "Row count (superset) {rowcount:}\n" @@ -85,7 +84,7 @@ def meassure_chart(slice, extra_filters=[]): result = command.run() end_time = datetime.now() - result["time_elapsed"] = "{} s.".format((end_time - start_time).total_seconds()) + result["time_elapsed"] = (end_time - start_time).total_seconds() result["slice"] = slice return result @@ -112,6 +111,9 @@ def get_query_log_from_clickhouse(report): parsed_sql = str(sqlparse.parse(row.pop("query"))[0]) clickhouse_queries[parsed_sql] = row + # Sort report by slowest queries + report = sorted(report, key=lambda x: x["time_elapsed"], reverse=True) + report_str = f"\nSuperset Reports: {RUN_ID}\n\n" for i, result in enumerate(report): report_str+=( diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/dashboards/Instructor_Dashboard.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/dashboards/Instructor_Dashboard.yaml index 60254b554..e88a860a6 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/dashboards/Instructor_Dashboard.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/dashboards/Instructor_Dashboard.yaml @@ -314,7 +314,7 @@ position: children: [] id: CHART-AZZnl_lpMv meta: - chartId: 359 + chartId: 13 height: 50 sliceName: Watches Per Video uuid: 829c1d5b-2844-4115-876a-34ad3b3cad64 @@ -329,7 +329,7 @@ position: children: [] id: CHART-GFCO8s2cxv meta: - chartId: 352 + chartId: 25 height: 50 sliceName: Distribution Of Responses uuid: f1651c44-a8f4-4b44-ad49-962823009319 @@ -344,7 +344,7 @@ position: children: [] id: CHART-GJJ8VYQ03v meta: - chartId: 310 + chartId: 55 height: 50 sliceName: Posts per user uuid: bc191ce7-f39d-48db-86a9-d19949f4211d @@ -359,7 +359,7 @@ position: children: [] id: CHART-Jr-gNVms2Q meta: - chartId: 332 + chartId: 34 height: 50 sliceName: Enrollment Events Per Day uuid: bb1147cc-b7bc-44b7-b06a-79b0db6626aa @@ -374,7 +374,7 @@ position: children: [] id: CHART-OMy4wjRBWt meta: - chartId: 371 + chartId: 45 height: 50 sliceName: Watched Video Segments uuid: 2985a9db-c338-4008-af52-2930b81ee2e5 @@ -389,7 +389,7 @@ position: children: [] id: CHART-RTO33WE9FH meta: - chartId: 339 + chartId: 59 height: 50 sliceName: Responses Per Problem uuid: a3e79162-4ace-4349-ab34-89aa60ae75ed @@ -404,7 +404,7 @@ position: children: [] id: CHART-Tej2oLPBAl meta: - chartId: 410 + chartId: 58 height: 50 sliceName: Transcripts / Captions Per Video uuid: 6b830def-f3ca-4b4c-9455-7a7b7354bce8 @@ -419,7 +419,7 @@ position: children: [] id: CHART-evjVO-ZSSd meta: - chartId: 411 + chartId: 27 height: 50 sliceName: Enrollments By Enrollment Mode uuid: 05ed7102-5464-4e2f-86ae-31700b787cc3 @@ -434,7 +434,7 @@ position: children: [] id: CHART-lTr8DL3XuI meta: - chartId: 307 + chartId: 57 height: 50 sliceName: Distribution Of Hints Per Correct Answer uuid: ee94be4c-6fdd-4295-b43c-40890d6c549d @@ -449,7 +449,7 @@ position: children: [] id: CHART-o56v9yEe2I meta: - chartId: 382 + chartId: 11 height: 50 sliceName: Distribution Of Problem Grades uuid: 4f7e3606-f5de-4643-97c0-bbb6340a3df2 @@ -464,7 +464,7 @@ position: children: [] id: CHART-qG1WaGKl_b meta: - chartId: 395 + chartId: 26 height: 50 sliceName: Distinct forum users uuid: feb323ad-c819-49ca-a336-584bd9ff1a2e @@ -479,7 +479,7 @@ position: children: [] id: CHART-rnb6PSwCOS meta: - chartId: 344 + chartId: 65 height: 50 sliceName: Currently Enrolled Learners Per Day uuid: ed2fe731-6544-422f-bc55-42f399f48b2c @@ -494,7 +494,7 @@ position: children: [] id: CHART-tWnaoVNNTH meta: - chartId: 331 + chartId: 70 height: 50 sliceName: Distribution Of Attempts uuid: db90930f-f16e-4c32-8050-0e4abae28f4c @@ -509,7 +509,7 @@ position: children: [] id: CHART-w-k4N2T_L8 meta: - chartId: 298 + chartId: 16 height: 50 sliceName: Course Grade Distribution uuid: f9adbc85-1f50-4c04-ace3-31ba7390de5e