summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-04-09 22:36:37 +0300
committerAndrew Dolgov <[email protected]>2023-04-09 22:36:37 +0300
commit44137342a695b9db59bf56f9348b8853f919cbbc (patch)
tree2313f26bbbaf0aca46d810aff2bfc55079d6e752
parentfd5e0f98c4174bea254b790606f323b0ca73292a (diff)
a bit more tracing
-rwxr-xr-xclasses/article.php11
-rwxr-xr-xclasses/pluginhost.php2
2 files changed, 13 insertions, 0 deletions
diff --git a/classes/article.php b/classes/article.php
index f4c271118..63469ccd2 100755
--- a/classes/article.php
+++ b/classes/article.php
@@ -581,6 +581,7 @@ class Article extends Handler_Protected {
* @return array<int, Article::ARTICLE_KIND_*|string>
*/
static function _get_image(array $enclosures, string $content, string $site_url, array $headline) {
+ $scope = Tracer::start(__METHOD__);
$article_image = "";
$article_stream = "";
@@ -659,6 +660,8 @@ class Article extends Handler_Protected {
if ($article_stream && $cache->exists(sha1($article_stream)))
$article_stream = $cache->get_url(sha1($article_stream));
+ $scope->close();
+
return [$article_image, $article_stream, $article_kind];
}
@@ -672,6 +675,8 @@ class Article extends Handler_Protected {
if (count($article_ids) == 0)
return [];
+ $scope = Tracer::start(__METHOD__);
+
$entries = ORM::for_table('ttrss_entries')
->table_alias('e')
->join('ttrss_user_entries', ['ref_id', '=', 'id'], 'ue')
@@ -691,6 +696,8 @@ class Article extends Handler_Protected {
}
}
+ $scope->close();
+
return array_unique($rv);
}
@@ -702,6 +709,8 @@ class Article extends Handler_Protected {
if (count($article_ids) == 0)
return [];
+ $scope = Tracer::start(__METHOD__);
+
$entries = ORM::for_table('ttrss_entries')
->table_alias('e')
->join('ttrss_user_entries', ['ref_id', '=', 'id'], 'ue')
@@ -714,6 +723,8 @@ class Article extends Handler_Protected {
array_push($rv, $entry->feed_id);
}
+ $scope->close();
+
return array_unique($rv);
}
}
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 09c8b1671..bdbecca13 100755
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -659,6 +659,7 @@ class PluginHost {
private function save_data(string $plugin): void {
if ($this->owner_uid) {
+ $scope = Tracer::start(__METHOD__);
if (!$this->pdo_data)
$this->pdo_data = Db::instance()->pdo_connect();
@@ -686,6 +687,7 @@ class PluginHost {
}
$this->pdo_data->commit();
+ $scope->close();
}
}