/** * {@inheritdoc} */ public function getBrowserTimingHeader($flag = true) { if (!$this->extensionLoaded()) { return; } return newrelic_get_browser_timing_header((bool) $flag); }
/** * Starts user data timer * * @return string NR JS */ public function start() { if ($this->hasNewRelic()) { return newrelic_get_browser_timing_header(); } return null; }
public static function start($withTags = true) { if (extension_loaded('newrelic')) { return newrelic_get_browser_timing_header($withTags); } return ''; }
public function getTimingHeader() { if (!extension_loaded('newrelic')) { return null; } return newrelic_get_browser_timing_header(); }
public function enableBrowserTimings() { Yii::$app->getView()->on(View::EVENT_AFTER_RENDER, function () { Yii::$app->view->registerJs(newrelic_get_browser_timing_header(false), View::POS_HEAD); Yii::$app->view->registerJs(newrelic_get_browser_timing_footer(false), View::EVENT_END_BODY); }); }
function ryzom_app_render($title, $content, $style = '', $javascript = array(), $homeLink = false) { $c = ''; // get Lua code $c .= ryLua::get(RYZOM_IG); $at_end = ryLua::getEnd(RYZOM_IG); // Render header $title_prefix = ''; if (ON_IPHONE) { $title_prefix = 'Ryzom - '; } if (!RYZOM_IG) { $c .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' . "\n"; } $c .= '<html><head>' . "\n"; $c .= ' <title>' . $title_prefix . (translation_exists($title) ? _t($title) : $title) . '</title>' . "\n"; if (!RYZOM_IG) { $c .= ' <meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8" />' . "\n"; } $events = ''; if (!RYZOM_IG) { $c .= ryzom_render_header(); $c .= ryzom_render_header_www(); if (function_exists('newrelic_get_browser_timing_header')) { $c .= newrelic_get_browser_timing_header(); } if (ON_IPHONE) { $events = 'onorientationchange="updateOrientation();" '; } } else { #if (!$style) $style = 'bgcolor="#00000000"'; } if (!RYZOM_IG) { // Javascript $js_code = ''; if (is_string($javascript)) { $javascript = array($javascript); } foreach ($javascript as $js) { $js_code .= ' <script type="text/javascript" src="' . $js . '"></script>' . "\n"; } $c .= $js_code; } $c .= ' </head>' . "\n"; $c .= ' <body ' . $events . ' ' . $style . '>' . "\n"; if (!RYZOM_IG) { $c .= ryzom_render_www(ryzom_render_window($title, $content, $homeLink)); $c .= '</body>'; if (function_exists('newrelic_get_browser_timing_header')) { $c .= newrelic_get_browser_timing_footer(); } } else { $c .= $content . '<br /><table bgcolor="#000000"><tr><td>' . ryLogger::getInstance()->getLogs() . '</td></tr></table></body>'; } $c .= '</html>' . $at_end; return $c; }
public function getContentHtml() { if (function_exists('newrelic_get_browser_timing_header') == false) { return ''; } $html = newrelic_get_browser_timing_header(true); if ($this->helper->isDebug()) { $html .= '<!-- newrelic_get_browser_timing_header() -->'; } return $html; }
function smarty_function_newrelic($params, $template) { if (!isset($params["section"])) { trigger_error("no section supplied"); } if ($params["section"] !== "header" && $params["section"] !== "footer") { trigger_error("incorrect section supplied"); } if (extension_loaded("newrelic")) { if ($params["section"] === "header") { return newrelic_get_browser_timing_header(); } return newrelic_get_browser_timing_footer(); } }
/** * Get the JavaScript for page load timing (RUM) which is to be inserted at * the beginning of the HTML output. * * @link https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-rum-header * * @param bool $tags Wrap with a `<script>` tag when set to `true` * * @return string|bool */ public function getBrowserTimingHeader($tags = true) { if (!$this->isLoaded()) { return false; } return newrelic_get_browser_timing_header($tags); }
<head> <!-- Brownie Template http://www.templatemo.com/preview/templatemo_440_brownie Credits: http://unsplash.com http://absurdwordpreferred.deviantart.com/art/FREE-Cogs-Transparent-PNG-145452644 --> <title>AWS Demo Web Application</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php newrelic_get_browser_timing_header(); ?> <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet' type='text/css'> <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="css/templatemo_style.css" rel="stylesheet" type="text/css"> <script src="Chart.min.js"></script> </head> <body> <nav id="responsive-menu"> <ul class="menu-holder"> <li class="active"><a href="#home"><i class="fa fa-home"></i>Home</a></li> <li><a href="#about"><i class="fa fa-briefcase"></i>CPU</a></li> <li><a href="#services"><i class="fa fa-cogs"></i>Memory</a></li> <li><a href="#products"><i class="fa fa-list"></i>Network</a></li> <li><a href="#contact"><i class="fa fa-envelope"></i>Disk</a></li> </ul>
/** * Returns the JavaScript string to inject as part of the header for browser timing (real user monitoring). If flag * is specified it must be a boolean, and if omitted, defaults to true. This indicates whether or not surrounding * script tags should be returned as part of the string. * * @param bool $flag * * @return $this */ public function getBrowserTimingHeader($flag = true) { if ($this->active) { newrelic_get_browser_timing_header($flag); } return $this; }
/** * Returns the JavaScript to insert in your <head>. * * Default is to return the surrounding script tags. * * @param boolean $flag If true, also returns <script> tag, else no tag. * @return string JavaScript for the timing header, empty string if extension not loaded */ public function getBrowserTimingHeader($flag = true) { if ($this->skip()) { return ''; } return newrelic_get_browser_timing_header($flag); }
/** * {@inheritdoc} */ public function getBrowserTimingHeader() { return newrelic_get_browser_timing_header(); }
public function render() { if ($this->enabled) { echo newrelic_get_browser_timing_header($this->withScriptTag); } }
public function getContentHtml() { return function_exists('newrelic_get_browser_timing_header') ? newrelic_get_browser_timing_header(true) : ''; }