initialized ) { $this->initialized = true; $this->entryPoint = $entryPoint; $this->handler = $handler; } } /** * @return bool Whether the context was initialized yet */ public function isInitialized() { return $this->initialized; } /** * @return string Entry point name for this request (e.g. "index", "api", "load") */ public function getEntryPoint(): string { return $this->entryPoint; } /** * @return string Handler name for this request (e.g. "edit", "recentchanges") */ public function getHandler(): string { return $this->handler; } /** * @return string Statsd metric name prefix for this entry point and handler */ public function getHandlerMetricPrefix(): string { // Replace any characters that may have a special meaning in statsd/graphite return $this->entryPoint . '_' . strtr( $this->handler, [ '{' => '', '}' => '', ':' => '_', '/' => '_', '.' => '_' ] ); } /** * @internal For testing only */ public static function destroySingleton() { self::$instance = null; } }