Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
a688e38f
Commit
a688e38f
authored
Mar 14, 2016
by
Gary Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Periodically trim time series data from monitoring database.
parent
02d2b896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
protogeni/scripts/mondbd.in
protogeni/scripts/mondbd.in
+25
-0
No files found.
protogeni/scripts/mondbd.in
View file @
a688e38f
...
@@ -272,6 +272,31 @@ while (1) {
...
@@ -272,6 +272,31 @@ while (1) {
my
$ts
=
time
()
.
"
000000
";
my
$ts
=
time
()
.
"
000000
";
my
$expire
=
(
time
()
-
24
*
60
*
60
)
.
"
000000
";
my
$expire
=
(
time
()
-
24
*
60
*
60
)
.
"
000000
";
# Trim old timeseries data.
foreach
my
$table
(
"
ops_interface_rx_bps
",
"
ops_interface_rx_dps
",
"
ops_interface_rx_eps
",
"
ops_interface_rx_pps
",
"
ops_interface_tx_bps
",
"
ops_interface_tx_dps
",
"
ops_interface_tx_eps
",
"
ops_interfacevlan_rx_bps
",
"
ops_interfacevlan_rx_dps
",
"
ops_interfacevlan_rx_eps
",
"
ops_interfacevlan_rx_pps
",
"
ops_interfacevlan_tx_bps
",
"
ops_interfacevlan_tx_dps
",
"
ops_interfacevlan_tx_eps
",
"
ops_interfacevlan_tx_pps
",
"
ops_node_cpu_util
",
"
ops_node_disk_part_max_used
",
"
ops_node_mem_used_kb
",
"
ops_node_num_vms_allocated
",
"
ops_node_swap_free
"
)
{
emdbi::
DBQueryWarnN
(
$db
,
"
DELETE FROM
$table
WHERE ts <
$expire
"
);
}
# Add the local CM.
# Add the local CM.
# FIXME would be nice to add routable_ip_poolsize
# FIXME would be nice to add routable_ip_poolsize
emdbi::
DBQueryWarnN
(
$db
,
"
LOCK TABLES ops_aggregate WRITE
"
);
emdbi::
DBQueryWarnN
(
$db
,
"
LOCK TABLES ops_aggregate WRITE
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment