Last active
March 27, 2017 22:09
-
-
Save rex-lin/edbb6c11f61bee64594df0cd847a3e99 to your computer and use it in GitHub Desktop.
AWS Session Duration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select date, sum(elapsed_time) as duration, count(distinct client_id) as user_count | |
| from ( | |
| select event_timestamp::date as date, EXTRACT(SECOND FROM session_stop_timestamp-session_start_timestamp) as elapsed_time, client_id | |
| from awsma.v_event | |
| where event_timestamp between '2017-03-10' and '2017-03-13' | |
| and event_type = '_session.stop' | |
| and application_sdk_name = 'aws-sdk-iOS' | |
| ) | |
| where elapsed_time <= 7200 | |
| and elapsed_time >= 0 | |
| group by 1 | |
| order by 1 asc | |
| ----- | |
| select date, sum(elapsed_time) as duration, count(distinct client_id) as user_count | |
| from ( | |
| select event_timestamp::date as date, EXTRACT(SECOND FROM session_stop_timestamp-session_start_timestamp) as elapsed_time, client_id | |
| from awsma.v_event | |
| where event_timestamp between '2017-03-10' and '2017-03-13' | |
| and event_type = '_session.stop' | |
| and application_sdk_name = 'aws-sdk-android' | |
| ) | |
| where elapsed_time <= 7200 | |
| and elapsed_time >= 0 | |
| group by 1 | |
| order by 1 asc | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment