Skip to content

Commit

Permalink
Merge pull request #949 from nextcloud/backport/946/stable23
Browse files Browse the repository at this point in the history
[stable23] display spent time on request
  • Loading branch information
ArtificialOwl authored Mar 9, 2022
2 parents 251e48f + 8a4b8cb commit a3c8710
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions lib/Command/CirclesCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,25 @@ private function testLoopback(InputInterface $input, OutputInterface $output): b
return false;
}

$timer = round(microtime(true) * 1000);
$output->write('- Creating async FederatedEvent ');
$test = new FederatedEvent(LoopbackTest::class);
$this->federatedEventService->newEvent($test);

$output->writeln('<info>' . $test->getWrapperToken() . '</info>');
$output->writeln(
'<info>' . $test->getWrapperToken() . '</info> ' .
'(took ' . (round(microtime(true) * 1000) - $timer) . 'ms)'
);

$output->writeln('- Waiting for async process to finish (5s)');
sleep(5);

$output->write('- Checking status on FederatedEvent ');
$wrappers = $this->remoteUpstreamService->getEventsByToken($test->getWrapperToken());

if (count($wrappers) !== 1) {
$output->writeln('<error>Event created too many Wrappers</error>');

return false;
}

$wrapper = array_shift($wrappers);
Expand Down Expand Up @@ -392,8 +398,10 @@ private function saveLoopback(InputInterface $input, OutputInterface $output, st
[$scheme, $cloudId, $path] = $this->parseAddress($loopback);

$question = new ConfirmationQuestion(
'- Do you want to save <info>' . $loopback
. '</info> as your <info>loopback</info> address ? (y/N) ', false, '/^(y|Y)/i'
'- Do you want to save <info>'
. $loopback
. '</info> as your <info>loopback</info> address ? (y/N) ',
false, '/^(y|Y)/i'
);

$helper = $this->getHelper('question');
Expand Down Expand Up @@ -573,8 +581,10 @@ private function saveInternal(InputInterface $input, OutputInterface $output, st

$output->writeln('');
$question = new ConfirmationQuestion(
'- Do you want to save <info>' . $internal
. '</info> as your <info>internal</info> address ? (y/N) ', false, '/^(y|Y)/i'
'- Do you want to save <info>'
. $internal
. '</info> as your <info>internal</info> address ? (y/N) ',
false, '/^(y|Y)/i'
);

$helper = $this->getHelper('question');
Expand Down

0 comments on commit a3c8710

Please sign in to comment.