Skip to content

Commit b3e6d51

Browse files
committed
Implement New Relic Real-time User Monitoring
1 parent bd62c68 commit b3e6d51

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

libraries/Logger.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,24 @@ protected static function &getEventTypes() {
6161
return self::$event_types;
6262
}
6363

64+
public static function getTimingHeader($tags = true) {
65+
// If $tags is true, then <script> will be included
66+
if (extension_loaded("newrelic")) {
67+
return newrelic_get_browser_timing_header($tags);
68+
} else {
69+
return "";
70+
}
71+
}
72+
73+
public static function getTimingFooter($tags = true) {
74+
// If $tags is true, then <script> will be included
75+
if (extension_loaded("newrelic")) {
76+
return newrelic_get_browser_timing_footer($tags);
77+
} else {
78+
return "";
79+
}
80+
}
81+
6482
public static function getTraceString() {
6583
ob_start();
6684
debug_print_backtrace();

templates/footer.inc.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
namespace BNETDocs\Templates;
44

55
use \BNETDocs\Libraries\Common;
6+
use \BNETDocs\Libraries\Logger;
67

78
?>
89
</main>
910
<footer<?php if (isset($slim_ui) && $slim_ui) { ?> class="slim"<?php } ?>>
1011
<a href="https://github.com/BNETDocs/bnetdocs-web" rel="external" title="Contribute to the BNETDocs source code!">BNETDocs <?php echo Common::$version->bnetdocs; ?></a> &copy; 2003-2016 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt" rel="external" title="Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International">CC-BY-NC-SA 4.0</a><br/>
1112
BNETDocs is in no way affiliated with or endorsed by Blizzard Entertainment&trade; or its brands, and is not intended to compete with or undermine Blizzard Entertainment&trade; or Battle.net&trade;. Persons using this software understand that the information provided within is collected knowledge from years of observations and may be inaccurate. All aforementioned trademarks are the property of their respective owners.<br/>
1213
</footer>
14+
<?php echo Logger::getTimingFooter(); ?>
1315
</body>
1416
</html>

templates/header.inc.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace BNETDocs\Templates;
44

55
use \BNETDocs\Libraries\Common;
6+
use \BNETDocs\Libraries\Logger;
67
use \BNETDocs\Libraries\User;
78

89
if (isset($this->getContext()->user_session)) {
@@ -20,6 +21,7 @@ if (isset($this->getContext()->user_session)) {
2021
?><!DOCTYPE html>
2122
<html lang="en-US">
2223
<head>
24+
<?php echo Logger::getTimingHeader(); ?>
2325
<title><?php echo $title; ?> - BNETDocs</title>
2426
<link rel="stylesheet" href="<?php echo Common::relativeUrlToAbsolute("/a/main.css"); ?>" type="text/css" media="all"/>
2527
<?php foreach ($this->additional_css as $path) { ?>

0 commit comments

Comments
 (0)