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
e7d69dff
Commit
e7d69dff
authored
Mar 15, 2006
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep last 24 hours of data on ops, as a sliding window, pushed every
hour from crontab.
parent
e8efc047
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
pelab/db/pelab_dbpush.in
pelab/db/pelab_dbpush.in
+8
-2
No files found.
pelab/db/pelab_dbpush.in
View file @
e7d69dff
...
...
@@ -148,6 +148,12 @@ if (!defined($lastidx)) {
unlink
("
${tempfile}
.pair_data
")
if
(
-
e
"
${tempfile}
.pair_data
");
#
# Compute the cutoff age; We leave MAXAGE old entries here, and ship
# the rest over to the DP.
#
my
$cutoffage
=
(
time
()
-
$MAXAGE
)
*
1.0
;
#
# Must lock the table of course
#
...
...
@@ -157,7 +163,7 @@ DBQueryFatal("lock tables pair_data write");
# Grab all of the new entries and store to the file
#
DBQueryFatal
("
select * from pair_data
"
.
"
where idx >
$lastidx
"
.
"
where idx >
$lastidx
and unixstamp <
$cutoffage
"
.
"
into outfile '
${tempfile}
.pair_data'
"
.
"
fields terminated by ' '
");
...
...
@@ -166,7 +172,7 @@ DBQueryFatal("select * from pair_data ".
#
$query_result
=
DBQueryFatal
("
select idx from pair_data
"
.
"
where idx >
$lastidx
"
.
"
where idx >
$lastidx
and unixstamp <
$cutoffage
"
.
"
order by idx desc limit 1
");
# Save for later.
$lastidx
=
$query_result
->
fetchrow_array
();
...
...
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