From e9776bd0524dca87f18fd366016b1236427d2518 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Mon, 11 Apr 2016 16:43:10 -0300 Subject: Removed general timings from methods I kept the logging functions so we can log times for tests and to investigate issues, but I removed all usages of them until someone needs them --- service/pixelated/adapter/mailstore/leap_mailstore.py | 3 --- service/pixelated/adapter/search/__init__.py | 2 -- service/pixelated/adapter/services/mail_service.py | 4 ---- service/pixelated/resources/__init__.py | 2 -- service/pixelated/resources/mails_resource.py | 2 -- 5 files changed, 13 deletions(-) (limited to 'service') diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py index cd4cb5b8..9699f134 100644 --- a/service/pixelated/adapter/mailstore/leap_mailstore.py +++ b/service/pixelated/adapter/mailstore/leap_mailstore.py @@ -25,7 +25,6 @@ from twisted.internet.defer import FirstError, DeferredList from pixelated.adapter.mailstore.body_parser import BodyParser from pixelated.adapter.mailstore.mailstore import MailStore, underscore_uuid from pixelated.adapter.model.mail import Mail, InputMail -from pixelated.support import log_time_deferred from pixelated.support.functional import to_unicode from pixelated.support import date @@ -208,7 +207,6 @@ class LeapMailStore(MailStore): defer.returnValue(leap_mail) - @log_time_deferred @defer.inlineCallbacks def get_mails(self, mail_ids, gracefully_ignore_errors=False, include_body=False): deferreds = [] @@ -229,7 +227,6 @@ class LeapMailStore(MailStore): message.get_wrapper().set_flags(tuple(mail.flags)) yield self._update_mail(message) # TODO assert this is yielded (otherwise asynchronous) - @log_time_deferred @defer.inlineCallbacks def all_mails(self, gracefully_ignore_errors=False): mdocs = yield self.soledad.get_from_index('by-type', 'meta') diff --git a/service/pixelated/adapter/search/__init__.py b/service/pixelated/adapter/search/__init__.py index 3ec6532b..e7a4e8c6 100644 --- a/service/pixelated/adapter/search/__init__.py +++ b/service/pixelated/adapter/search/__init__.py @@ -13,7 +13,6 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . -from pixelated.support import log_time from pixelated.support.encrypted_file_storage import EncryptedFileStorage import os @@ -173,7 +172,6 @@ class SearchEngine(object): results = searcher.search(query, **options) return results - @log_time def search(self, query, window=25, page=1, all_mails=False): query = self.prepare_query(query) return self._search_all_mails(query) if all_mails else self._paginated_search_mails(query, window, page) diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py index dd1a32d8..45b21310 100644 --- a/service/pixelated/adapter/services/mail_service.py +++ b/service/pixelated/adapter/services/mail_service.py @@ -25,9 +25,6 @@ from pixelated.adapter.model.status import Status from pixelated.adapter.services.tag_service import extract_reserved_tags from leap.mail.adaptors.soledad import SoledadMailAdaptor -from pixelated.support import log_time_deferred - - class MailService(object): def __init__(self, mail_sender, mail_store, search_engine, account_email, attachment_store): @@ -45,7 +42,6 @@ class MailService(object): def save_attachment(self, content, content_type): return self.attachment_store.add_attachment(content, content_type) - @log_time_deferred @defer.inlineCallbacks def mails(self, query, window_size, page): mail_ids, total = self.search_engine.search(query, window_size, page) diff --git a/service/pixelated/resources/__init__.py b/service/pixelated/resources/__init__.py index 77425cc5..02107364 100644 --- a/service/pixelated/resources/__init__.py +++ b/service/pixelated/resources/__init__.py @@ -22,7 +22,6 @@ from twisted.web.resource import Resource # from pixelated.resources.login_resource import LoginResource from pixelated.resources.session import IPixelatedSession -from pixelated.support import log_time from twisted.web.http import INTERNAL_SERVER_ERROR log = logging.getLogger(__name__) @@ -42,7 +41,6 @@ def respond_json(entity, request, status_code=200): return json_response -@log_time def respond_json_deferred(entity, request, status_code=200): json_response = json.dumps(entity, cls=SetEncoder) request.responseHeaders.addRawHeader(b"content-type", b"application/json") diff --git a/service/pixelated/resources/mails_resource.py b/service/pixelated/resources/mails_resource.py index c87d4ca2..0fcd7a12 100644 --- a/service/pixelated/resources/mails_resource.py +++ b/service/pixelated/resources/mails_resource.py @@ -11,7 +11,6 @@ from twisted.internet import defer from twisted.python.log import err from leap.common import events -from pixelated.support import log_time from pixelated.support.functional import to_unicode @@ -145,7 +144,6 @@ class MailsResource(BaseResource): if action == 'unread': return MailsUnreadResource(_mail_service) - @log_time def _build_mails_response(self, (mails, total)): return { "stats": { -- cgit v1.2.3