diff --git a/includes/api/ApiEchoNotifications.php b/includes/api/ApiEchoNotifications.php index 60c29ba1f..e1f4e83e5 100644 --- a/includes/api/ApiEchoNotifications.php +++ b/includes/api/ApiEchoNotifications.php @@ -22,7 +22,6 @@ class ApiEchoNotifications extends ApiQueryBase { if ( in_array( 'list', $prop ) ) { // Group notification results by section if ( $params['groupbysection'] ) { - wfProfileIn( __METHOD__ . '-group-by-section' ); foreach ( $params['sections'] as $section ) { $result[$section] = $this->getSectionPropList( $user, $section, $params['limit'], @@ -35,9 +34,7 @@ class ApiEchoNotifications extends ApiQueryBase { $this->getResult()->setIndexedTagName( $result[$section]['index'], 'id' ); } } - wfProfileOut( __METHOD__ . '-group-by-section' ); } else { - wfProfileIn( __METHOD__ . '-group-by-none' ); $attributeManager = EchoAttributeManager::newFromGlobalVars(); $result = $this->getPropList( $user, @@ -50,17 +47,14 @@ class ApiEchoNotifications extends ApiQueryBase { $result['index'] = $this->getPropIndex( $result['list'] ); $this->getResult()->setIndexedTagName( $result['index'], 'id' ); } - wfProfileOut( __METHOD__ . '-group-by-none' ); } } if ( in_array( 'count', $prop ) ) { - wfProfileIn( __METHOD__ . '-count' ); $result = array_merge_recursive( $result, $this->getPropcount( $user, $params['sections'], $params['groupbysection'] ) ); - wfProfileOut( __METHOD__ . '-count' ); } $this->getResult()->setIndexedTagName( $result, 'notification' ); @@ -117,7 +111,6 @@ class ApiEchoNotifications extends ApiQueryBase { // Prefer unread notifications. We don't care about next offset in this case if ( $unreadFirst ) { - wfProfileIn( __METHOD__ . '-fetch-data-unread-first' ); $notifs = $notifMapper->fetchUnreadByUser( $user, $limit, $eventTypes ); // If there are less unread notifications than we requested, // then fill the result with some read notifications @@ -136,21 +129,16 @@ class ApiEchoNotifications extends ApiQueryBase { $notifs[$notif->getEvent()->getId()] = $notif; } } - wfProfileOut( __METHOD__ . '-fetch-data-unread-first' ); } else { - wfProfileIn( __METHOD__ . '-fetch-data' ); $notifs = $notifMapper->fetchByUser( $user, $limit + 1, $continue, $eventTypes ); - wfProfileOut( __METHOD__ . '-fetch-data' ); } - wfProfileIn( __METHOD__ . '-formatting' ); foreach ( $notifs as $notif ) { $output = EchoDataOutputFormatter::formatOutput( $notif, $format, $user, $this->getLanguage() ); if ( $output !== false ) { $result['list'][$notif->getEvent()->getID()] = $output; } } - wfProfileOut( __METHOD__ . '-formatting' ); // Generate offset if necessary if ( !$unreadFirst ) {