-
-
Save seyhunak/6ce0755563f6f189b4c3930927605fe0 to your computer and use it in GitHub Desktop.
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 | |
(case when tile = 50 then 'Median' when tile = 95 then '95%' else '5%' end) as tile | |
, dt | |
, max(cast( ROUND(duration/1000) as numeric)/1000 ) max_duration_s | |
, min(cast( ROUND(duration/1000) as numeric)/1000 ) min_duration_s | |
from ( | |
select | |
trace_info.duration_us duration | |
, ntile(100) over (partition by (DATE(event_timestamp)) order by trace_info.duration_us) tile | |
, DATE(event_timestamp) dt | |
FROM `your-client.firebase_performance.you_project_IOS` | |
WHERE | |
DATE(_PARTITIONTIME) >= PARSE_DATE('%Y%m%d', @DS_START_DATE) | |
AND | |
DATE(_PARTITIONTIME) <= PARSE_DATE('%Y%m%d', @DS_END_DATE) | |
AND | |
date(event_timestamp) >= PARSE_DATE('%Y%m%d', @DS_START_DATE) | |
AND | |
date(event_timestamp) <= PARSE_DATE('%Y%m%d', @DS_END_DATE) | |
AND event_type = "DURATION_TRACE" | |
AND event_name = 'Logon' | |
) x | |
WHERE tile in (5, 50, 95) | |
group by dt, tile | |
order by dt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment