Skip to content

Commit 797337c

Browse files
author
Sidharth123-cpu
committed
Added dashboard for metrics
1 parent c118471 commit 797337c

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

docs/dashboard.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: default
3+
title: Graph Break Dashboard
4+
---
5+
6+
# Graph Break Metrics Dashboard
7+
8+
- Total Graph Breaks: 252
9+
- Graph Breaks with Additional Info: 1
10+
- Graph Breaks with Missing Content: 68
11+

generate-site.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ def generate_site():
114114
f.write(jekyll_config)
115115
print('Generated _config.yml')
116116

117+
# Initialize metrics for dashboard
118+
graph_breaks_with_additional_info = 0
119+
graph_breaks_with_missing_content = 0
120+
total_graph_breaks = 0
121+
117122
# Generate index.md
118123
index_md = """\
119124
---
@@ -137,12 +142,27 @@ def generate_site():
137142
Path(gb_dir).mkdir(exist_ok=True)
138143

139144
for gbid, entries in registry.items():
145+
total_graph_breaks += 1
140146
entry = entries[0] # Using first entry for the detail page
141147
file_path = os.path.join(gb_dir, f"{gbid.lower()}.md")
142148

143149
# Extract any manually added content from existing file
144150
manual_content = extract_manual_content(file_path)
145151

152+
if manual_content:
153+
graph_breaks_with_additional_info += 1
154+
155+
# Check for missing content
156+
missing_content = False
157+
if entry.get('Gb_type', '*No Gb_type provided.*') == '*No Gb_type provided.*' or \
158+
entry.get('Context', '*No context provided.*') == '*No context provided.*' or \
159+
entry.get('Explanation', '*No explanation provided.*') == '*No explanation provided.*' or \
160+
not entry.get('Hints', []):
161+
missing_content = True
162+
163+
if missing_content:
164+
graph_breaks_with_missing_content += 1
165+
146166
hints = entry.get('Hints', [])
147167
hints_content = '\n'.join([f"- {h}" for h in hints]) if hints else '*No hints provided.*'
148168

@@ -192,6 +212,24 @@ def generate_site():
192212
f.write(detail_md)
193213
print(f'Generated {file_path}')
194214

215+
# Generate dashboard.md
216+
dashboard_md = f"""\
217+
---
218+
layout: default
219+
title: Graph Break Dashboard
220+
---
221+
222+
# Graph Break Metrics Dashboard
223+
224+
- Total Graph Breaks: {total_graph_breaks}
225+
- Graph Breaks with Additional Info: {graph_breaks_with_additional_info}
226+
- Graph Breaks with Missing Content: {graph_breaks_with_missing_content}
227+
228+
"""
229+
with open(os.path.join(output_dir, 'dashboard.md'), 'w') as f:
230+
f.write(dashboard_md)
231+
print('Generated dashboard.md')
232+
195233
print('Site generation complete!')
196234

197235

0 commit comments

Comments
 (0)