ca003c88ba
On S3, index files and the tree segments read back when a snapshot is written are fetched 16 at a time through the storage's S3 client (IBackend::getRanges(), getMany()). Blobs that follow each other in a pack are read as one range on every location. The snapshot is written in a step of its own and the run shows "commit" meanwhile. On a 1 TB production repository the check went from about 4 hours to 3.5 minutes. backup:status and the web interface list the runs of the last 7 days, running ones and at least the newest 5; --all / "Show older runs" list all. Durations of a day or more show the days.
18 lines
510 B
PHP
18 lines
510 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\NgBackup\Tests\Unit;
|
|
|
|
use OCA\NgBackup\Format;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class FormatTest extends TestCase {
|
|
public function testDurationShowsDaysFromOneDayOn(): void {
|
|
$this->assertSame('00:00:00', Format::duration(-5));
|
|
$this->assertSame('12:10:13', Format::duration(12 * 3600 + 10 * 60 + 13));
|
|
$this->assertSame('1d 00:00:00', Format::duration(86400));
|
|
$this->assertSame('1d 12:10:13', Format::duration(86400 + 12 * 3600 + 10 * 60 + 13));
|
|
}
|
|
}
|