Compare commits

...

2 Commits
0.2.5 ... 0.2.7

Author SHA1 Message Date
c93ae4067e more graphs, 5
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2025-02-12 13:38:26 +01:00
1bbfdf65fb more graphs, 3
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2025-02-12 13:28:29 +01:00

View File

@ -195,8 +195,9 @@ def ntpserver():
)
graph_html_1 = fig.to_html(full_html=False, default_height='30%')
query = """
select tiem_bucket('5 minutes', time) as bucket,
select time_bucket('5 minutes', time) as bucket,
device,
avg(cast(values->'lan-out'->>'value' as int)) as outOctetsPerSeconds,
avg(cast(values->'lan-in'->>'value' as int)) as inOctetsPerSeconds
@ -207,17 +208,24 @@ def ntpserver():
order by bucket, device
"""
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(
xaxis_title="",
yaxis_title="",
title=f"Network Load",
yaxis=dict(ticksuffix=" KiB/s")
title='Network Load',
# Linke Y-Achse
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%')
query = """
select tiem_bucket('5 minutes', time) as bucket,
select time_bucket('5 minutes', time) as bucket,
device,
avg(cast(values->'local'->>'value' as float)) as loadAverage1Min
from measurements