]> source.dussan.org Git - nextcloud-server.git/commitdiff
Log some additional events
authorRobin Appelman <icewind@owncloud.com>
Wed, 15 Oct 2014 11:53:19 +0000 (13:53 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 20 Oct 2014 11:38:38 +0000 (13:38 +0200)
lib/base.php
lib/private/route/router.php

index 1201e46d5428a5b618f27da82ba5588694cee756..ef654e916eaacf0d13673ee261315d593044c48e 100644 (file)
@@ -444,6 +444,7 @@ class OC {
 
        public static function init() {
                // register autoloader
+               $loaderStart = microtime(true);
                require_once __DIR__ . '/autoloader.php';
                self::$loader = new \OC\Autoloader();
                self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib');
@@ -453,10 +454,12 @@ class OC {
                self::$loader->registerPrefix('Patchwork', '3rdparty');
                self::$loader->registerPrefix('Pimple', '3rdparty/Pimple');
                spl_autoload_register(array(self::$loader, 'load'));
+               $loaderEnd = microtime(true);
 
                // setup the basic server
                self::$server = new \OC\Server();
                self::initPaths();
+               \OC::$server->getEventLogger()->log('autoloader', 'Autoloader', $loaderStart, $loaderEnd);
                \OC::$server->getEventLogger()->start('boot', 'Initialize');
 
                // set some stuff
index fd6d9939184ec4614f18cde4eb12f93e3b5e7258..645d6141964f1116ed4edcdfb560ad258c061573 100644 (file)
@@ -106,6 +106,7 @@ class Router implements IRouter {
         * @return void
         */
        public function loadRoutes($app = null) {
+               $requestedApp = $app;
                if ($this->loaded) {
                        return;
                }
@@ -123,6 +124,7 @@ class Router implements IRouter {
                                $routingFiles = array();
                        }
                }
+               \OC::$server->getEventLogger()->start('loadroutes' . $requestedApp, 'Loading Routes');
                foreach ($routingFiles as $app => $file) {
                        if (!isset($this->loadedApps[$app])) {
                                $this->loadedApps[$app] = true;
@@ -145,6 +147,7 @@ class Router implements IRouter {
                        $collection->addPrefix('/ocs');
                        $this->root->addCollection($collection);
                }
+               \OC::$server->getEventLogger()->end('loadroutes' . $requestedApp);
        }
 
        /**
@@ -202,7 +205,6 @@ class Router implements IRouter {
         * @return void
         */
        public function match($url) {
-               \OC::$server->getEventLogger()->start('load_routes', 'Load routes');
                if (substr($url, 0, 6) === '/apps/') {
                        // empty string / 'apps' / $app / rest of the route
                        list(, , $app,) = explode('/', $url, 4);
@@ -217,7 +219,6 @@ class Router implements IRouter {
                } else {
                        $this->loadRoutes();
                }
-               \OC::$server->getEventLogger()->end('load_routes');
 
                $matcher = new UrlMatcher($this->root, $this->context);
                try {