diff --git a/protogeni/scripts/mondbd.in b/protogeni/scripts/mondbd.in index 66437a247e0cee7917f737a60f83877e51cf7df4..3b4c669abbde383827e30d8a2888b6a88ae5ae92 100755 --- a/protogeni/scripts/mondbd.in +++ b/protogeni/scripts/mondbd.in @@ -272,6 +272,31 @@ while (1) { my $ts = time() . "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. # FIXME would be nice to add routable_ip_poolsize emdbi::DBQueryWarnN( $db, "LOCK TABLES ops_aggregate WRITE" );