Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9344270
pergamon.swap.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
950 B
Subscribers
None
pergamon.swap.py
View Options
from
grafanalib.core
import
*
def
swap_activity_graph
(
time_from
=
None
):
if
time_from
is
not
None
:
timeFrom
=
"
%s
"
%
(
time_from
,)
else
:
timeFrom
=
None
return
Graph
(
title
=
'Swap activity'
,
dataSource
=
"Prometheus"
,
timeFrom
=
timeFrom
,
targets
=
[
Target
(
expr
=
'irate(node_vmstat_pswpin{instance="192.168.100.29:9100"}[5m])'
,
legendFormat
=
"pages per second in"
,
refId
=
'A'
,
),
Target
(
expr
=
'irate(node_vmstat_pswpout{instance="192.168.100.29:9100"}[5m])'
,
legendFormat
=
"pages per second out"
,
refId
=
'B'
,
),
],
yAxes
=
[
YAxis
(
format
=
SHORT_FORMAT
),
YAxis
(
format
=
SHORT_FORMAT
),
],
)
dashboard
=
Dashboard
(
title
=
"Pergamon swap usage auto-generated"
,
rows
=
[
Row
(
title
=
'Swap'
,
panels
=
[
swap_activity_graph
(),
swap_activity_graph
(
"1y"
),
],
),
],)
.
auto_panel_ids
()
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Fri, Jul 4, 2:16 PM (2 d, 2 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239834
Attached To
rDSNIP Code snippets
Event Timeline
Log In to Comment