diff --git a/classes/rpc.php b/classes/rpc.php index 092a0e25f..e21671d78 100755 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -176,6 +176,8 @@ class RPC extends Handler_Protected { } function sanityCheck(): void { + $span = Tracer::start(__METHOD__); + $_SESSION["hasSandbox"] = self::_param_to_bool($_REQUEST["hasSandbox"] ?? false); $_SESSION["clientTzOffset"] = clean($_REQUEST["clientTzOffset"]); @@ -207,6 +209,8 @@ class RPC extends Handler_Protected { } else { print Errors::to_json($error, $error_params); } + + $span->end(); } /*function completeLabels() { @@ -250,6 +254,7 @@ class RPC extends Handler_Protected { } static function updaterandomfeed_real(): void { + $span = Tracer::start(__METHOD__); $default_interval = (int) Prefs::get_default(Prefs::DEFAULT_UPDATE_INTERVAL); @@ -340,6 +345,7 @@ class RPC extends Handler_Protected { print json_encode(array("message" => "NOTHING_TO_UPDATE")); } + $span->end(); } function updaterandomfeed(): void { @@ -395,6 +401,8 @@ class RPC extends Handler_Protected { } function log(): void { + $span = Tracer::start(__METHOD__); + $msg = clean($_REQUEST['msg'] ?? ""); $file = basename(clean($_REQUEST['file'] ?? "")); $line = (int) clean($_REQUEST['line'] ?? 0); @@ -406,9 +414,13 @@ class RPC extends Handler_Protected { echo json_encode(array("message" => "HOST_ERROR_LOGGED")); } + + $span->end(); } function checkforupdates(): void { + $span = Tracer::start(__METHOD__); + $rv = ["changeset" => [], "plugins" => []]; $version = Config::get_version(false); @@ -434,6 +446,8 @@ class RPC extends Handler_Protected { $rv["plugins"] = Pref_Prefs::_get_updated_plugins(); } + $span->end(); + print json_encode($rv); } @@ -441,6 +455,8 @@ class RPC extends Handler_Protected { * @return array */ private function _make_init_params(): array { + $span = Tracer::start(__METHOD__); + $params = array(); foreach ([Prefs::ON_CATCHUP_SHOW_NEXT_FEED, Prefs::HIDE_READ_FEEDS, @@ -493,6 +509,8 @@ class RPC extends Handler_Protected { $params["icon_blank"] = $this->image_to_base64("images/blank_icon.gif"); $params["labels"] = Labels::get_all($_SESSION["uid"]); + $span->end(); + return $params; } @@ -512,6 +530,8 @@ class RPC extends Handler_Protected { * @return array */ static function _make_runtime_info(): array { + $span = Tracer::start(__METHOD__); + $data = array(); $pdo = Db::pdo(); @@ -577,6 +597,8 @@ class RPC extends Handler_Protected { } } + $span->end(); + return $data; }