Beispiel #1
0
 function loadSlowestPageViews()
 {
     global $interface;
     global $user;
     global $analytics;
     $pageView = new Analytics_PageView();
     $session = $analytics->getSessionFilters();
     if ($session != null) {
         $pageView->joinAdd($session);
     }
     $pageView->selectAdd('AVG(loadTime) as loadTime');
     $pageView->selectAdd('COUNT(analytics_page_view.id) as numViews');
     $pageView->whereAdd('loadTime > 0');
     $pageView->groupBy('module, action');
     $pageView->orderBy('loadTime DESC');
     $pageView->limit(0, 25);
     $pageView->addDateFilters();
     $slowPages = array();
     $pageView->find();
     while ($pageView->fetch()) {
         $slowPages[] = array('module' => $pageView->module, 'action' => $pageView->action, 'method' => $pageView->method, 'loadTime' => $pageView->loadTime, 'numViews' => $pageView->numViews);
     }
     $interface->assign('slowPages', $slowPages);
 }
Beispiel #2
0
 function getPageViewsByModuleAction($forGraph)
 {
     //load searches by type
     $pageViews = new Analytics_PageView();
     $pageViews->selectAdd('count(analytics_page_view.id) as numViews');
     $pageViews->selectAdd('module');
     $pageViews->selectAdd('action');
     $session = $this->getSessionFilters();
     if ($session != null) {
         $pageViews->joinAdd($session);
     }
     $pageViews->addDateFilters();
     $pageViews->groupBy('module');
     $pageViews->groupBy('action');
     $pageViews->orderBy('numViews DESC');
     if ($forGraph) {
         $pageViews->limit(0, 10);
     }
     $pageViews->find();
     $pageViewsByModuleRaw = array();
     while ($pageViews->fetch()) {
         if ($forGraph) {
             $pageViewsByModuleRaw[] = array($pageViews->module . ' - ' . $pageViews->action, (int) $pageViews->numViews);
         } else {
             $pageViewsByModuleRaw[] = array($pageViews->module, $pageViews->action, (int) $pageViews->numViews);
         }
     }
     return $pageViewsByModuleRaw;
 }