title: how to analyze user's service usage time?
body: <p>I'm sturggling making logic with PySpark(pandas), ElasticSearch(save the results aggregated to visualize).
  (I'm newbie)</p>
  <p>if the logs comes in this way,</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>timestamp</th>
  <th>id</th>
  <th>service_id</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>15:24:33</td>
  <td>A</td>
  <td>X</td>
  </tr>
  <tr>
  <td>15:25:34</td>
  <td>A</td>
  <td>Y</td>
  </tr>
  <tr>
  <td>15:27:22</td>
  <td>A</td>
  <td>X</td>
  </tr>
  <tr>
  <td>17:33:28</td>
  <td>A</td>
  <td>Z</td>
  </tr>
  <tr>
  <td>17:35:29</td>
  <td>A</td>
  <td>Z</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The user 'A' used my service X,Y,Z (don't care about the service for now).
  How can I measure the actual time usage (for all service now; no matter what service A used) for user 'A'?</p>
  <p>Actual time: 'A' sent the logs at 15:24 ~ 15:27 so, 2 minutes,
  and at 17:33~17:35 so, another 2 minutes.
  total-&gt; 4 minutes.</p>
  <p>I have to judge that 'A' did not use my service between 15:27 ~ 17:33.</p>
  <p>I'm not asking you whole alogorithms, but just tips like useful methods or skills in python, pandas or pyspark for this situation(need to calculate summation of time differences)</p>
  <p>Because the logs come in 30m~40m per day, I have to care about the performance also.</p>
  <p>It's a bit complicated, i know. Hard to explain. Thank you.</p>