Skip to content

Commit

Permalink
chore: restore instructor dashboard chart ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Mar 15, 2024
1 parent bd0e343 commit f5feea7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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+=(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f5feea7

Please sign in to comment.