Skip to content

Commit

Permalink
TASK: Revert PerformanceMeasurement adjustments
Browse files Browse the repository at this point in the history
we will open a dedicated pr to get rid of the forkCommandUseHere
  • Loading branch information
mhsdesign committed Oct 24, 2024
1 parent f40b633 commit bf9c3b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,18 @@ public function preparePerformanceTestCommand(int $nodesPerLevel, int $levels):
fn() => $this->performanceMeasurementService->createNodesForPerformanceTest($nodesPerLevel, $levels)
);
}

/**
* Test the performance of forking a content stream and measure the time taken.
*
* @internal
*/
public function testPerformanceCommand(): void
{
$time = microtime(true);
$this->performanceMeasurementService->forkContentStream();

$timeElapsed = microtime(true) - $time;
$this->outputLine('Time: ' . $timeElapsed);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceInterface;
use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings;
use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName;
use Neos\ContentRepository\Core\Feature\ContentStreamForking\Command\ForkContentStream;
use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated;
Expand Down Expand Up @@ -107,6 +108,7 @@ public function createNodesForPerformanceTest(int $nodesPerLevel, int $levels):
ExpectedVersion::ANY()
));
echo $sumSoFar;
#$this->outputLine(microtime(true) - $time . ' elapsed');
}


Expand Down Expand Up @@ -152,10 +154,9 @@ private function createHierarchy(

public function forkContentStream(): void
{
throw new \BadMethodCallException('not implemented');
// $this->contentRepository->handle(ForkContentStream::create(
// ContentStreamId::create(),
// $this->contentStreamId,
// ));
$this->contentRepository->handle(ForkContentStream::create(
ContentStreamId::create(),
$this->contentStreamId,
));
}
}

0 comments on commit bf9c3b7

Please sign in to comment.