print "hhvm_newrelic_segment_end exists: " . function_exists("hhvm_newrelic_segment_end") . "\n";
print "hhvm_newrelic_get_scoped_generic_segment: " . function_exists("hhvm_newrelic_get_scoped_generic_segment") . "\n";
print "hhvm_newrelic_get_scoped_database_segment: " . function_exists("hhvm_newrelic_get_scoped_database_segment") . "\n";
print "hhvm_newrelic_get_scoped_transaction: " . function_exists("hhvm_newrelic_get_scoped_transaction") . "\n";
hhvm_newrelic_disable_instrumentation();
hhvm_newrelic_enable_instrumentation();
$transaction_id = hhvm_newrelic_transaction_begin();
print "transaction_id: " . $transaction_id . "\n";
$notice_error_error_code = hhvm_newrelic_transaction_notice_error("exception_type", "error_message", "stack_trace", "stack_frame_delimiter");
print "notice_error_error_code: " . $notice_error_error_code . "\n";
$add_attribute_error_code = hhvm_newrelic_transaction_add_attribute("attr_name", "attr_value");
print "add_attribute_error_code: " . $add_attribute_error_code . "\n";
$name_error_code = hhvm_newrelic_transaction_set_name("my_transaction");
print "name_error_code: " . $name_error_code . "\n";
$request_url_error_code = hhvm_newrelic_transaction_set_request_url("my/path");
print "request_url_error_code: " . $name_error_code . "\n";
$set_max_trace_segments_error_code = hhvm_newrelic_transaction_set_max_trace_segments(100);
print "set_max_trace_segments_error_code: " . $set_max_trace_segments_error_code . "\n";
$generic_segment_id = hhvm_newrelic_segment_generic_begin("my_segment");
print "generic_segment_id: " . $generic_segment_id . "\n";
sleep(2);
$datastore_segment_id = hhvm_newrelic_segment_datastore_begin("my_table", "select");
print "datastore_segment_id: " . $datastore_segment_id . "\n";
sleep(1);
$datastore_end_error_code = hhvm_newrelic_segment_end($datastore_segment_id);
print "datastore_end_error_code: " . $datastore_end_error_code . "\n";
$generic_end_error_code = hhvm_newrelic_segment_end($generic_segment_id);
print "generic_end_error_code: " . $generic_end_error_code . "\n";
$end_error_code = hhvm_newrelic_transaction_end();
print "end_error_code: " . $end_error_code . "\n";
scoped_test();
Beispiel #2
0
    User::autoLogin();
}
// Theme
$viewtheme = null;
if (User::isLoggedIn()) {
    $viewtheme = UserConfig::get("viewtheme");
}
$app->config(array("templates.path" => $baseDir . "templates/" . ($viewtheme ? $viewtheme : "bootstrap")));
// Error handling
$app->error(function (\Exception $e) use($app) {
    include "view/error.php";
});
// Load the routes - always keep at the bottom of the require list ;)
include "routes.php";
// Load twig stuff
include "twig.php";
// Send debug info to chrome logger
if ($debug) {
    ChromePhp::log($_SERVER);
    ChromePhp::log("Cache Used: " . Cache::getClass());
    ChromePhp::log("Queries: " . Db::getQueryCount());
    ChromePhp::log("IP Server sees: " . IP::get());
    ChromePhp::log("Page generation time (Minus queries): " . Util::pageTimer());
}
// Run the thing!
$app->run();
if ($newRelic) {
    // New Relic
    hhvm_newrelic_transaction_set_name($uri);
    hhvm_newrelic_transaction_end();
}