Created
July 2, 2020 22:33
-
-
Save jmaher/1b77b25928bcad397b978939828a1bb3 to your computer and use it in GitHub Desktop.
This file contains 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 data.date, data.project, count(distinct data.revision) as pushes, sum(data.cost) as cost, sum(data.cost)/count(distinct data.revision) as cost_per_push from ( | |
select count(distinct data.revision) as pushes, sum(data.cost) as cost, sum(data.cost)/count(distinct data.revision) as cost_per_push from ( | |
SELECT | |
DATE_TRUNC(dts.date, MONTH) as date, | |
dts.revision, | |
dts.project, | |
dts.workerType, | |
-- sum(cpw.cost) as cost | |
(sum(dts.execution)/3600)*(sum(cpw.cost)/sum(cpw.hours)) as cost | |
FROM | |
taskclusteretl.derived_task_summary as dts, | |
taskclusteretl.derived_daily_cost_per_workertype as cpw | |
WHERE | |
dts.date>='2020-04-01' | |
AND dts.date<'2020-07-01' | |
AND dts.project in ('autoland') | |
and symbol='B' and groupSymbol is NULL and kind='build' and collection='opt' | |
and (platform like 'linux64%' or platform like 'android-4-0-armv7-api16%' or platform like 'osx%' or platform like 'android-5-0-aarch64%' or platform like 'windows2012-32%' or platform like 'windows2012-64%') | |
AND dts.date=cpw.date | |
AND cpw.cluster='firefox' | |
AND cpw.hours is not null | |
AND cpw.workerType=dts.workerType | |
AND cpw.provisionerId=dts.provisionerId | |
GROUP BY | |
dts.date, | |
dts.project, | |
dts.revision, | |
dts.workerType | |
ORDER BY | |
dts.date, | |
dts.workerType | |
ASC | |
) as data | |
--group by data.date, data.project | |
--order by date asc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment