Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I determine down time from logs in database table
    primarykey
    data
    text
    <p>I have a database table which holds error logs reported from an application.</p> <p>If certain errors occur, the application requires human intervention before becoming active again.</p> <p>I need to sort through the logs and determine the total amount of time that has accrued between every pair of events. </p> <p>So when the app goes into ERROR state where intervention is required at a certain time, I need to find the elapsed time to the next error log where the app was restarted.</p> <p>Then I need to the sum of the total elapsed time between every pair of events.</p> <p>The table looks like this:</p> <pre><code>ErrorID | ErrorMessage | ErrorDateTime --------------------------------------------- 20 | ex. msg 1 | 2013-09-01 00:10:10 21 | ex. msg 2 | 2013-09-01 00:10:15 22 | ex. msg 3 | 2013-09-01 00:10:20 23 | ERROR | 2013-09-01 00:10:25 24 | ex. msg 4 | 2013-09-01 00:10:30 25 | ex. msg 5 | 2013-09-01 00:10:35 26 | ex. msg 6 | 2013-09-01 00:10:37 27 | App Restarted | 2013-09-01 00:11:30 28 | ex. msg 7 | 2013-09-01 00:11:35 29 | ex. msg 8 | 2013-09-01 00:11:40 30 | ex. msg 9 | 2013-09-01 00:11:43 31 | ERROR | 2013-09-01 00:11:45 32 | ex. msg 10 | 2013-09-01 00:12:10 33 | ex. msg 11 | 2013-09-01 00:12:20 34 | ex. msg 12 | 2013-09-01 00:12:22 35 | App Restarted | 2013-09-01 00:13:30 </code></pre> <p>So basically I need to find the difference between the timestamps of every ERROR and the subsequent App Restarted log message.</p> <p>Then get the sum of all of these durations</p> <p>Can anyone point me in the right direction?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload