Skip to content

Commit

Permalink
Merge pull request #364 from flask-dashboard/outlier-fix
Browse files Browse the repository at this point in the history
Outlier isn't working with the stacktrace profiler
  • Loading branch information
mircealungu committed Sep 27, 2020
2 parents b8130fd + 033218a commit e568e87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions flask_monitoringdashboard/core/profiler/outlier_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,13 @@ def stop(self, duration, status_code):
def stop_by_profiler(self):
self._exit.set()

def add_outlier(self, request_id):
def add_outlier(self, session, request_id):
if self._memory:
with session_scope() as session:
add_outlier(
session,
request_id,
self._cpu_percent,
self._memory,
self._stacktrace,
self._request,
)
add_outlier(
session,
request_id,
self._cpu_percent,
self._memory,
self._stacktrace,
self._request,
)
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _on_thread_stopped(self):
self._lines_body = order_histogram(self._histogram.items())
self.insert_lines_db(session, request_id)
if self._outlier_profiler:
self._outlier_profiler.add_outlier(request_id)
self._outlier_profiler.add_outlier(session, request_id)

def insert_lines_db(self, session, request_id):
position = 0
Expand Down

0 comments on commit e568e87

Please sign in to comment.