Log the execution time

This commit is contained in:
Michael 2022-05-17 20:47:23 +00:00
commit 4016a576d5
27 changed files with 67 additions and 6 deletions

View file

@ -39,10 +39,12 @@ use Friendica\Util\Strings;
function fbrowser_content(App $a)
{
if (!local_user()) {
DI::page()->logRuntime();
exit();
}
if (DI::args()->getArgc() == 1) {
DI::page()->logRuntime();
exit();
}

View file

@ -158,6 +158,7 @@ function photos_post(App $a)
if (!$can_post) {
notice(DI::l10n()->t('Permission denied.'));
DI::page()->logRuntime();
exit();
}
@ -166,6 +167,7 @@ function photos_post(App $a)
if (!$owner_record) {
notice(DI::l10n()->t('Contact information unavailable'));
DI::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
DI::page()->logRuntime();
exit();
}

View file

@ -38,6 +38,7 @@ function hub_return($valid, $body)
} else {
throw new \Friendica\Network\HTTPException\NotFoundException();
}
DI::page()->logRuntime();
exit();
}

View file

@ -142,5 +142,6 @@ function pubsubhubbub_init(App $a) {
throw new \Friendica\Network\HTTPException\AcceptedException();
}
DI::page()->logRuntime();
exit();
}

View file

@ -30,6 +30,7 @@ function share_init(App $a) {
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
if (!$post_id || !local_user()) {
DI::page()->logRuntime();
exit();
}
@ -38,6 +39,7 @@ function share_init(App $a) {
$item = Post::selectFirst($fields, ['id' => $post_id]);
if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) {
DI::page()->logRuntime();
exit();
}
@ -56,5 +58,6 @@ function share_init(App $a) {
}
echo $o;
DI::page()->logRuntime();
exit();
}

View file

@ -167,6 +167,6 @@ EOT;
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
DI::page()->logRuntime();
exit();
}

View file

@ -67,6 +67,7 @@ function wall_attach_post(App $a) {
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
}
notice(DI::l10n()->t('Permission denied.') . EOL );
DI::page()->logRuntime();
exit();
}
@ -74,6 +75,7 @@ function wall_attach_post(App $a) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
DI::page()->logRuntime();
exit();
}
@ -97,6 +99,7 @@ function wall_attach_post(App $a) {
} else {
notice($msg);
}
DI::page()->logRuntime();
exit();
}
@ -108,6 +111,7 @@ function wall_attach_post(App $a) {
} else {
echo $msg . EOL;
}
DI::page()->logRuntime();
exit();
}
@ -122,6 +126,7 @@ function wall_attach_post(App $a) {
} else {
echo $msg . EOL;
}
DI::page()->logRuntime();
exit();
}
@ -132,7 +137,7 @@ function wall_attach_post(App $a) {
$lf = "\n";
echo $lf . $lf . '[attachment]' . $newid . '[/attachment]' . $lf;
DI::page()->logRuntime();
exit();
// NOTREACHED
}

View file

@ -89,6 +89,7 @@ function wall_upload_post(App $a, $desktopmode = true)
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
}
notice(DI::l10n()->t('Permission denied.'));
DI::page()->logRuntime();
exit();
}
@ -96,6 +97,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
DI::page()->logRuntime();
exit();
}
@ -148,6 +150,7 @@ function wall_upload_post(App $a, $desktopmode = true)
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
notice(DI::l10n()->t('Invalid request.'));
DI::page()->logRuntime();
exit();
}
@ -167,6 +170,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} else {
echo $msg. EOL;
}
DI::page()->logRuntime();
exit();
}
@ -205,6 +209,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} else {
echo $msg. EOL;
}
DI::page()->logRuntime();
exit();
}
}
@ -229,6 +234,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} else {
echo $msg. EOL;
}
DI::page()->logRuntime();
exit();
}
@ -281,6 +287,7 @@ function wall_upload_post(App $a, $desktopmode = true)
}
echo "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $resource_id . '][img]' . DI::baseUrl() . "/photo/{$resource_id}-{$smallest}.".$Image->getExt()."[/img][/url]\n\n";
DI::page()->logRuntime();
exit();
// NOTREACHED
}