more graphs, 5
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
Wolfgang Hottgenroth 2025-02-12 13:38:26 +01:00
parent 1bbfdf65fb
commit c93ae4067e

View File

@ -195,6 +195,7 @@ def ntpserver():
) )
graph_html_1 = fig.to_html(full_html=False, default_height='30%') graph_html_1 = fig.to_html(full_html=False, default_height='30%')
query = """ query = """
select time_bucket('5 minutes', time) as bucket, select time_bucket('5 minutes', time) as bucket,
device, device,
@ -207,12 +208,19 @@ def ntpserver():
order by bucket, device order by bucket, device
""" """
df = pd.read_sql(query, con=engine) df = pd.read_sql(query, con=engine)
fig_2 = px.line(df, x='bucket', y=['outOctetsPerSeconds', 'inOctetsPerSeconds']) fig_2 = po.Figure()
fig_2.add_trace(po.Scatter(x=df['bucket'], y=df['outOctetsPerSeconds'], mode='lines', name='Outbound Traffic', line=dict(color='green')))
fig_2.add_trace(po.Scatter(x=df['bucket'], y=df['inOctetsPerSeconds'], mode='lines', name='Inbound Traffic', line=dict(color='blue')))
fig_2.update_layout( fig_2.update_layout(
xaxis_title="", title='Network Load',
yaxis_title="",
title=f"Network Load", # Linke Y-Achse
yaxis=dict(ticksuffix=" KiB/s") yaxis=dict(
ticksuffix=' KiB/s'
),
legend=dict(x=0.05, y=1) # Position der Legende
) )
graph_html_2 = fig_2.to_html(full_html=False, default_height='30%') graph_html_2 = fig_2.to_html(full_html=False, default_height='30%')