Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return immediately #235

Merged
merged 1 commit into from
Dec 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions silk/code_generation/django_test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def _encode_query_params(query_params):
query_params = urlencode(query_params)
except TypeError:
pass
query_params = '?' + query_params
return query_params
return '?' + query_params


def gen(path,
Expand Down
6 changes: 2 additions & 4 deletions silk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ def bulk_create(self, *args, **kwargs):
for r in requests:
r.num_sql_queries = F('num_sql_queries') + request_counter[r.pk]
r.save()
save = super(SQLQueryManager, self).bulk_create(*args, **kwargs)
return save
return super(SQLQueryManager, self).bulk_create(*args, **kwargs)


class SQLQuery(models.Model):
Expand Down Expand Up @@ -327,5 +326,4 @@ def is_context_profile(self):

@property
def time_spent_on_sql_queries(self):
time_spent = sum(x.time_taken for x in self.queries.all())
return time_spent
return sum(x.time_taken for x in self.queries.all())
3 changes: 1 addition & 2 deletions silk/profiling/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ def _new_func_from_source(source, func):
combined.update(locals)
Logger.debug('New src_str:\n %s' % src_str)
six.exec_(src_str, combined, context)
new_func = context[func.__name__]
return new_func
return context[func.__name__]


def _inject_context_manager_func(func, start_line, end_line, name):
Expand Down
3 changes: 1 addition & 2 deletions silk/profiling/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ def wrapped_target(*args, **kwargs):
return target

def distinct_queries(self):
queries = [x for x in self._queries_after if x not in self._queries_before]
return queries
return [x for x in self._queries_after if x not in self._queries_before]


@silk_profile()
Expand Down
3 changes: 1 addition & 2 deletions silk/views/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def _get_distinct_values(self, field, silk_request):
function_names.remove('')
except ValueError:
pass
function_names = [''] + function_names
return function_names
return [''] + function_names

def _get_function_names(self, silk_request=None):
return self._get_distinct_values('func_name', silk_request)
Expand Down
2 changes: 1 addition & 1 deletion silk/views/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _get_paths(self):
def _get_status_codes(self):
return [x['status_code'] for x in Response.objects.values('status_code').distinct()]

def _get_methods(selfs):
def _get_methods(self):
return [x['method'] for x in Request.objects.values('method').distinct()]

def _get_objects(self, show=None, order_by=None, order_dir=None, path=None, filters=None):
Expand Down