Skip to content

Commit d213f6b

Browse files
docs: improve memory plots
Improve memory plots. Signed-off-by: Giacomo Dematteis <giacomo.dematteis@nordicsemi.no>
1 parent c01b721 commit d213f6b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/on_target/scripts/memory_plot_generator.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ def generate_memory_plots(output_dir):
5555
y_min_ram = 0 # Start from 0
5656
y_max_ram = df_ram['Total (B)'].max() * 1.1 # 10% margin above max total
5757

58-
fig_ram = px.scatter(df_ram, x='Date', y=['Used (B)', 'Total (B)'],
58+
fig_ram = px.line(df_ram, x='Date', y=['Used (B)', 'Total (B)'],
5959
title='RAM Usage History - Asset Tracker Template',
6060
labels={'value': 'Bytes', 'variable': 'Metric'})
61-
# Add markers
62-
fig_ram.update_traces(mode='markers', marker=dict(size=10))
61+
# Update traces: line only for Total, line+markers for Used
62+
fig_ram.update_traces(mode='lines', selector=dict(name='Total (B)'))
63+
fig_ram.update_traces(mode='lines+markers', selector=dict(name='Used (B)'), marker=dict(size=8))
6364
# Set y-axis range
6465
fig_ram.update_layout(yaxis=dict(range=[y_min_ram, y_max_ram]))
6566
fig_ram.write_html(os.path.join(output_dir, "ram_history_plot.html"))
@@ -74,11 +75,12 @@ def generate_memory_plots(output_dir):
7475
y_min_flash = 0 # Start from 0
7576
y_max_flash = df_flash['Total (B)'].max() * 1.1 # 10% margin above max total
7677

77-
fig_flash = px.scatter(df_flash, x='Date', y=['Used (B)', 'Total (B)'],
78+
fig_flash = px.line(df_flash, x='Date', y=['Used (B)', 'Total (B)'],
7879
title='Flash Usage History - Asset Tracker Template',
7980
labels={'value': 'Bytes', 'variable': 'Metric'})
80-
# Add markers
81-
fig_flash.update_traces(mode='markers', marker=dict(size=10))
81+
# Update traces: line only for Total, line+markers for Used
82+
fig_flash.update_traces(mode='lines', selector=dict(name='Total (B)'))
83+
fig_flash.update_traces(mode='lines+markers', selector=dict(name='Used (B)'), marker=dict(size=8))
8284
# Set y-axis range
8385
fig_flash.update_layout(yaxis=dict(range=[y_min_flash, y_max_flash]))
8486
fig_flash.write_html(os.path.join(output_dir, "flash_history_plot.html"))

0 commit comments

Comments
 (0)