mirror of https://github.com/digint/btrbk
btrbk: stats command: show "correlated" status instead of "orphaned" (inverse logic which caused a lot of confusion)
parent
15bae5e051
commit
c0c546eb4e
|
@ -4,6 +4,7 @@ btrbk-current
|
|||
* Bugfix: accept "no" for "transaction_log", "transaction_syslog"
|
||||
and "lockfile" configuration options.
|
||||
* Show "up-to-date" status for backups in "stats" command.
|
||||
* Show "correlated" status instead of "orphaned" in "stats" command.
|
||||
|
||||
btrbk-0.25.0
|
||||
|
||||
|
|
14
btrbk
14
btrbk
|
@ -4737,6 +4737,7 @@ MAIN:
|
|||
my @stats_data;
|
||||
my $stats_snapshots_total = 0;
|
||||
my $stats_backups_total = 0;
|
||||
my $stats_backups_total_correlated = 0;
|
||||
my $stats_backups_total_incomplete = 0;
|
||||
my $stats_backups_total_orphaned = 0;
|
||||
if($action_resolve eq "snapshots")
|
||||
|
@ -4789,7 +4790,7 @@ MAIN:
|
|||
$stats_snapshots_total += scalar(@snapshot_children); # NOTE: this adds ALL snaphot children under $sroot (not only the ones created by btrbk!)
|
||||
|
||||
foreach my $droot (vinfo_subsection($svol, 'target')) {
|
||||
my $stats_received = 0;
|
||||
my $stats_correlated = 0;
|
||||
my $stats_orphaned = 0;
|
||||
my $stats_incomplete = 0;
|
||||
my $target_up_to_date = 0;
|
||||
|
@ -4810,7 +4811,7 @@ MAIN:
|
|||
}
|
||||
}
|
||||
if($parent_snapshot) {
|
||||
$stats_received++;
|
||||
$stats_correlated++;
|
||||
my $up_to_date = ($parent_snapshot->{node}{cgen} == $svol->{node}{gen});
|
||||
push @data, { type => "received",
|
||||
vinfo_prefixed_keys("target", $target_vol),
|
||||
|
@ -4837,13 +4838,14 @@ MAIN:
|
|||
}
|
||||
}
|
||||
}
|
||||
my $stats_total = $stats_received + $stats_incomplete + $stats_orphaned;
|
||||
my $stats_total = $stats_correlated + $stats_incomplete + $stats_orphaned;
|
||||
$stats_backups_total += $stats_total;
|
||||
$stats_backups_total_correlated += $stats_correlated;
|
||||
$stats_backups_total_incomplete += $stats_incomplete;
|
||||
$stats_backups_total_orphaned += $stats_orphaned;
|
||||
my @stats_detail;
|
||||
push @stats_detail, "up-to-date" if($target_up_to_date);
|
||||
push @stats_detail, "$stats_orphaned orphaned" if($stats_orphaned);
|
||||
push @stats_detail, "$stats_correlated correlated" if($stats_correlated);
|
||||
push @stats_detail, "$stats_incomplete incomplete" if($stats_incomplete);
|
||||
my $stats_detail_print = join(', ', @stats_detail);
|
||||
$stats_detail_print = " ($stats_detail_print)" if($stats_detail_print);
|
||||
|
@ -4893,7 +4895,7 @@ MAIN:
|
|||
time => $start_time,
|
||||
legend => [
|
||||
"up-to-date: latest snapshot/backup is up to date with source subvolume",
|
||||
"orphaned : parent snapshot was deleted (by snapshot_preserve policy)",
|
||||
"correlated: corresponding (reveived-from) source snapshot is present",
|
||||
],
|
||||
);
|
||||
|
||||
|
@ -4901,7 +4903,7 @@ MAIN:
|
|||
print "\n";
|
||||
my $stats_filter = $config->{CMDLINE_FILTER_LIST} ? join("; ", @{$config->{CMDLINE_FILTER_LIST}}) : "";
|
||||
my @stats_total_detail;
|
||||
push @stats_total_detail, "$stats_backups_total_orphaned orphaned" if($stats_backups_total_orphaned);
|
||||
push @stats_total_detail, "$stats_backups_total_correlated correlated" if($stats_backups_total_correlated);
|
||||
push @stats_total_detail, "$stats_backups_total_incomplete incomplete" if($stats_backups_total_incomplete);
|
||||
my $stats_total_detail_print = join(', ', @stats_total_detail);
|
||||
$stats_total_detail_print = " ($stats_total_detail_print)" if($stats_total_detail_print);
|
||||
|
|
Loading…
Reference in New Issue