Compare commits
No commits in common. "0cbf922edaf226756816d94c44cc276ac773e995" and "34ce8eb0bc0da8ed9ddc2944caf17933f60c2df8" have entirely different histories.
0cbf922eda
...
34ce8eb0bc
|
@ -232,10 +232,9 @@ sub backup2disk {
|
||||||
$list_cfd->printflush("list $target->{dir}\n"); # XXX - encode!
|
$list_cfd->printflush("list $target->{dir}\n"); # XXX - encode!
|
||||||
close($list_cfd);
|
close($list_cfd);
|
||||||
my $count = 0;
|
my $count = 0;
|
||||||
my $last_report = $self->{start_time};
|
|
||||||
while (<$list_dfd>) {
|
while (<$list_dfd>) {
|
||||||
my $now = time();
|
|
||||||
if ($target->{timeout}) {
|
if ($target->{timeout}) {
|
||||||
|
my $now = time();
|
||||||
my $elapsed = $now - $self->{start_time};
|
my $elapsed = $now - $self->{start_time};
|
||||||
$self->log(10, "checking timeout " . $elapsed . " > " . $target->{timeout});
|
$self->log(10, "checking timeout " . $elapsed . " > " . $target->{timeout});
|
||||||
if ($elapsed > $target->{timeout}) {
|
if ($elapsed > $target->{timeout}) {
|
||||||
|
@ -249,9 +248,8 @@ sub backup2disk {
|
||||||
# split into fields
|
# split into fields
|
||||||
chomp;
|
chomp;
|
||||||
my $f = $self->parse($_);
|
my $f = $self->parse($_);
|
||||||
if ($now - $last_report >= 10) {
|
if ($count % 1000 == 0) {
|
||||||
$self->log(9, "file $count: $f->{name}");
|
$self->log(9, "file $count: $f->{name}");
|
||||||
$last_report = $now;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my $success = 1;
|
my $success = 1;
|
||||||
|
@ -545,14 +543,6 @@ sub db_record_version {
|
||||||
my $t2b = gettimeofday();
|
my $t2b = gettimeofday();
|
||||||
$self->{times}{db_record_version_versions2_get_version_id} += $t2b - $t2a;
|
$self->{times}{db_record_version_versions2_get_version_id} += $t2b - $t2a;
|
||||||
unless ($version_id) {
|
unless ($version_id) {
|
||||||
# We use a 32 bit int field in the database, so we have to clamp the mtime to that range.
|
|
||||||
# Need to fix this sometime before 2038 :-)
|
|
||||||
if ($f->{m} < -2147483648) {
|
|
||||||
$f->{m} = -2147483648;
|
|
||||||
} elsif ($f->{m} > 2147483647) {
|
|
||||||
$f->{m} = 2147483647;
|
|
||||||
}
|
|
||||||
$self->log(10, "insert into versions2(..., file_mtime=$f->{m}, ...)");
|
|
||||||
# XXX why is $f->{checksum} undef here for ./bin/dash?
|
# XXX why is $f->{checksum} undef here for ./bin/dash?
|
||||||
$self->{dbh}->do("insert into versions2(
|
$self->{dbh}->do("insert into versions2(
|
||||||
file_type, file_size, file_mtime,
|
file_type, file_size, file_mtime,
|
||||||
|
@ -576,7 +566,6 @@ sub db_record_version {
|
||||||
$f->{checksum}, $f->{lt},
|
$f->{checksum}, $f->{lt},
|
||||||
);
|
);
|
||||||
$version_id = $self->{dbh}->{mysql_insertid};
|
$version_id = $self->{dbh}->{mysql_insertid};
|
||||||
$self->log(10, "insert into versions2 -> $version_id");
|
|
||||||
}
|
}
|
||||||
my $t3 = gettimeofday();
|
my $t3 = gettimeofday();
|
||||||
$self->{times}{db_record_version_versions2} += $t3 - $t2;
|
$self->{times}{db_record_version_versions2} += $t3 - $t2;
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/usr/bin/perl
|
|
||||||
use v5.24;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
open my $tsfh, '>', "graph_free.tsv";
|
|
||||||
for my $fn (glob("/var/log/simba/ca.*")) {
|
|
||||||
my $fh;
|
|
||||||
if ($fn =~ /\.gz$/) {
|
|
||||||
open($fh, '-|', "zcat", $fn);
|
|
||||||
} else {
|
|
||||||
open ($fh, '<', $fn);
|
|
||||||
}
|
|
||||||
while (<$fh>) {
|
|
||||||
if (m{(....-..-..T..:..:..[-+]....) .*: found base /backup/(.*) \(est. (\d+) bytes\)}) {
|
|
||||||
say $tsfh "$1\t$2\t$3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close $tsfh;
|
|
||||||
|
|
||||||
open STDOUT, '>', "graph_free.png";
|
|
||||||
system "tsplotv", "--style", "points", "--legend-position", "below", "--yrange", "0:*", "graph_free.tsv";
|
|
|
@ -1,20 +0,0 @@
|
||||||
#!/usr/bin/perl
|
|
||||||
use v5.24;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
open my $tsfh, '>', "graph_used.tsv";
|
|
||||||
for my $fn (glob("/var/log/simba/ca.*")) {
|
|
||||||
open (my $fh, '<', $fn);
|
|
||||||
my %free;
|
|
||||||
while (<$fh>) {
|
|
||||||
if (m{(....-..-..T..:..:..[-+]....) .*: considering base /backup/(.*) \(est. (\d+) bytes\)}) {
|
|
||||||
$free{$2} = $3;
|
|
||||||
} elsif (m{(....-..-..T..:..:..[-+]....) .*: using base /backup/(.*)}) {
|
|
||||||
say $tsfh "$1\t$2\t$free{$2}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close $tsfh;
|
|
||||||
|
|
||||||
open STDOUT, '>', "graph_used.png";
|
|
||||||
system "tsplotv", "--style", "points", "--legend-position", "below", "graph_used.tsv";
|
|
Loading…
Reference in New Issue