1
0
Fork 0
mirror of synced 2024-06-13 16:24:47 +12:00

push debug logs

This commit is contained in:
Torsten Dittmann 2022-05-19 11:49:48 +02:00
parent 27be739d5e
commit 4cbf3b1e12

View file

@ -16,7 +16,7 @@ abstract class Migration
/**
* @var int
*/
protected int $limit = 100;
protected int $limit = 250;
/**
* @var Document
@ -108,7 +108,9 @@ abstract class Migration
Console::log('Migrating Collection ' . $collection['$id'] . ':');
do {
$start = microtime(true);
$documents = $this->projectDB->find($collection['$id'], limit: $this->limit, cursor: $nextDocument);
var_dump("Fetching documents took " . microtime(true) - $start);
$count = count($documents);
$sum += $count;
@ -121,10 +123,17 @@ abstract class Migration
return;
}
$start = microtime(true);
$old = $document->getArrayCopy();
$new = call_user_func($callback, $document);
var_dump("migration took " . microtime(true) - $start);
if (!$this->hasDifference($new->getArrayCopy(), $old)) {
$start = microtime(true);
$diff = !$this->hasDifference($new->getArrayCopy(), $old);
var_dump("Diff took " . microtime(true) - $start);
if (!$diff) {
return;
}