more graphs, 5
This commit is contained in:
parent
1bbfdf65fb
commit
c93ae4067e
18
src/run.py
18
src/run.py
@ -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%')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user