title: Using Yappi for profiling
body: <p>When I am using cProfiler, I get the following line:</p>
  
  <pre><code> ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       39   12.486    0.320   12.486    0.320 {method 'acquire' of 'thread.lock' objects}
  </code></pre>
  
  <p>I <a href="https://stackoverflow.com/questions/653419/how-can-i-profile-a-multithread-program-in-python">understood</a> that <a href="https://pypi.python.org/pypi/yappi/" rel="noreferrer">yappi</a> is the way to go.</p>
  
  <p>So I am writing:</p>
  
  <pre><code>yappi.get_func_stats().print_all()
  </code></pre>
  
  <p>and I get too many lines to read.</p>
  
  <p>How can I retrieve only the 10 most ones that consume the most time?</p>
  
  <p>Equivalent to:</p>
  
  <pre><code>p.sort_stats('time').print_stats(10)
  </code></pre>
  
  <p>I basically want to know what consumes the most amount of time.</p>
  
  <p>I do run threads in my code with <code>ThreadPoolExecutor</code> </p>