hello_modified.py 135 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819
  1. import datetime
  2. import pytz
  3. from snuba_sdk.aliased_expression import AliasedExpression
  4. from snuba_sdk.column import Column
  5. from snuba_sdk.conditions import And, BooleanCondition, Condition, Op, Or
  6. from snuba_sdk.entity import Entity
  7. from snuba_sdk.expressions import Granularity, Limit, Offset
  8. from snuba_sdk.function import CurriedFunction, Function
  9. from snuba_sdk.orderby import Direction, LimitBy, OrderBy
  10. from snuba_sdk.query import Query
  11. table_queries = [
  12. {
  13. "match": Entity("metrics_distributions"),
  14. "select": [
  15. Function(
  16. function="p50",
  17. initializers=None,
  18. parameters=[Column("transaction.duration")],
  19. alias="p50",
  20. ),
  21. ],
  22. "groupby": [
  23. AliasedExpression(
  24. exp=Column("transaction"),
  25. alias="transaction",
  26. )
  27. ],
  28. "array_join": None,
  29. "where": [
  30. Condition(
  31. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  32. op=Op.GTE,
  33. rhs=datetime.datetime(2022, 3, 24, 11, 11, 33, 21219, tzinfo=pytz.utc),
  34. ),
  35. Condition(
  36. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  37. op=Op.LT,
  38. rhs=datetime.datetime(2022, 6, 22, 11, 11, 33, 21219, tzinfo=pytz.utc),
  39. ),
  40. Condition(
  41. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  42. op=Op.IN,
  43. rhs=[2],
  44. ),
  45. Condition(
  46. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  47. op=Op.EQ,
  48. rhs=2,
  49. ),
  50. ],
  51. "having": [],
  52. "orderby": [
  53. OrderBy(
  54. exp=Function(
  55. function="p50",
  56. initializers=None,
  57. parameters=["transaction.duration"],
  58. alias="p50",
  59. ),
  60. direction=Direction.ASC,
  61. )
  62. ],
  63. "limitby": None,
  64. "limit": Limit(limit=51),
  65. "offset": Offset(offset=0),
  66. "granularity": None,
  67. "totals": None,
  68. }, # Transformed and Added
  69. {
  70. "match": Entity("metrics_sets"),
  71. "select": [
  72. Function(
  73. function="count_unique",
  74. initializers=None,
  75. parameters=[
  76. Column("transaction.user"),
  77. ],
  78. alias="count_unique_user",
  79. ),
  80. AliasedExpression(
  81. exp=Column("transaction"),
  82. alias="transaction",
  83. ),
  84. ],
  85. "groupby": [
  86. AliasedExpression(
  87. exp=Column("transaction"),
  88. alias="transaction",
  89. )
  90. ],
  91. "array_join": None,
  92. "where": [
  93. Condition(
  94. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  95. op=Op.GTE,
  96. rhs=datetime.datetime(2022, 3, 24, 11, 11, 33, 21219, tzinfo=pytz.utc),
  97. ),
  98. Condition(
  99. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  100. op=Op.LT,
  101. rhs=datetime.datetime(2022, 6, 22, 11, 11, 33, 21219, tzinfo=pytz.utc),
  102. ),
  103. Condition(
  104. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  105. op=Op.IN,
  106. rhs=[2],
  107. ),
  108. Condition(
  109. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  110. op=Op.EQ,
  111. rhs=2,
  112. ),
  113. Condition(
  114. lhs=Function(
  115. function="tuple",
  116. initializers=None,
  117. parameters=[Column("transaction")],
  118. alias=None,
  119. ),
  120. op=Op.IN,
  121. rhs=Function(
  122. function="tuple", initializers=None, parameters=[(12,), (17,)], alias=None
  123. ),
  124. ),
  125. ],
  126. "having": [],
  127. "orderby": [],
  128. "limitby": None,
  129. "limit": Limit(limit=51),
  130. "offset": Offset(offset=0),
  131. "granularity": None,
  132. "totals": None,
  133. }, # Transformed and added
  134. {
  135. "match": Entity("metrics_distributions"),
  136. "select": [
  137. Function(
  138. function="p50",
  139. initializers=None,
  140. parameters=[Column("transaction.duration")],
  141. alias="p50_transaction_duration",
  142. ),
  143. AliasedExpression(
  144. exp=Column("transaction"),
  145. alias="transaction",
  146. ),
  147. ],
  148. "groupby": [
  149. Column("project_id"),
  150. AliasedExpression(
  151. exp=Column("transaction"),
  152. alias="transaction",
  153. ),
  154. ],
  155. "array_join": None,
  156. "where": [
  157. Condition(
  158. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  159. op=Op.GTE,
  160. rhs=datetime.datetime(2022, 3, 24, 11, 11, 34, 26663, tzinfo=pytz.utc),
  161. ),
  162. Condition(
  163. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  164. op=Op.LT,
  165. rhs=datetime.datetime(2022, 6, 22, 11, 11, 34, 26663, tzinfo=pytz.utc),
  166. ),
  167. Condition(
  168. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  169. op=Op.IN,
  170. rhs=[5],
  171. ),
  172. Condition(
  173. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  174. op=Op.EQ,
  175. rhs=5,
  176. ),
  177. ],
  178. "having": [],
  179. "orderby": [],
  180. "limitby": None,
  181. "limit": Limit(limit=51),
  182. "offset": Offset(offset=0),
  183. "granularity": None,
  184. "totals": None,
  185. }, # Transformed + discarded
  186. {
  187. "match": Entity("metrics_distributions"),
  188. "select": [
  189. Function(
  190. function="p50",
  191. initializers=None,
  192. parameters=[Column("transaction.duration")],
  193. alias="p50_transaction_duration",
  194. ),
  195. ],
  196. "groupby": [
  197. Column("project_id"),
  198. AliasedExpression(
  199. exp=Column("transaction"),
  200. alias="transaction",
  201. ),
  202. ],
  203. "array_join": None,
  204. "where": [
  205. Condition(
  206. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  207. op=Op.GTE,
  208. rhs=datetime.datetime(2022, 3, 24, 11, 11, 34, 303387, tzinfo=pytz.utc),
  209. ),
  210. Condition(
  211. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  212. op=Op.LT,
  213. rhs=datetime.datetime(2022, 6, 22, 11, 11, 34, 303387, tzinfo=pytz.utc),
  214. ),
  215. Condition(
  216. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  217. op=Op.IN,
  218. rhs=[6],
  219. ),
  220. Condition(
  221. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  222. op=Op.EQ,
  223. rhs=6,
  224. ),
  225. ],
  226. "having": [],
  227. "orderby": [],
  228. "limitby": None,
  229. "limit": Limit(limit=51),
  230. "offset": Offset(offset=0),
  231. "granularity": None,
  232. "totals": None,
  233. }, # Transformed + discarded
  234. {
  235. "match": Entity("metrics_distributions"),
  236. "select": [
  237. Function(
  238. function="count_web_vitals_measurements",
  239. initializers=None,
  240. parameters=[Column("transaction.measurements.lcp"), "good"],
  241. alias="count_web_vitals_measurements_cls_good",
  242. ),
  243. Function(
  244. function="count_web_vitals_measurements",
  245. initializers=None,
  246. parameters=[Column("transaction.measurements.fid"), "meh"],
  247. alias="count_web_vitals_measurements_fid_meh",
  248. ),
  249. Function(
  250. function="count_web_vitals_measurements",
  251. initializers=None,
  252. parameters=[Column("transactions.measurements.fp"), "good"],
  253. alias="count_web_vitals_measurements_fp_good",
  254. ),
  255. Function(
  256. function="count_web_vitals_measurements",
  257. initializers=None,
  258. parameters=[Column("transaction.measurements.lcp"), "good"],
  259. alias="count_web_vitals_measurements_lcp_good",
  260. ),
  261. Function(
  262. function="count_web_vitals_measurements",
  263. initializers=None,
  264. parameters=[Column("transaction.measurements.fcp"), "meh"],
  265. alias="count_web_vitals_measurements_fcp_meh",
  266. ),
  267. ],
  268. "groupby": [
  269. AliasedExpression(
  270. exp=Column("transaction"),
  271. alias="transaction",
  272. )
  273. ],
  274. "array_join": None,
  275. "where": [
  276. Condition(
  277. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  278. op=Op.GTE,
  279. rhs=datetime.datetime(2022, 3, 24, 11, 11, 35, 447729, tzinfo=pytz.utc),
  280. ),
  281. Condition(
  282. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  283. op=Op.LT,
  284. rhs=datetime.datetime(2022, 6, 22, 11, 11, 35, 447729, tzinfo=pytz.utc),
  285. ),
  286. Condition(
  287. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  288. op=Op.IN,
  289. rhs=[11],
  290. ),
  291. Condition(
  292. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  293. op=Op.EQ,
  294. rhs=11,
  295. ),
  296. ],
  297. "having": [],
  298. "orderby": [],
  299. "limitby": None,
  300. "limit": Limit(limit=51),
  301. "offset": Offset(offset=0),
  302. "granularity": None,
  303. "totals": None,
  304. }, # Transformed + added
  305. {
  306. "match": Entity("metrics_distributions"),
  307. "select": [
  308. Function(
  309. function="count_web_vitals_measurements",
  310. initializers=None,
  311. parameters=[Column("transaction.measurements.lcp"), "poor"],
  312. alias="count_web_vitals_measurements_lcp_poor",
  313. ),
  314. ],
  315. "groupby": [
  316. AliasedExpression(
  317. exp=Column("transaction"),
  318. alias="transaction",
  319. )
  320. ],
  321. "array_join": None,
  322. "where": [
  323. Condition(
  324. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  325. op=Op.GTE,
  326. rhs=datetime.datetime(2022, 3, 24, 11, 11, 35, 707018, tzinfo=pytz.utc),
  327. ),
  328. Condition(
  329. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  330. op=Op.LT,
  331. rhs=datetime.datetime(2022, 6, 22, 11, 11, 35, 707018, tzinfo=pytz.utc),
  332. ),
  333. Condition(
  334. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  335. op=Op.IN,
  336. rhs=[12],
  337. ),
  338. Condition(
  339. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  340. op=Op.EQ,
  341. rhs=12,
  342. ),
  343. ],
  344. "having": [],
  345. "orderby": [],
  346. "limitby": None,
  347. "limit": Limit(limit=51),
  348. "offset": Offset(offset=0),
  349. "granularity": None,
  350. "totals": None,
  351. }, # Transformed + discarded
  352. {
  353. "match": Entity("metrics_distributions"),
  354. "select": [
  355. Function(
  356. function="p95",
  357. initializers=None,
  358. parameters=[Column("transaction.duration")],
  359. alias="p95",
  360. ),
  361. Function(
  362. function="rate",
  363. initializers=None,
  364. parameters=[
  365. Column("transaction.duration"),
  366. 60,
  367. 7776000.0,
  368. ],
  369. alias="epm",
  370. ),
  371. Function(
  372. function="failure_rate",
  373. initializers=None,
  374. parameters=[],
  375. alias="failure_rate",
  376. ),
  377. ],
  378. "groupby": [
  379. AliasedExpression(
  380. exp=Column("transaction.status"),
  381. alias="transaction.status",
  382. ),
  383. Function(
  384. function="toInt8", initializers=None, parameters=[0], alias="team_key_transaction"
  385. ),
  386. AliasedExpression(exp=Column("transaction"), alias="transaction"),
  387. Column("project_id"),
  388. ],
  389. "array_join": None,
  390. "where": [
  391. Condition(
  392. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  393. op=Op.GTE,
  394. rhs=datetime.datetime(2022, 3, 24, 11, 11, 36, 75132, tzinfo=pytz.utc),
  395. ),
  396. Condition(
  397. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  398. op=Op.LT,
  399. rhs=datetime.datetime(2022, 6, 22, 11, 11, 36, 75132, tzinfo=pytz.utc),
  400. ),
  401. Condition(
  402. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  403. op=Op.IN,
  404. rhs=[13],
  405. ),
  406. Condition(
  407. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  408. op=Op.EQ,
  409. rhs=14,
  410. ),
  411. ],
  412. "having": [],
  413. "orderby": [
  414. OrderBy(
  415. exp=Function(
  416. function="p95",
  417. initializers=None,
  418. parameters=["transaction.duration"],
  419. alias="p95",
  420. ),
  421. direction=Direction.ASC,
  422. )
  423. ],
  424. "limitby": None,
  425. "limit": Limit(limit=51),
  426. "offset": Offset(offset=0),
  427. "granularity": None,
  428. "totals": None,
  429. }, # Transformed + added
  430. {
  431. "match": Entity("metrics_distributions"),
  432. "select": [
  433. Function(
  434. function="p50",
  435. initializers=None,
  436. parameters=["transaction.duration"],
  437. alias="p50",
  438. )
  439. ],
  440. "groupby": [],
  441. "array_join": None,
  442. "where": [
  443. Condition(
  444. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  445. op=Op.GTE,
  446. rhs=datetime.datetime(2022, 3, 24, 11, 11, 36, 936975, tzinfo=pytz.utc),
  447. ),
  448. Condition(
  449. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  450. op=Op.LT,
  451. rhs=datetime.datetime(2022, 6, 22, 11, 11, 36, 936975, tzinfo=pytz.utc),
  452. ),
  453. Condition(
  454. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  455. op=Op.IN,
  456. rhs=[17],
  457. ),
  458. Condition(
  459. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  460. op=Op.EQ,
  461. rhs=18,
  462. ),
  463. ],
  464. "having": [],
  465. "orderby": [],
  466. "limitby": None,
  467. "limit": Limit(limit=101),
  468. "offset": Offset(offset=0),
  469. "granularity": None,
  470. "totals": None,
  471. }, # Transformed + discarded
  472. {
  473. "match": Entity("metrics_distributions"),
  474. "select": [
  475. Function(
  476. function="apdex",
  477. initializers=None,
  478. parameters=[],
  479. alias="apdex",
  480. ),
  481. Function(
  482. function="p75",
  483. initializers=None,
  484. parameters=[
  485. Column("transaction.measurements.cls"),
  486. ],
  487. alias="p75_measurements_cls",
  488. ),
  489. Function(
  490. function="divide",
  491. initializers=None,
  492. parameters=[
  493. Column("transaction.duration"),
  494. 60,
  495. 7776000.0,
  496. ],
  497. alias="tpm",
  498. ),
  499. Function(
  500. function="p75",
  501. initializers=None,
  502. parameters=[Column("transaction.measurements.fid")],
  503. alias="p75_measurements_fid",
  504. ),
  505. AliasedExpression(
  506. exp=Column("transaction"),
  507. alias="transaction",
  508. ),
  509. Function(
  510. function="p75",
  511. initializers=None,
  512. parameters=[Column("transaction.measurements.fcp")],
  513. alias="p75_measurements_fcp",
  514. ),
  515. Function(
  516. function="p75",
  517. initializers=None,
  518. parameters=[Column("transaction.measurements.lcp")],
  519. alias="p75_measurements_lcp",
  520. ),
  521. ],
  522. "groupby": [
  523. AliasedExpression(
  524. exp=Column("transaction"),
  525. alias="transaction",
  526. ),
  527. Column("project_id"),
  528. ],
  529. "array_join": None,
  530. "where": [
  531. Condition(
  532. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  533. op=Op.GTE,
  534. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 278535, tzinfo=pytz.utc),
  535. ),
  536. Condition(
  537. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  538. op=Op.LT,
  539. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 278535, tzinfo=pytz.utc),
  540. ),
  541. Condition(
  542. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  543. op=Op.IN,
  544. rhs=[18],
  545. ),
  546. Condition(
  547. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  548. op=Op.EQ,
  549. rhs=19,
  550. ),
  551. ],
  552. "having": [],
  553. "orderby": [],
  554. "limitby": None,
  555. "limit": Limit(limit=51),
  556. "offset": Offset(offset=0),
  557. "granularity": None,
  558. "totals": None,
  559. }, # Transformed + added
  560. {
  561. "match": Entity("metrics_sets"),
  562. "select": [
  563. Function(
  564. function="count_unique",
  565. initializers=None,
  566. parameters=[
  567. Column("transaction.user"),
  568. ],
  569. alias="count_unique_user",
  570. ),
  571. AliasedExpression(
  572. exp=Column("transaction"),
  573. alias="transaction",
  574. ),
  575. Function(
  576. function="transaction.miserable_user",
  577. initializers=None,
  578. parameters=[],
  579. alias="count_miserable_user",
  580. ),
  581. Function(
  582. function="user_misery",
  583. initializers=None,
  584. parameters=[],
  585. alias="user_misery",
  586. ),
  587. ],
  588. "groupby": [
  589. AliasedExpression(
  590. exp=Column("transaction"),
  591. alias="transaction",
  592. ),
  593. Column("project_id"),
  594. ],
  595. "array_join": None,
  596. "where": [
  597. Condition(
  598. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  599. op=Op.GTE,
  600. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 278535, tzinfo=pytz.utc),
  601. ),
  602. Condition(
  603. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  604. op=Op.LT,
  605. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 278535, tzinfo=pytz.utc),
  606. ),
  607. Condition(
  608. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  609. op=Op.IN,
  610. rhs=[18],
  611. ),
  612. Condition(
  613. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  614. op=Op.EQ,
  615. rhs=19,
  616. ),
  617. Condition(
  618. lhs=Function(
  619. function="tuple",
  620. initializers=None,
  621. parameters=[
  622. Column("transaction"),
  623. Column("project_id"),
  624. ],
  625. alias=None,
  626. ),
  627. op=Op.IN,
  628. rhs=Function(
  629. function="tuple", initializers=None, parameters=[(437, "bar")], alias=None
  630. ),
  631. ),
  632. ],
  633. "having": [],
  634. "orderby": [],
  635. "limitby": None,
  636. "limit": Limit(limit=51),
  637. "offset": Offset(offset=0),
  638. "granularity": None,
  639. "totals": None,
  640. }, # Transformed + discarded
  641. {
  642. "match": Entity("metrics_distributions"),
  643. "select": [
  644. Function(
  645. function="apdex",
  646. initializers=None,
  647. parameters=[],
  648. alias="apdex",
  649. ),
  650. Function(
  651. function="p75",
  652. initializers=None,
  653. parameters=[Column("transaction.measurements.cls")],
  654. alias="p75_measurements_cls",
  655. ),
  656. Function(
  657. function="rate",
  658. initializers=None,
  659. parameters=[
  660. Column("transaction.duration"),
  661. 60,
  662. 7776000.0,
  663. ],
  664. alias="tpm",
  665. ),
  666. Function(
  667. function="p75",
  668. initializers=None,
  669. parameters=[Column("transaction.measurements.fid")],
  670. alias="p75_measurements_fid",
  671. ),
  672. Function(
  673. function="p75",
  674. initializers=None,
  675. parameters=[Column("transaction.measurements.fcp")],
  676. alias="p75_measurements_fcp",
  677. ),
  678. Function(
  679. function="p75",
  680. initializers=None,
  681. parameters=[Column("transaction.measurements.lcp")],
  682. alias="p75_measurements_lcp",
  683. ),
  684. ],
  685. "groupby": [
  686. AliasedExpression(
  687. exp=Column("transaction"),
  688. alias="transaction",
  689. ),
  690. Column("project_id"),
  691. ],
  692. "array_join": None,
  693. "where": [
  694. Condition(
  695. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  696. op=Op.GTE,
  697. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 440461, tzinfo=pytz.utc),
  698. ),
  699. Condition(
  700. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  701. op=Op.LT,
  702. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 440461, tzinfo=pytz.utc),
  703. ),
  704. Condition(
  705. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  706. op=Op.IN,
  707. rhs=[18],
  708. ),
  709. Condition(
  710. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  711. op=Op.EQ,
  712. rhs=19,
  713. ),
  714. ],
  715. "having": [],
  716. "orderby": [],
  717. "limitby": None,
  718. "limit": Limit(limit=51),
  719. "offset": Offset(offset=0),
  720. "granularity": None,
  721. "totals": None,
  722. }, # Transformed + discarded
  723. {
  724. "match": Entity("metrics_sets"),
  725. "select": [
  726. Function(
  727. function="count_unique",
  728. initializers=None,
  729. parameters=[
  730. Column("transaction.user"),
  731. ],
  732. alias="count_unique_user",
  733. ),
  734. AliasedExpression(
  735. exp=Column("transaction"),
  736. alias="transaction",
  737. ),
  738. Function(
  739. function="transaction.miserable_user",
  740. initializers=None,
  741. parameters=[],
  742. alias="count_miserable_user",
  743. ),
  744. Function(
  745. function="user_misery",
  746. initializers=None,
  747. parameters=[],
  748. alias="user_misery",
  749. ),
  750. ],
  751. "groupby": [
  752. AliasedExpression(
  753. exp=Column("transaction"),
  754. alias="transaction",
  755. ),
  756. Column("project_id"),
  757. ],
  758. "array_join": None,
  759. "where": [
  760. Condition(
  761. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  762. op=Op.GTE,
  763. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 440461, tzinfo=pytz.utc),
  764. ),
  765. Condition(
  766. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  767. op=Op.LT,
  768. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 440461, tzinfo=pytz.utc),
  769. ),
  770. Condition(
  771. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  772. op=Op.IN,
  773. rhs=[18],
  774. ),
  775. Condition(
  776. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  777. op=Op.EQ,
  778. rhs=19,
  779. ),
  780. Condition(
  781. lhs=Function(
  782. function="tuple",
  783. initializers=None,
  784. parameters=[Column("transaction"), Column("project_id")],
  785. alias=None,
  786. ),
  787. op=Op.IN,
  788. rhs=Function(
  789. function="tuple", initializers=None, parameters=[(437, 18)], alias=None
  790. ),
  791. ),
  792. ],
  793. "having": [],
  794. "orderby": [],
  795. "limitby": None,
  796. "limit": Limit(limit=51),
  797. "offset": Offset(offset=0),
  798. "granularity": None,
  799. "totals": None,
  800. }, # Transformed + discarded
  801. {
  802. "match": Entity("metrics_distributions"),
  803. "select": [
  804. Function(
  805. function="rate",
  806. initializers=None,
  807. parameters=[
  808. Column("transaction.duration"),
  809. 60,
  810. 7776000.0,
  811. ],
  812. alias="epm",
  813. ),
  814. AliasedExpression(
  815. exp=Column("environment"),
  816. alias="environment",
  817. ),
  818. ],
  819. "groupby": [
  820. Column("project_id"),
  821. AliasedExpression(
  822. exp=Column("environment"),
  823. alias="environment",
  824. ),
  825. ],
  826. "array_join": None,
  827. "where": [
  828. Condition(
  829. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  830. op=Op.GTE,
  831. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 719279, tzinfo=pytz.utc),
  832. ),
  833. Condition(
  834. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  835. op=Op.LT,
  836. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 719279, tzinfo=pytz.utc),
  837. ),
  838. Condition(
  839. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  840. op=Op.IN,
  841. rhs=[19],
  842. ),
  843. Condition(
  844. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  845. op=Op.EQ,
  846. rhs=20,
  847. ),
  848. ],
  849. "having": [],
  850. "orderby": [],
  851. "limitby": None,
  852. "limit": Limit(limit=51),
  853. "offset": Offset(offset=0),
  854. "granularity": None,
  855. "totals": None,
  856. }, # Transformed + discarded
  857. {
  858. "match": Entity("metrics_distributions"),
  859. "select": [
  860. Function(
  861. function="p95",
  862. initializers=None,
  863. parameters=["transaction.duration"],
  864. alias="p95",
  865. ),
  866. Function(
  867. function="rate",
  868. initializers=None,
  869. parameters=[
  870. Column("transaction.duration"),
  871. 60,
  872. 7776000.0,
  873. ],
  874. alias="epm",
  875. ),
  876. Function(
  877. function="failure_rate",
  878. initializers=None,
  879. parameters=[],
  880. alias="failure_rate",
  881. ),
  882. ],
  883. "groupby": [
  884. AliasedExpression(
  885. exp=Column("transaction.status"),
  886. alias="transaction.status",
  887. ),
  888. Function(
  889. function="in",
  890. initializers=None,
  891. parameters=[
  892. (
  893. Column(name="project_id", entity=None, subscriptable=None, key=None),
  894. Column("transaction"),
  895. ),
  896. [(20, 487)],
  897. ],
  898. alias="team_key_transaction",
  899. ),
  900. AliasedExpression(
  901. exp=Column("transaction"),
  902. alias="transaction",
  903. ),
  904. Column("project_id"),
  905. ],
  906. "array_join": None,
  907. "where": [
  908. Condition(
  909. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  910. op=Op.GTE,
  911. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 32475, tzinfo=pytz.utc),
  912. ),
  913. Condition(
  914. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  915. op=Op.LT,
  916. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 32475, tzinfo=pytz.utc),
  917. ),
  918. Condition(
  919. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  920. op=Op.IN,
  921. rhs=[20],
  922. ),
  923. Condition(
  924. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  925. op=Op.EQ,
  926. rhs=21,
  927. ),
  928. ],
  929. "having": [],
  930. "orderby": [
  931. OrderBy(
  932. exp=Function(
  933. function="in",
  934. initializers=None,
  935. parameters=[
  936. (
  937. Column(name="project_id", entity=None, subscriptable=None, key=None),
  938. Column("transaction"),
  939. ),
  940. [(20, 487)],
  941. ],
  942. alias="team_key_transaction",
  943. ),
  944. direction=Direction.ASC,
  945. ),
  946. OrderBy(
  947. exp=Function(
  948. function="p95",
  949. initializers=None,
  950. parameters=["transaction.duration"],
  951. alias="p95",
  952. ),
  953. direction=Direction.ASC,
  954. ),
  955. ],
  956. "limitby": None,
  957. "limit": Limit(limit=51),
  958. "offset": Offset(offset=0),
  959. "granularity": None,
  960. "totals": None,
  961. }, # Transformed + discarded
  962. {
  963. "match": Entity("metrics_distributions"),
  964. "select": [
  965. Function(
  966. function="p95",
  967. initializers=None,
  968. parameters=["transaction.duration"],
  969. alias="p95",
  970. ),
  971. Function(
  972. function="rate",
  973. initializers=None,
  974. parameters=[
  975. Column("transaction.duration"),
  976. 60,
  977. 7776000.0,
  978. ],
  979. alias="epm",
  980. ),
  981. Function(
  982. function="failure_rate",
  983. initializers=None,
  984. parameters=[],
  985. alias="failure_rate",
  986. ),
  987. ],
  988. "groupby": [
  989. AliasedExpression(
  990. exp=Column("transaction.status"),
  991. alias="transaction.status",
  992. ),
  993. Function(
  994. function="in",
  995. initializers=None,
  996. parameters=[
  997. (
  998. Column(name="project_id", entity=None, subscriptable=None, key=None),
  999. Column("transaction"),
  1000. ),
  1001. [(20, 487)],
  1002. ],
  1003. alias="team_key_transaction",
  1004. ),
  1005. AliasedExpression(
  1006. exp=Column("transaction"),
  1007. alias="transaction",
  1008. ),
  1009. Column("project_id"),
  1010. ],
  1011. "array_join": None,
  1012. "where": [
  1013. Condition(
  1014. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1015. op=Op.GTE,
  1016. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 127281, tzinfo=pytz.utc),
  1017. ),
  1018. Condition(
  1019. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1020. op=Op.LT,
  1021. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 127281, tzinfo=pytz.utc),
  1022. ),
  1023. Condition(
  1024. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1025. op=Op.IN,
  1026. rhs=[20],
  1027. ),
  1028. Condition(
  1029. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1030. op=Op.EQ,
  1031. rhs=21,
  1032. ),
  1033. ],
  1034. "having": [],
  1035. "orderby": [
  1036. OrderBy(
  1037. exp=Function(
  1038. function="in",
  1039. initializers=None,
  1040. parameters=[
  1041. (
  1042. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1043. Column("transaction"),
  1044. ),
  1045. [(20, 487)],
  1046. ],
  1047. alias="team_key_transaction",
  1048. ),
  1049. direction=Direction.ASC,
  1050. ),
  1051. OrderBy(
  1052. exp=Function(
  1053. function="p95",
  1054. initializers=None,
  1055. parameters=["transaction.duration"],
  1056. alias="p95",
  1057. ),
  1058. direction=Direction.ASC,
  1059. ),
  1060. ],
  1061. "limitby": None,
  1062. "limit": Limit(limit=51),
  1063. "offset": Offset(offset=0),
  1064. "granularity": None,
  1065. "totals": None,
  1066. }, # Transformed + discarded
  1067. {
  1068. "match": Entity("metrics_distributions"),
  1069. "select": [
  1070. Function(
  1071. function="p95",
  1072. initializers=None,
  1073. parameters=["transaction.duration"],
  1074. alias="p95",
  1075. ),
  1076. Function(
  1077. function="rate",
  1078. initializers=None,
  1079. parameters=[
  1080. Column("transaction.duration"),
  1081. 60,
  1082. 7776000,
  1083. ],
  1084. alias="epm",
  1085. ),
  1086. Function(
  1087. function="failure_rate",
  1088. initializers=None,
  1089. parameters=[],
  1090. alias="failure_rate",
  1091. ),
  1092. ],
  1093. "groupby": [
  1094. AliasedExpression(
  1095. exp=Column("transaction.status"),
  1096. alias="transaction.status",
  1097. ),
  1098. Function(
  1099. function="in",
  1100. initializers=None,
  1101. parameters=[
  1102. (
  1103. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1104. Column("transaction"),
  1105. ),
  1106. [(21, 508), (21, 512)],
  1107. ],
  1108. alias="team_key_transaction",
  1109. ),
  1110. AliasedExpression(
  1111. exp=Column("transaction"),
  1112. alias="transaction",
  1113. ),
  1114. Column("project_id"),
  1115. ],
  1116. "array_join": None,
  1117. "where": [
  1118. Condition(
  1119. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1120. op=Op.GTE,
  1121. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 458313, tzinfo=pytz.utc),
  1122. ),
  1123. Condition(
  1124. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1125. op=Op.LT,
  1126. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 458313, tzinfo=pytz.utc),
  1127. ),
  1128. Condition(
  1129. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1130. op=Op.IN,
  1131. rhs=[21],
  1132. ),
  1133. Condition(
  1134. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1135. op=Op.EQ,
  1136. rhs=22,
  1137. ),
  1138. ],
  1139. "having": [],
  1140. "orderby": [
  1141. OrderBy(
  1142. exp=Function(
  1143. function="in",
  1144. initializers=None,
  1145. parameters=[
  1146. (
  1147. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1148. Column("transaction"),
  1149. ),
  1150. [(21, 508), (21, 512)],
  1151. ],
  1152. alias="team_key_transaction",
  1153. ),
  1154. direction=Direction.ASC,
  1155. ),
  1156. OrderBy(
  1157. exp=Function(
  1158. function="p95",
  1159. initializers=None,
  1160. parameters=["transaction.duration"],
  1161. alias="p95",
  1162. ),
  1163. direction=Direction.ASC,
  1164. ),
  1165. ],
  1166. "limitby": None,
  1167. "limit": Limit(limit=51),
  1168. "offset": Offset(offset=0),
  1169. "granularity": None,
  1170. "totals": None,
  1171. }, # Transformed
  1172. {
  1173. "match": Entity("metrics_distributions"),
  1174. "select": [
  1175. Function(
  1176. function="p95",
  1177. initializers=None,
  1178. parameters=["transaction.duration"],
  1179. alias="p95",
  1180. ),
  1181. Function(
  1182. function="rate",
  1183. initializers=None,
  1184. parameters=[Column("transaction.duration"), 60, 7776000],
  1185. alias="epm",
  1186. ),
  1187. Function(
  1188. function="failure_rate",
  1189. initializers=None,
  1190. parameters=[],
  1191. alias="failure_rate",
  1192. ),
  1193. ],
  1194. "groupby": [
  1195. AliasedExpression(
  1196. exp=Column("transaction.status"),
  1197. alias="transaction.status",
  1198. ),
  1199. Function(
  1200. function="in",
  1201. initializers=None,
  1202. parameters=[
  1203. (
  1204. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1205. Column("transaction"),
  1206. ),
  1207. [(21, 508), (21, 512)],
  1208. ],
  1209. alias="team_key_transaction",
  1210. ),
  1211. AliasedExpression(
  1212. exp=Column("transaction"),
  1213. alias="transaction",
  1214. ),
  1215. Column("project_id"),
  1216. ],
  1217. "array_join": None,
  1218. "where": [
  1219. Condition(
  1220. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1221. op=Op.GTE,
  1222. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 552260, tzinfo=pytz.utc),
  1223. ),
  1224. Condition(
  1225. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1226. op=Op.LT,
  1227. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 552260, tzinfo=pytz.utc),
  1228. ),
  1229. Condition(
  1230. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1231. op=Op.IN,
  1232. rhs=[21],
  1233. ),
  1234. Condition(
  1235. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1236. op=Op.EQ,
  1237. rhs=22,
  1238. ),
  1239. ],
  1240. "having": [],
  1241. "orderby": [
  1242. OrderBy(
  1243. exp=Function(
  1244. function="in",
  1245. initializers=None,
  1246. parameters=[
  1247. (
  1248. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1249. Column("transaction"),
  1250. ),
  1251. [(21, 508), (21, 512)],
  1252. ],
  1253. alias="team_key_transaction",
  1254. ),
  1255. direction=Direction.DESC,
  1256. ),
  1257. OrderBy(
  1258. exp=Function(
  1259. function="p95",
  1260. initializers=None,
  1261. parameters=["transaction.duration"],
  1262. alias="p95",
  1263. ),
  1264. direction=Direction.ASC,
  1265. ),
  1266. ],
  1267. "limitby": None,
  1268. "limit": Limit(limit=51),
  1269. "offset": Offset(offset=0),
  1270. "granularity": None,
  1271. "totals": None,
  1272. }, # Transformed + discarded
  1273. {
  1274. "match": Entity("metrics_distributions"),
  1275. "select": [
  1276. Function(
  1277. function="p95",
  1278. initializers=None,
  1279. parameters=["transaction.duration"],
  1280. alias="p95",
  1281. ),
  1282. Function(
  1283. function="rate",
  1284. initializers=None,
  1285. parameters=[Column("transaction.duration"), 60, 7776000],
  1286. alias="epm",
  1287. ),
  1288. Function(
  1289. function="failure_rate",
  1290. initializers=None,
  1291. parameters=[],
  1292. alias="failure_rate",
  1293. ),
  1294. ],
  1295. "groupby": [
  1296. AliasedExpression(
  1297. exp=Column("transaction.status"),
  1298. alias="transaction.status",
  1299. ),
  1300. Function(
  1301. function="in",
  1302. initializers=None,
  1303. parameters=[
  1304. (
  1305. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1306. Column("transaction"),
  1307. ),
  1308. [(22, 533), (22, 537)],
  1309. ],
  1310. alias="team_key_transaction",
  1311. ),
  1312. AliasedExpression(
  1313. exp=Column("transaction"),
  1314. alias="transaction",
  1315. ),
  1316. Column("project_id"),
  1317. ],
  1318. "array_join": None,
  1319. "where": [
  1320. Condition(
  1321. lhs=Function(
  1322. function="in",
  1323. initializers=None,
  1324. parameters=[
  1325. (
  1326. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1327. Column("transaction"),
  1328. ),
  1329. [(22, 533), (22, 537)],
  1330. ],
  1331. alias="team_key_transaction",
  1332. ),
  1333. op=Op.NEQ,
  1334. rhs=0,
  1335. ),
  1336. Condition(
  1337. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1338. op=Op.GTE,
  1339. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 893701, tzinfo=pytz.utc),
  1340. ),
  1341. Condition(
  1342. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1343. op=Op.LT,
  1344. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 893701, tzinfo=pytz.utc),
  1345. ),
  1346. Condition(
  1347. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1348. op=Op.IN,
  1349. rhs=[22],
  1350. ),
  1351. Condition(
  1352. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1353. op=Op.EQ,
  1354. rhs=23,
  1355. ),
  1356. ],
  1357. "having": [],
  1358. "orderby": [
  1359. OrderBy(
  1360. exp=Function(
  1361. function="p95",
  1362. initializers=None,
  1363. parameters=["transaction.duration"],
  1364. alias="p95",
  1365. ),
  1366. direction=Direction.ASC,
  1367. )
  1368. ],
  1369. "limitby": None,
  1370. "limit": Limit(limit=51),
  1371. "offset": Offset(offset=0),
  1372. "granularity": None,
  1373. "totals": None,
  1374. }, # Transformed + discarded
  1375. {
  1376. "match": Entity("metrics_distributions"),
  1377. "select": [
  1378. AliasedExpression(
  1379. exp=Column("transaction.status"),
  1380. alias="transaction.status",
  1381. ),
  1382. AliasedExpression(
  1383. exp=Column("transaction"),
  1384. alias="transaction",
  1385. ),
  1386. Function(
  1387. function="p95",
  1388. initializers=None,
  1389. parameters=["transaction.duration"],
  1390. alias="p95",
  1391. ),
  1392. Function(
  1393. function="rate",
  1394. initializers=None,
  1395. parameters=[Column("transaction.duration"), 60, 7776000],
  1396. alias="epm",
  1397. ),
  1398. Function(
  1399. function="failure_rate",
  1400. initializers=None,
  1401. parameters=[],
  1402. alias="failure_rate",
  1403. ),
  1404. ],
  1405. "groupby": [
  1406. AliasedExpression(
  1407. exp=Column("transaction.status"),
  1408. alias="transaction.status",
  1409. ),
  1410. Function(
  1411. function="in",
  1412. initializers=None,
  1413. parameters=[
  1414. (
  1415. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1416. Column("transaction"),
  1417. ),
  1418. [(22, 533), (22, 537)],
  1419. ],
  1420. alias="team_key_transaction",
  1421. ),
  1422. AliasedExpression(
  1423. exp=Column("transaction"),
  1424. alias="transaction",
  1425. ),
  1426. Column("project_id"),
  1427. ],
  1428. "array_join": None,
  1429. "where": [
  1430. Condition(
  1431. lhs=Function(
  1432. function="in",
  1433. initializers=None,
  1434. parameters=[
  1435. (
  1436. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1437. Column("transaction"),
  1438. ),
  1439. [(22, 533), (22, 537)],
  1440. ],
  1441. alias="team_key_transaction",
  1442. ),
  1443. op=Op.EQ,
  1444. rhs=1,
  1445. ),
  1446. Condition(
  1447. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1448. op=Op.GTE,
  1449. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 987457, tzinfo=pytz.utc),
  1450. ),
  1451. Condition(
  1452. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1453. op=Op.LT,
  1454. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 987457, tzinfo=pytz.utc),
  1455. ),
  1456. Condition(
  1457. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1458. op=Op.IN,
  1459. rhs=[22],
  1460. ),
  1461. Condition(
  1462. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1463. op=Op.EQ,
  1464. rhs=23,
  1465. ),
  1466. ],
  1467. "having": [],
  1468. "orderby": [
  1469. OrderBy(
  1470. exp=Function(
  1471. function="p95",
  1472. initializers=None,
  1473. parameters=["transaction.duration"],
  1474. alias="p95",
  1475. ),
  1476. direction=Direction.ASC,
  1477. )
  1478. ],
  1479. "limitby": None,
  1480. "limit": Limit(limit=51),
  1481. "offset": Offset(offset=0),
  1482. "granularity": None,
  1483. "totals": None,
  1484. }, # Transformed + discarded
  1485. {
  1486. "match": Entity("metrics_distributions"),
  1487. "select": [
  1488. Function(
  1489. function="p95",
  1490. initializers=None,
  1491. parameters=["transaction.duration"],
  1492. alias="p95",
  1493. ),
  1494. Function(
  1495. function="rate",
  1496. initializers=None,
  1497. parameters=[Column("transaction.duration"), 60, 7776000],
  1498. alias="epm",
  1499. ),
  1500. Function(
  1501. function="failure_rate",
  1502. initializers=None,
  1503. parameters=[],
  1504. alias="failure_rate",
  1505. ),
  1506. ],
  1507. "groupby": [
  1508. AliasedExpression(
  1509. exp=Column("transaction.status"),
  1510. alias="transaction.status",
  1511. ),
  1512. Function(
  1513. function="in",
  1514. initializers=None,
  1515. parameters=[
  1516. (
  1517. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1518. Column("transaction"),
  1519. ),
  1520. [(22, 533), (22, 537)],
  1521. ],
  1522. alias="team_key_transaction",
  1523. ),
  1524. AliasedExpression(
  1525. exp=Column("transaction"),
  1526. alias="transaction",
  1527. ),
  1528. Column("project_id"),
  1529. ],
  1530. "array_join": None,
  1531. "where": [
  1532. Condition(
  1533. lhs=Function(
  1534. function="in",
  1535. initializers=None,
  1536. parameters=[
  1537. (
  1538. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1539. Column("transaction"),
  1540. ),
  1541. [(22, 533), (22, 537)],
  1542. ],
  1543. alias="team_key_transaction",
  1544. ),
  1545. op=Op.EQ,
  1546. rhs=0,
  1547. ),
  1548. Condition(
  1549. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1550. op=Op.GTE,
  1551. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 77835, tzinfo=pytz.utc),
  1552. ),
  1553. Condition(
  1554. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1555. op=Op.LT,
  1556. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 77835, tzinfo=pytz.utc),
  1557. ),
  1558. Condition(
  1559. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1560. op=Op.IN,
  1561. rhs=[22],
  1562. ),
  1563. Condition(
  1564. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1565. op=Op.EQ,
  1566. rhs=23,
  1567. ),
  1568. ],
  1569. "having": [],
  1570. "orderby": [
  1571. OrderBy(
  1572. exp=Function(
  1573. function="p95",
  1574. initializers=None,
  1575. parameters=["transaction.duration"],
  1576. alias="p95",
  1577. ),
  1578. direction=Direction.ASC,
  1579. )
  1580. ],
  1581. "limitby": None,
  1582. "limit": Limit(limit=51),
  1583. "offset": Offset(offset=0),
  1584. "granularity": None,
  1585. "totals": None,
  1586. }, # Transformed + discarded
  1587. {
  1588. "match": Entity("metrics_distributions"),
  1589. "select": [
  1590. AliasedExpression(
  1591. exp=Column("transaction.status"),
  1592. alias="transaction.status",
  1593. ),
  1594. AliasedExpression(
  1595. exp=Column("transaction"),
  1596. alias="transaction",
  1597. ),
  1598. Function(
  1599. function="p95",
  1600. initializers=None,
  1601. parameters=["transaction.duration"],
  1602. alias="p95",
  1603. ),
  1604. Function(
  1605. function="rate",
  1606. initializers=None,
  1607. parameters=[Column("transaction.duration"), 60, 7776000],
  1608. alias="epm",
  1609. ),
  1610. Function(
  1611. function="failure_rate",
  1612. initializers=None,
  1613. parameters=[],
  1614. alias="failure_rate",
  1615. ),
  1616. ],
  1617. "groupby": [
  1618. AliasedExpression(
  1619. exp=Column("transaction.status"),
  1620. alias="transaction.status",
  1621. ),
  1622. Function(
  1623. function="in",
  1624. initializers=None,
  1625. parameters=[
  1626. (
  1627. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1628. Column("transaction"),
  1629. ),
  1630. [(22, 533), (22, 537)],
  1631. ],
  1632. alias="team_key_transaction",
  1633. ),
  1634. AliasedExpression(
  1635. exp=Column("transaction"),
  1636. alias="transaction",
  1637. ),
  1638. Column("project_id"),
  1639. ],
  1640. "array_join": None,
  1641. "where": [
  1642. Condition(
  1643. lhs=Function(
  1644. function="in",
  1645. initializers=None,
  1646. parameters=[
  1647. (
  1648. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1649. Column("transaction"),
  1650. ),
  1651. [(22, 533), (22, 537)],
  1652. ],
  1653. alias="team_key_transaction",
  1654. ),
  1655. op=Op.EQ,
  1656. rhs=0,
  1657. ),
  1658. Condition(
  1659. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1660. op=Op.GTE,
  1661. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 170133, tzinfo=pytz.utc),
  1662. ),
  1663. Condition(
  1664. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1665. op=Op.LT,
  1666. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 170133, tzinfo=pytz.utc),
  1667. ),
  1668. Condition(
  1669. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1670. op=Op.IN,
  1671. rhs=[22],
  1672. ),
  1673. Condition(
  1674. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1675. op=Op.EQ,
  1676. rhs=23,
  1677. ),
  1678. ],
  1679. "having": [],
  1680. "orderby": [
  1681. OrderBy(
  1682. exp=Function(
  1683. function="p95",
  1684. initializers=None,
  1685. parameters=["transaction.duration"],
  1686. alias="p95",
  1687. ),
  1688. direction=Direction.ASC,
  1689. )
  1690. ],
  1691. "limitby": None,
  1692. "limit": Limit(limit=51),
  1693. "offset": Offset(offset=0),
  1694. "granularity": None,
  1695. "totals": None,
  1696. }, # Transformed + discarded
  1697. {
  1698. "match": Entity("metrics_distributions"),
  1699. "select": [
  1700. Function(
  1701. function="p50",
  1702. initializers=None,
  1703. parameters=["transaction.duration"],
  1704. alias="p50",
  1705. ),
  1706. ],
  1707. "groupby": [
  1708. AliasedExpression(
  1709. exp=Column("transaction"),
  1710. alias="title",
  1711. )
  1712. ],
  1713. "array_join": None,
  1714. "where": [
  1715. Condition(
  1716. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1717. op=Op.GTE,
  1718. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 419992, tzinfo=pytz.utc),
  1719. ),
  1720. Condition(
  1721. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1722. op=Op.LT,
  1723. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 419992, tzinfo=pytz.utc),
  1724. ),
  1725. Condition(
  1726. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1727. op=Op.IN,
  1728. rhs=[23],
  1729. ),
  1730. Condition(
  1731. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1732. op=Op.EQ,
  1733. rhs=24,
  1734. ),
  1735. ],
  1736. "having": [],
  1737. "orderby": [],
  1738. "limitby": None,
  1739. "limit": Limit(limit=51),
  1740. "offset": Offset(offset=0),
  1741. "granularity": None,
  1742. "totals": None,
  1743. }, # Transformed + discarded
  1744. {
  1745. "match": Entity("metrics_distributions"),
  1746. "select": [
  1747. AliasedExpression(
  1748. exp=Column("transaction.status"),
  1749. alias="transaction.status",
  1750. ),
  1751. AliasedExpression(
  1752. exp=Column("transaction"),
  1753. alias="transaction",
  1754. ),
  1755. Function(
  1756. function="p95",
  1757. initializers=None,
  1758. parameters=["transaction.duration"],
  1759. alias="p95",
  1760. ),
  1761. Function(
  1762. function="rate",
  1763. initializers=None,
  1764. parameters=[
  1765. Column("transaction.duration"),
  1766. 60,
  1767. 7776000.0,
  1768. ],
  1769. alias="epm",
  1770. ),
  1771. Function(
  1772. function="failure_rate",
  1773. initializers=None,
  1774. parameters=[],
  1775. alias="failure_rate",
  1776. ),
  1777. ],
  1778. "groupby": [
  1779. AliasedExpression(
  1780. exp=Column("transaction.status"),
  1781. alias="transaction.status",
  1782. ),
  1783. Function(
  1784. function="in",
  1785. initializers=None,
  1786. parameters=[
  1787. (
  1788. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1789. Column("transaction"),
  1790. ),
  1791. [(24, 592)],
  1792. ],
  1793. alias="team_key_transaction",
  1794. ),
  1795. AliasedExpression(
  1796. exp=Column("transaction"),
  1797. alias="transaction",
  1798. ),
  1799. Column("project_id"),
  1800. ],
  1801. "array_join": None,
  1802. "where": [
  1803. Condition(
  1804. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1805. op=Op.GTE,
  1806. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 719119, tzinfo=pytz.utc),
  1807. ),
  1808. Condition(
  1809. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1810. op=Op.LT,
  1811. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 719119, tzinfo=pytz.utc),
  1812. ),
  1813. Condition(
  1814. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1815. op=Op.IN,
  1816. rhs=[24],
  1817. ),
  1818. Condition(
  1819. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1820. op=Op.EQ,
  1821. rhs=25,
  1822. ),
  1823. ],
  1824. "having": [],
  1825. "orderby": [
  1826. OrderBy(
  1827. exp=Function(
  1828. function="p95",
  1829. initializers=None,
  1830. parameters=["transaction.duration"],
  1831. alias="p95",
  1832. ),
  1833. direction=Direction.ASC,
  1834. )
  1835. ],
  1836. "limitby": None,
  1837. "limit": Limit(limit=51),
  1838. "offset": Offset(offset=0),
  1839. "granularity": None,
  1840. "totals": None,
  1841. }, # Transformed + discarded
  1842. ]
  1843. series_queries = [
  1844. Query(
  1845. match=Entity("metrics_sets"),
  1846. select=[
  1847. Function(
  1848. function="count_unique",
  1849. initializers=None,
  1850. parameters=[
  1851. Column("transaction.user"),
  1852. ],
  1853. alias="count_unique_user",
  1854. )
  1855. ],
  1856. groupby=[AliasedExpression(Column("bucketed_time"), "time")],
  1857. array_join=None,
  1858. where=[
  1859. Condition(
  1860. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1861. op=Op.GTE,
  1862. rhs=datetime.datetime(2022, 6, 21, 10, 0, tzinfo=None),
  1863. ),
  1864. Condition(
  1865. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1866. op=Op.LT,
  1867. rhs=datetime.datetime(2022, 6, 21, 12, 0, tzinfo=None),
  1868. ),
  1869. Condition(
  1870. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1871. op=Op.IN,
  1872. rhs=[2],
  1873. ),
  1874. Condition(
  1875. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1876. op=Op.EQ,
  1877. rhs=2,
  1878. ),
  1879. ],
  1880. having=[],
  1881. orderby=[
  1882. OrderBy(
  1883. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  1884. direction=Direction.ASC,
  1885. )
  1886. ],
  1887. limitby=None,
  1888. limit=Limit(limit=50),
  1889. offset=None,
  1890. granularity=Granularity(granularity=60),
  1891. totals=None,
  1892. ),
  1893. Query(
  1894. match=Entity("metrics_distributions"),
  1895. select=[
  1896. Function(
  1897. function="divide",
  1898. initializers=None,
  1899. parameters=[
  1900. Function(
  1901. function="countIf",
  1902. initializers=None,
  1903. parameters=[
  1904. Column(name="value", entity=None, subscriptable=None, key=None),
  1905. Function(
  1906. function="and",
  1907. initializers=None,
  1908. parameters=[
  1909. Function(
  1910. function="equals",
  1911. initializers=None,
  1912. parameters=[
  1913. Column(
  1914. name="metric_id",
  1915. entity=None,
  1916. subscriptable=None,
  1917. key=None,
  1918. ),
  1919. 9223372036854775909,
  1920. ],
  1921. alias=None,
  1922. ),
  1923. Function(
  1924. function="notIn",
  1925. initializers=None,
  1926. parameters=[
  1927. Column(
  1928. name="tags[9223372036854776021]",
  1929. entity=None,
  1930. subscriptable="tags",
  1931. key="9223372036854776021",
  1932. ),
  1933. [
  1934. 9223372036854776028,
  1935. 9223372036854776027,
  1936. 9223372036854776029,
  1937. ],
  1938. ],
  1939. alias=None,
  1940. ),
  1941. ],
  1942. alias=None,
  1943. ),
  1944. ],
  1945. alias=None,
  1946. ),
  1947. Function(
  1948. function="countIf",
  1949. initializers=None,
  1950. parameters=[
  1951. Column(name="value", entity=None, subscriptable=None, key=None),
  1952. Function(
  1953. function="equals",
  1954. initializers=None,
  1955. parameters=[
  1956. Column(
  1957. name="metric_id",
  1958. entity=None,
  1959. subscriptable=None,
  1960. key=None,
  1961. ),
  1962. 9223372036854775909,
  1963. ],
  1964. alias=None,
  1965. ),
  1966. ],
  1967. alias=None,
  1968. ),
  1969. ],
  1970. alias="failure_rate",
  1971. )
  1972. ],
  1973. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  1974. array_join=None,
  1975. where=[
  1976. Condition(
  1977. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1978. op=Op.GTE,
  1979. rhs=datetime.datetime(2022, 6, 21, 10, 0, tzinfo=pytz.utc),
  1980. ),
  1981. Condition(
  1982. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1983. op=Op.LT,
  1984. rhs=datetime.datetime(2022, 6, 21, 16, 0, tzinfo=None),
  1985. ),
  1986. Condition(
  1987. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1988. op=Op.IN,
  1989. rhs=[4],
  1990. ),
  1991. Condition(
  1992. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1993. op=Op.EQ,
  1994. rhs=4,
  1995. ),
  1996. ],
  1997. having=[],
  1998. orderby=[
  1999. OrderBy(
  2000. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2001. direction=Direction.ASC,
  2002. )
  2003. ],
  2004. limitby=None,
  2005. limit=Limit(limit=50),
  2006. offset=None,
  2007. granularity=Granularity(granularity=60),
  2008. totals=None,
  2009. ),
  2010. Query(
  2011. match=Entity("metrics_distributions"),
  2012. select=[
  2013. Function(
  2014. function="divide",
  2015. initializers=None,
  2016. parameters=[
  2017. Function(
  2018. function="countIf",
  2019. initializers=None,
  2020. parameters=[
  2021. Column(name="value", entity=None, subscriptable=None, key=None),
  2022. Function(
  2023. function="equals",
  2024. initializers=None,
  2025. parameters=[
  2026. Column(
  2027. name="metric_id",
  2028. entity=None,
  2029. subscriptable=None,
  2030. key=None,
  2031. ),
  2032. 9223372036854775909,
  2033. ],
  2034. alias=None,
  2035. ),
  2036. ],
  2037. alias=None,
  2038. ),
  2039. Function(
  2040. function="divide",
  2041. initializers=None,
  2042. parameters=[3600.0, 60],
  2043. alias=None,
  2044. ),
  2045. ],
  2046. alias="epm_3600",
  2047. )
  2048. ],
  2049. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2050. array_join=None,
  2051. where=[
  2052. Condition(
  2053. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2054. op=Op.GTE,
  2055. rhs=datetime.datetime(2022, 6, 21, 10, 0, tzinfo=pytz.utc),
  2056. ),
  2057. Condition(
  2058. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2059. op=Op.LT,
  2060. rhs=datetime.datetime(2022, 6, 21, 12, 0, tzinfo=pytz.utc),
  2061. ),
  2062. Condition(
  2063. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2064. op=Op.IN,
  2065. rhs=[7],
  2066. ),
  2067. Condition(
  2068. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2069. op=Op.EQ,
  2070. rhs=7,
  2071. ),
  2072. ],
  2073. having=[],
  2074. orderby=[
  2075. OrderBy(
  2076. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2077. direction=Direction.ASC,
  2078. )
  2079. ],
  2080. limitby=None,
  2081. limit=Limit(limit=50),
  2082. offset=None,
  2083. granularity=Granularity(granularity=60),
  2084. totals=None,
  2085. ),
  2086. Query(
  2087. match=Entity("metrics_distributions"),
  2088. select=[
  2089. Function(
  2090. function="divide",
  2091. initializers=None,
  2092. parameters=[
  2093. Function(
  2094. function="countIf",
  2095. initializers=None,
  2096. parameters=[
  2097. Column(name="value", entity=None, subscriptable=None, key=None),
  2098. Function(
  2099. function="equals",
  2100. initializers=None,
  2101. parameters=[
  2102. Column(
  2103. name="metric_id",
  2104. entity=None,
  2105. subscriptable=None,
  2106. key=None,
  2107. ),
  2108. 9223372036854775909,
  2109. ],
  2110. alias=None,
  2111. ),
  2112. ],
  2113. alias=None,
  2114. ),
  2115. Function(
  2116. function="divide",
  2117. initializers=None,
  2118. parameters=[3600.0, 60],
  2119. alias=None,
  2120. ),
  2121. ],
  2122. alias="epm_3600",
  2123. )
  2124. ],
  2125. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2126. array_join=None,
  2127. where=[
  2128. Condition(
  2129. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2130. op=Op.GTE,
  2131. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2132. ),
  2133. Condition(
  2134. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2135. op=Op.LT,
  2136. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  2137. ),
  2138. Condition(
  2139. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2140. op=Op.IN,
  2141. rhs=[7],
  2142. ),
  2143. Condition(
  2144. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2145. op=Op.EQ,
  2146. rhs=7,
  2147. ),
  2148. ],
  2149. having=[],
  2150. orderby=[
  2151. OrderBy(
  2152. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2153. direction=Direction.ASC,
  2154. )
  2155. ],
  2156. limitby=None,
  2157. limit=Limit(limit=50),
  2158. offset=None,
  2159. granularity=Granularity(granularity=60),
  2160. totals=None,
  2161. ),
  2162. Query(
  2163. match=Entity("metrics_distributions"),
  2164. select=[
  2165. Function(
  2166. function="divide",
  2167. initializers=None,
  2168. parameters=[
  2169. Function(
  2170. function="countIf",
  2171. initializers=None,
  2172. parameters=[
  2173. Column(name="value", entity=None, subscriptable=None, key=None),
  2174. Function(
  2175. function="equals",
  2176. initializers=None,
  2177. parameters=[
  2178. Column(
  2179. name="metric_id",
  2180. entity=None,
  2181. subscriptable=None,
  2182. key=None,
  2183. ),
  2184. 9223372036854775909,
  2185. ],
  2186. alias=None,
  2187. ),
  2188. ],
  2189. alias=None,
  2190. ),
  2191. Function(
  2192. function="divide",
  2193. initializers=None,
  2194. parameters=[3600.0, 60],
  2195. alias=None,
  2196. ),
  2197. ],
  2198. alias="epm_3600",
  2199. )
  2200. ],
  2201. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2202. array_join=None,
  2203. where=[
  2204. Condition(
  2205. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2206. op=Op.GTE,
  2207. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2208. ),
  2209. Condition(
  2210. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2211. op=Op.LT,
  2212. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  2213. ),
  2214. Condition(
  2215. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2216. op=Op.IN,
  2217. rhs=[7],
  2218. ),
  2219. Condition(
  2220. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2221. op=Op.EQ,
  2222. rhs=7,
  2223. ),
  2224. ],
  2225. having=[],
  2226. orderby=[
  2227. OrderBy(
  2228. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2229. direction=Direction.ASC,
  2230. )
  2231. ],
  2232. limitby=None,
  2233. limit=Limit(limit=50),
  2234. offset=None,
  2235. granularity=Granularity(granularity=60),
  2236. totals=None,
  2237. ),
  2238. Query(
  2239. match=Entity("metrics_distributions"),
  2240. select=[
  2241. Function(
  2242. function="divide",
  2243. initializers=None,
  2244. parameters=[
  2245. Function(
  2246. function="countIf",
  2247. initializers=None,
  2248. parameters=[
  2249. Column(name="value", entity=None, subscriptable=None, key=None),
  2250. Function(
  2251. function="equals",
  2252. initializers=None,
  2253. parameters=[
  2254. Column(
  2255. name="metric_id",
  2256. entity=None,
  2257. subscriptable=None,
  2258. key=None,
  2259. ),
  2260. 9223372036854775909,
  2261. ],
  2262. alias=None,
  2263. ),
  2264. ],
  2265. alias=None,
  2266. ),
  2267. Function(
  2268. function="divide",
  2269. initializers=None,
  2270. parameters=[3600.0, 60],
  2271. alias=None,
  2272. ),
  2273. ],
  2274. alias="epm_3600",
  2275. )
  2276. ],
  2277. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2278. array_join=None,
  2279. where=[
  2280. Condition(
  2281. lhs=Column(
  2282. name="tags[9223372036854776020]",
  2283. entity=None,
  2284. subscriptable="tags",
  2285. key="9223372036854776020",
  2286. ),
  2287. op=Op.EQ,
  2288. rhs=108,
  2289. ),
  2290. Condition(
  2291. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2292. op=Op.GTE,
  2293. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2294. ),
  2295. Condition(
  2296. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2297. op=Op.LT,
  2298. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  2299. ),
  2300. Condition(
  2301. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2302. op=Op.IN,
  2303. rhs=[7],
  2304. ),
  2305. Condition(
  2306. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2307. op=Op.EQ,
  2308. rhs=7,
  2309. ),
  2310. ],
  2311. having=[],
  2312. orderby=[
  2313. OrderBy(
  2314. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2315. direction=Direction.ASC,
  2316. )
  2317. ],
  2318. limitby=None,
  2319. limit=Limit(limit=50),
  2320. offset=None,
  2321. granularity=Granularity(granularity=60),
  2322. totals=None,
  2323. ),
  2324. Query(
  2325. match=Entity("metrics_distributions"),
  2326. select=[
  2327. Function(
  2328. function="arrayElement",
  2329. initializers=None,
  2330. parameters=[
  2331. Function(
  2332. function="quantilesIf(0.75)",
  2333. initializers=None,
  2334. parameters=[
  2335. Column(name="value", entity=None, subscriptable=None, key=None),
  2336. Function(
  2337. function="equals",
  2338. initializers=None,
  2339. parameters=[
  2340. Column(
  2341. name="metric_id",
  2342. entity=None,
  2343. subscriptable=None,
  2344. key=None,
  2345. ),
  2346. 9223372036854775909,
  2347. ],
  2348. alias=None,
  2349. ),
  2350. ],
  2351. alias=None,
  2352. ),
  2353. 1,
  2354. ],
  2355. alias="p75_transaction_duration",
  2356. ),
  2357. Function(
  2358. function="arrayElement",
  2359. initializers=None,
  2360. parameters=[
  2361. Function(
  2362. function="quantilesIf(0.75)",
  2363. initializers=None,
  2364. parameters=[
  2365. Column(name="value", entity=None, subscriptable=None, key=None),
  2366. Function(
  2367. function="equals",
  2368. initializers=None,
  2369. parameters=[
  2370. Column(
  2371. name="metric_id",
  2372. entity=None,
  2373. subscriptable=None,
  2374. key=None,
  2375. ),
  2376. 9223372036854775911,
  2377. ],
  2378. alias=None,
  2379. ),
  2380. ],
  2381. alias=None,
  2382. ),
  2383. 1,
  2384. ],
  2385. alias="p75_measurements_lcp",
  2386. ),
  2387. ],
  2388. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2389. array_join=None,
  2390. where=[
  2391. Condition(
  2392. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2393. op=Op.GTE,
  2394. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2395. ),
  2396. Condition(
  2397. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2398. op=Op.LT,
  2399. rhs=datetime.datetime(2022, 6, 21, 16, 0),
  2400. ),
  2401. Condition(
  2402. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2403. op=Op.IN,
  2404. rhs=[8],
  2405. ),
  2406. Condition(
  2407. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2408. op=Op.EQ,
  2409. rhs=8,
  2410. ),
  2411. ],
  2412. having=[],
  2413. orderby=[
  2414. OrderBy(
  2415. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2416. direction=Direction.ASC,
  2417. )
  2418. ],
  2419. limitby=None,
  2420. limit=Limit(limit=50),
  2421. offset=None,
  2422. granularity=Granularity(granularity=60),
  2423. totals=None,
  2424. ),
  2425. Query(
  2426. match=Entity("metrics_distributions"),
  2427. select=[
  2428. Function(
  2429. function="sumIf",
  2430. initializers=None,
  2431. parameters=[
  2432. Column(name="value", entity=None, subscriptable=None, key=None),
  2433. Function(
  2434. function="equals",
  2435. initializers=None,
  2436. parameters=[
  2437. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  2438. 9223372036854775909,
  2439. ],
  2440. alias=None,
  2441. ),
  2442. ],
  2443. alias="sum_transaction_duration",
  2444. )
  2445. ],
  2446. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2447. array_join=None,
  2448. where=[
  2449. Condition(
  2450. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2451. op=Op.GTE,
  2452. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2453. ),
  2454. Condition(
  2455. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2456. op=Op.LT,
  2457. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  2458. ),
  2459. Condition(
  2460. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2461. op=Op.IN,
  2462. rhs=[9],
  2463. ),
  2464. Condition(
  2465. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2466. op=Op.EQ,
  2467. rhs=9,
  2468. ),
  2469. ],
  2470. having=[],
  2471. orderby=[
  2472. OrderBy(
  2473. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2474. direction=Direction.ASC,
  2475. )
  2476. ],
  2477. limitby=None,
  2478. limit=Limit(limit=50),
  2479. offset=None,
  2480. granularity=Granularity(granularity=60),
  2481. totals=None,
  2482. ),
  2483. Query(
  2484. match=Entity("metrics_distributions"),
  2485. select=[
  2486. Function(
  2487. function="divide",
  2488. initializers=None,
  2489. parameters=[
  2490. Function(
  2491. function="countIf",
  2492. initializers=None,
  2493. parameters=[
  2494. Column(name="value", entity=None, subscriptable=None, key=None),
  2495. Function(
  2496. function="equals",
  2497. initializers=None,
  2498. parameters=[
  2499. Column(
  2500. name="metric_id",
  2501. entity=None,
  2502. subscriptable=None,
  2503. key=None,
  2504. ),
  2505. 9223372036854775909,
  2506. ],
  2507. alias=None,
  2508. ),
  2509. ],
  2510. alias=None,
  2511. ),
  2512. Function(
  2513. function="divide",
  2514. initializers=None,
  2515. parameters=[86400.0, 60],
  2516. alias=None,
  2517. ),
  2518. ],
  2519. alias="epm_86400",
  2520. )
  2521. ],
  2522. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2523. array_join=None,
  2524. where=[
  2525. Condition(
  2526. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2527. op=Op.GTE,
  2528. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2529. ),
  2530. Condition(
  2531. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2532. op=Op.LT,
  2533. rhs=datetime.datetime(2022, 6, 22, 10, 0),
  2534. ),
  2535. Condition(
  2536. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2537. op=Op.IN,
  2538. rhs=[10],
  2539. ),
  2540. Condition(
  2541. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2542. op=Op.EQ,
  2543. rhs=10,
  2544. ),
  2545. ],
  2546. having=[],
  2547. orderby=[
  2548. OrderBy(
  2549. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2550. direction=Direction.ASC,
  2551. )
  2552. ],
  2553. limitby=None,
  2554. limit=Limit(limit=50),
  2555. offset=None,
  2556. granularity=Granularity(granularity=3600),
  2557. totals=None,
  2558. ),
  2559. Query(
  2560. match=Entity("metrics_distributions"),
  2561. select=[
  2562. Function(
  2563. function="divide",
  2564. initializers=None,
  2565. parameters=[
  2566. Function(
  2567. function="countIf",
  2568. initializers=None,
  2569. parameters=[
  2570. Column(name="value", entity=None, subscriptable=None, key=None),
  2571. Function(
  2572. function="equals",
  2573. initializers=None,
  2574. parameters=[
  2575. Column(
  2576. name="metric_id",
  2577. entity=None,
  2578. subscriptable=None,
  2579. key=None,
  2580. ),
  2581. 9223372036854775909,
  2582. ],
  2583. alias=None,
  2584. ),
  2585. ],
  2586. alias=None,
  2587. ),
  2588. Function(
  2589. function="divide",
  2590. initializers=None,
  2591. parameters=[86400.0, 60],
  2592. alias=None,
  2593. ),
  2594. ],
  2595. alias="tpm_86400",
  2596. )
  2597. ],
  2598. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2599. array_join=None,
  2600. where=[
  2601. Condition(
  2602. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2603. op=Op.GTE,
  2604. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2605. ),
  2606. Condition(
  2607. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2608. op=Op.LT,
  2609. rhs=datetime.datetime(2022, 6, 22, 10, 0),
  2610. ),
  2611. Condition(
  2612. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2613. op=Op.IN,
  2614. rhs=[10],
  2615. ),
  2616. Condition(
  2617. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2618. op=Op.EQ,
  2619. rhs=10,
  2620. ),
  2621. ],
  2622. having=[],
  2623. orderby=[
  2624. OrderBy(
  2625. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2626. direction=Direction.ASC,
  2627. )
  2628. ],
  2629. limitby=None,
  2630. limit=Limit(limit=50),
  2631. offset=None,
  2632. granularity=Granularity(granularity=3600),
  2633. totals=None,
  2634. ),
  2635. Query(
  2636. match=Entity("metrics_distributions"),
  2637. select=[
  2638. Function(
  2639. function="divide",
  2640. initializers=None,
  2641. parameters=[
  2642. Function(
  2643. function="countIf",
  2644. initializers=None,
  2645. parameters=[
  2646. Column(name="value", entity=None, subscriptable=None, key=None),
  2647. Function(
  2648. function="equals",
  2649. initializers=None,
  2650. parameters=[
  2651. Column(
  2652. name="metric_id",
  2653. entity=None,
  2654. subscriptable=None,
  2655. key=None,
  2656. ),
  2657. 9223372036854775909,
  2658. ],
  2659. alias=None,
  2660. ),
  2661. ],
  2662. alias=None,
  2663. ),
  2664. Function(
  2665. function="divide",
  2666. initializers=None,
  2667. parameters=[3600.0, 60],
  2668. alias=None,
  2669. ),
  2670. ],
  2671. alias="epm_3600",
  2672. )
  2673. ],
  2674. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2675. array_join=None,
  2676. where=[
  2677. Condition(
  2678. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2679. op=Op.GTE,
  2680. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2681. ),
  2682. Condition(
  2683. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2684. op=Op.LT,
  2685. rhs=datetime.datetime(2022, 6, 21, 16, 0),
  2686. ),
  2687. Condition(
  2688. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2689. op=Op.IN,
  2690. rhs=[11],
  2691. ),
  2692. Condition(
  2693. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2694. op=Op.EQ,
  2695. rhs=11,
  2696. ),
  2697. ],
  2698. having=[],
  2699. orderby=[
  2700. OrderBy(
  2701. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2702. direction=Direction.ASC,
  2703. )
  2704. ],
  2705. limitby=None,
  2706. limit=Limit(limit=50),
  2707. offset=None,
  2708. granularity=Granularity(granularity=60),
  2709. totals=None,
  2710. ),
  2711. Query(
  2712. match=Entity("metrics_distributions"),
  2713. select=[
  2714. Function(
  2715. function="divide",
  2716. initializers=None,
  2717. parameters=[
  2718. Function(
  2719. function="countIf",
  2720. initializers=None,
  2721. parameters=[
  2722. Column(name="value", entity=None, subscriptable=None, key=None),
  2723. Function(
  2724. function="equals",
  2725. initializers=None,
  2726. parameters=[
  2727. Column(
  2728. name="metric_id",
  2729. entity=None,
  2730. subscriptable=None,
  2731. key=None,
  2732. ),
  2733. 9223372036854775909,
  2734. ],
  2735. alias=None,
  2736. ),
  2737. ],
  2738. alias=None,
  2739. ),
  2740. Function(
  2741. function="divide",
  2742. initializers=None,
  2743. parameters=[3600.0, 60],
  2744. alias=None,
  2745. ),
  2746. ],
  2747. alias="tpm_3600",
  2748. )
  2749. ],
  2750. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2751. array_join=None,
  2752. where=[
  2753. Condition(
  2754. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2755. op=Op.GTE,
  2756. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2757. ),
  2758. Condition(
  2759. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2760. op=Op.LT,
  2761. rhs=datetime.datetime(2022, 6, 21, 16, 0),
  2762. ),
  2763. Condition(
  2764. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2765. op=Op.IN,
  2766. rhs=[11],
  2767. ),
  2768. Condition(
  2769. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2770. op=Op.EQ,
  2771. rhs=11,
  2772. ),
  2773. ],
  2774. having=[],
  2775. orderby=[
  2776. OrderBy(
  2777. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2778. direction=Direction.ASC,
  2779. )
  2780. ],
  2781. limitby=None,
  2782. limit=Limit(limit=50),
  2783. offset=None,
  2784. granularity=Granularity(granularity=60),
  2785. totals=None,
  2786. ),
  2787. Query(
  2788. match=Entity("metrics_distributions"),
  2789. select=[
  2790. Function(
  2791. function="divide",
  2792. initializers=None,
  2793. parameters=[
  2794. Function(
  2795. function="countIf",
  2796. initializers=None,
  2797. parameters=[
  2798. Column(name="value", entity=None, subscriptable=None, key=None),
  2799. Function(
  2800. function="equals",
  2801. initializers=None,
  2802. parameters=[
  2803. Column(
  2804. name="metric_id",
  2805. entity=None,
  2806. subscriptable=None,
  2807. key=None,
  2808. ),
  2809. 9223372036854775909,
  2810. ],
  2811. alias=None,
  2812. ),
  2813. ],
  2814. alias=None,
  2815. ),
  2816. Function(
  2817. function="divide",
  2818. initializers=None,
  2819. parameters=[3600.0, 60],
  2820. alias=None,
  2821. ),
  2822. ],
  2823. alias="tpm_3600",
  2824. )
  2825. ],
  2826. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2827. array_join=None,
  2828. where=[
  2829. Condition(
  2830. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2831. op=Op.GTE,
  2832. rhs=datetime.datetime(2022, 6, 21, 10, 30),
  2833. ),
  2834. Condition(
  2835. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2836. op=Op.LT,
  2837. rhs=datetime.datetime(2022, 6, 21, 16, 30),
  2838. ),
  2839. Condition(
  2840. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2841. op=Op.IN,
  2842. rhs=[12],
  2843. ),
  2844. Condition(
  2845. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2846. op=Op.EQ,
  2847. rhs=12,
  2848. ),
  2849. ],
  2850. having=[],
  2851. orderby=[
  2852. OrderBy(
  2853. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2854. direction=Direction.ASC,
  2855. )
  2856. ],
  2857. limitby=None,
  2858. limit=Limit(limit=50),
  2859. offset=None,
  2860. granularity=Granularity(granularity=60),
  2861. totals=None,
  2862. ),
  2863. Query(
  2864. match=Entity("metrics_distributions"),
  2865. select=[
  2866. Function(
  2867. function="divide",
  2868. initializers=None,
  2869. parameters=[
  2870. Function(
  2871. function="countIf",
  2872. initializers=None,
  2873. parameters=[
  2874. Column(name="value", entity=None, subscriptable=None, key=None),
  2875. Function(
  2876. function="equals",
  2877. initializers=None,
  2878. parameters=[
  2879. Column(
  2880. name="metric_id",
  2881. entity=None,
  2882. subscriptable=None,
  2883. key=None,
  2884. ),
  2885. 9223372036854775909,
  2886. ],
  2887. alias=None,
  2888. ),
  2889. ],
  2890. alias=None,
  2891. ),
  2892. Function(
  2893. function="divide",
  2894. initializers=None,
  2895. parameters=[3600.0, 60],
  2896. alias=None,
  2897. ),
  2898. ],
  2899. alias="epm_3600",
  2900. )
  2901. ],
  2902. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2903. array_join=None,
  2904. where=[
  2905. Condition(
  2906. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2907. op=Op.GTE,
  2908. rhs=datetime.datetime(2022, 6, 21, 10, 30),
  2909. ),
  2910. Condition(
  2911. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2912. op=Op.LT,
  2913. rhs=datetime.datetime(2022, 6, 21, 16, 30),
  2914. ),
  2915. Condition(
  2916. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2917. op=Op.IN,
  2918. rhs=[12],
  2919. ),
  2920. Condition(
  2921. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2922. op=Op.EQ,
  2923. rhs=12,
  2924. ),
  2925. ],
  2926. having=[],
  2927. orderby=[
  2928. OrderBy(
  2929. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  2930. direction=Direction.ASC,
  2931. )
  2932. ],
  2933. limitby=None,
  2934. limit=Limit(limit=50),
  2935. offset=None,
  2936. granularity=Granularity(granularity=60),
  2937. totals=None,
  2938. ),
  2939. Query(
  2940. match=Entity("metrics_distributions"),
  2941. select=[
  2942. Function(
  2943. function="divide",
  2944. initializers=None,
  2945. parameters=[
  2946. Function(
  2947. function="countIf",
  2948. initializers=None,
  2949. parameters=[
  2950. Column(name="value", entity=None, subscriptable=None, key=None),
  2951. Function(
  2952. function="equals",
  2953. initializers=None,
  2954. parameters=[
  2955. Column(
  2956. name="metric_id",
  2957. entity=None,
  2958. subscriptable=None,
  2959. key=None,
  2960. ),
  2961. 9223372036854775909,
  2962. ],
  2963. alias=None,
  2964. ),
  2965. ],
  2966. alias=None,
  2967. ),
  2968. 60.0,
  2969. ],
  2970. alias="eps_60",
  2971. )
  2972. ],
  2973. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  2974. array_join=None,
  2975. where=[
  2976. Condition(
  2977. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2978. op=Op.GTE,
  2979. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  2980. ),
  2981. Condition(
  2982. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2983. op=Op.LT,
  2984. rhs=datetime.datetime(2022, 6, 21, 10, 6),
  2985. ),
  2986. Condition(
  2987. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2988. op=Op.IN,
  2989. rhs=[13],
  2990. ),
  2991. Condition(
  2992. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2993. op=Op.EQ,
  2994. rhs=13,
  2995. ),
  2996. ],
  2997. having=[],
  2998. orderby=[
  2999. OrderBy(
  3000. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  3001. direction=Direction.ASC,
  3002. )
  3003. ],
  3004. limitby=None,
  3005. limit=Limit(limit=50),
  3006. offset=None,
  3007. granularity=Granularity(granularity=10),
  3008. totals=None,
  3009. ),
  3010. Query(
  3011. match=Entity("metrics_distributions"),
  3012. select=[
  3013. Function(
  3014. function="divide",
  3015. initializers=None,
  3016. parameters=[
  3017. Function(
  3018. function="countIf",
  3019. initializers=None,
  3020. parameters=[
  3021. Column(name="value", entity=None, subscriptable=None, key=None),
  3022. Function(
  3023. function="equals",
  3024. initializers=None,
  3025. parameters=[
  3026. Column(
  3027. name="metric_id",
  3028. entity=None,
  3029. subscriptable=None,
  3030. key=None,
  3031. ),
  3032. 9223372036854775909,
  3033. ],
  3034. alias=None,
  3035. ),
  3036. ],
  3037. alias=None,
  3038. ),
  3039. 60.0,
  3040. ],
  3041. alias="tps_60",
  3042. )
  3043. ],
  3044. groupby=[AliasedExpression(Column("bucketed_time"), alias="time")],
  3045. array_join=None,
  3046. where=[
  3047. Condition(
  3048. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3049. op=Op.GTE,
  3050. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  3051. ),
  3052. Condition(
  3053. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3054. op=Op.LT,
  3055. rhs=datetime.datetime(2022, 6, 21, 10, 6),
  3056. ),
  3057. Condition(
  3058. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3059. op=Op.IN,
  3060. rhs=[13],
  3061. ),
  3062. Condition(
  3063. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3064. op=Op.EQ,
  3065. rhs=13,
  3066. ),
  3067. ],
  3068. having=[],
  3069. orderby=[
  3070. OrderBy(
  3071. exp=AliasedExpression(Column("bucketed_time"), alias="time"),
  3072. direction=Direction.ASC,
  3073. )
  3074. ],
  3075. limitby=None,
  3076. limit=Limit(limit=50),
  3077. offset=None,
  3078. granularity=Granularity(granularity=10),
  3079. totals=None,
  3080. ),
  3081. ]
  3082. histogram_queries = [
  3083. {
  3084. "match": Entity("metrics_distributions"),
  3085. "select": [
  3086. Function(
  3087. function="arrayElement",
  3088. initializers=None,
  3089. parameters=[
  3090. Function(
  3091. function="quantilesIf(0.75)",
  3092. initializers=None,
  3093. parameters=[
  3094. Column(name="value", entity=None, subscriptable=None, key=None),
  3095. Function(
  3096. function="equals",
  3097. initializers=None,
  3098. parameters=[
  3099. Column(
  3100. name="metric_id", entity=None, subscriptable=None, key=None
  3101. ),
  3102. 9223372036854775909,
  3103. ],
  3104. alias=None,
  3105. ),
  3106. ],
  3107. alias=None,
  3108. ),
  3109. 1,
  3110. ],
  3111. alias="percentile_transaction_duration_0_75",
  3112. ),
  3113. Function(
  3114. function="arrayElement",
  3115. initializers=None,
  3116. parameters=[
  3117. Function(
  3118. function="quantilesIf(0.25)",
  3119. initializers=None,
  3120. parameters=[
  3121. Column(name="value", entity=None, subscriptable=None, key=None),
  3122. Function(
  3123. function="equals",
  3124. initializers=None,
  3125. parameters=[
  3126. Column(
  3127. name="metric_id", entity=None, subscriptable=None, key=None
  3128. ),
  3129. 9223372036854775909,
  3130. ],
  3131. alias=None,
  3132. ),
  3133. ],
  3134. alias=None,
  3135. ),
  3136. 1,
  3137. ],
  3138. alias="percentile_transaction_duration_0_25",
  3139. ),
  3140. Function(
  3141. function="maxIf",
  3142. initializers=None,
  3143. parameters=[
  3144. Column(name="value", entity=None, subscriptable=None, key=None),
  3145. Function(
  3146. function="equals",
  3147. initializers=None,
  3148. parameters=[
  3149. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3150. 9223372036854775909,
  3151. ],
  3152. alias=None,
  3153. ),
  3154. ],
  3155. alias="max_transaction_duration",
  3156. ),
  3157. Function(
  3158. function="minIf",
  3159. initializers=None,
  3160. parameters=[
  3161. Column(name="value", entity=None, subscriptable=None, key=None),
  3162. Function(
  3163. function="equals",
  3164. initializers=None,
  3165. parameters=[
  3166. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3167. 9223372036854775909,
  3168. ],
  3169. alias=None,
  3170. ),
  3171. ],
  3172. alias="min_transaction_duration",
  3173. ),
  3174. ],
  3175. "groupby": [],
  3176. "array_join": None,
  3177. "where": [
  3178. Condition(
  3179. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3180. op=Op.GTE,
  3181. rhs=datetime.datetime(2022, 3, 24, 14, 52, 58, 52294),
  3182. ),
  3183. Condition(
  3184. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3185. op=Op.LT,
  3186. rhs=datetime.datetime(2022, 6, 22, 14, 52, 58, 52294),
  3187. ),
  3188. Condition(
  3189. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3190. op=Op.IN,
  3191. rhs=[2],
  3192. ),
  3193. Condition(
  3194. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3195. op=Op.EQ,
  3196. rhs=2,
  3197. ),
  3198. ],
  3199. "having": [],
  3200. "orderby": [],
  3201. "limitby": None,
  3202. "limit": Limit(limit=1),
  3203. "offset": None,
  3204. "granularity": None,
  3205. "totals": None,
  3206. },
  3207. {
  3208. "match": Entity("metrics_distributions"),
  3209. "select": [
  3210. Function(
  3211. function="histogramIf(5)",
  3212. initializers=None,
  3213. parameters=[
  3214. Column(name="value", entity=None, subscriptable=None, key=None),
  3215. Function(
  3216. function="and",
  3217. initializers=None,
  3218. parameters=[
  3219. Function(
  3220. function="and",
  3221. initializers=None,
  3222. parameters=[
  3223. Function(
  3224. function="greaterOrEquals",
  3225. initializers=None,
  3226. parameters=[
  3227. Function(
  3228. function="arrayReduce",
  3229. initializers=None,
  3230. parameters=[
  3231. "maxMerge",
  3232. [
  3233. Column(
  3234. name="max",
  3235. entity=None,
  3236. subscriptable=None,
  3237. key=None,
  3238. )
  3239. ],
  3240. ],
  3241. alias=None,
  3242. ),
  3243. 0,
  3244. ],
  3245. alias=None,
  3246. ),
  3247. Function(
  3248. function="lessOrEquals",
  3249. initializers=None,
  3250. parameters=[
  3251. Function(
  3252. function="arrayReduce",
  3253. initializers=None,
  3254. parameters=[
  3255. "minMerge",
  3256. [
  3257. Column(
  3258. name="min",
  3259. entity=None,
  3260. subscriptable=None,
  3261. key=None,
  3262. )
  3263. ],
  3264. ],
  3265. alias=None,
  3266. ),
  3267. 5,
  3268. ],
  3269. alias=None,
  3270. ),
  3271. ],
  3272. alias=None,
  3273. ),
  3274. Function(
  3275. function="equals",
  3276. initializers=None,
  3277. parameters=[
  3278. Column(
  3279. name="metric_id", entity=None, subscriptable=None, key=None
  3280. ),
  3281. 9223372036854775909,
  3282. ],
  3283. alias=None,
  3284. ),
  3285. ],
  3286. alias=None,
  3287. ),
  3288. ],
  3289. alias="histogram_transaction_duration",
  3290. )
  3291. ],
  3292. "groupby": [],
  3293. "array_join": None,
  3294. "where": [
  3295. Condition(
  3296. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3297. op=Op.GTE,
  3298. rhs=datetime.datetime(2022, 3, 24, 14, 52, 58, 52294),
  3299. ),
  3300. Condition(
  3301. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3302. op=Op.LT,
  3303. rhs=datetime.datetime(2022, 6, 22, 14, 52, 58, 52294),
  3304. ),
  3305. Condition(
  3306. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3307. op=Op.IN,
  3308. rhs=[2],
  3309. ),
  3310. Condition(
  3311. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3312. op=Op.EQ,
  3313. rhs=2,
  3314. ),
  3315. ],
  3316. "having": [],
  3317. "orderby": [],
  3318. "limitby": None,
  3319. "limit": Limit(limit=50),
  3320. "offset": Offset(offset=0),
  3321. "granularity": None,
  3322. "totals": None,
  3323. },
  3324. {
  3325. "match": Entity("metrics_distributions"),
  3326. "select": [
  3327. Function(
  3328. function="maxIf",
  3329. initializers=None,
  3330. parameters=[
  3331. Column(name="value", entity=None, subscriptable=None, key=None),
  3332. Function(
  3333. function="equals",
  3334. initializers=None,
  3335. parameters=[
  3336. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3337. 9223372036854775909,
  3338. ],
  3339. alias=None,
  3340. ),
  3341. ],
  3342. alias="max_transaction_duration",
  3343. ),
  3344. Function(
  3345. function="minIf",
  3346. initializers=None,
  3347. parameters=[
  3348. Column(name="value", entity=None, subscriptable=None, key=None),
  3349. Function(
  3350. function="equals",
  3351. initializers=None,
  3352. parameters=[
  3353. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3354. 9223372036854775909,
  3355. ],
  3356. alias=None,
  3357. ),
  3358. ],
  3359. alias="min_transaction_duration",
  3360. ),
  3361. ],
  3362. "groupby": [],
  3363. "array_join": None,
  3364. "where": [
  3365. Condition(
  3366. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3367. op=Op.GTE,
  3368. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 179755),
  3369. ),
  3370. Condition(
  3371. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3372. op=Op.LT,
  3373. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 179755),
  3374. ),
  3375. Condition(
  3376. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3377. op=Op.IN,
  3378. rhs=[3],
  3379. ),
  3380. Condition(
  3381. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3382. op=Op.EQ,
  3383. rhs=3,
  3384. ),
  3385. ],
  3386. "having": [],
  3387. "orderby": [],
  3388. "limitby": None,
  3389. "limit": Limit(limit=1),
  3390. "offset": None,
  3391. "granularity": None,
  3392. "totals": None,
  3393. },
  3394. {
  3395. "match": Entity("metrics_distributions"),
  3396. "select": [
  3397. Function(
  3398. function="histogramIf(5)",
  3399. initializers=None,
  3400. parameters=[
  3401. Column(name="value", entity=None, subscriptable=None, key=None),
  3402. Function(
  3403. function="and",
  3404. initializers=None,
  3405. parameters=[
  3406. Function(
  3407. function="and",
  3408. initializers=None,
  3409. parameters=[
  3410. Function(
  3411. function="greaterOrEquals",
  3412. initializers=None,
  3413. parameters=[
  3414. Function(
  3415. function="arrayReduce",
  3416. initializers=None,
  3417. parameters=[
  3418. "maxMerge",
  3419. [
  3420. Column(
  3421. name="max",
  3422. entity=None,
  3423. subscriptable=None,
  3424. key=None,
  3425. )
  3426. ],
  3427. ],
  3428. alias=None,
  3429. ),
  3430. 0,
  3431. ],
  3432. alias=None,
  3433. ),
  3434. Function(
  3435. function="lessOrEquals",
  3436. initializers=None,
  3437. parameters=[
  3438. Function(
  3439. function="arrayReduce",
  3440. initializers=None,
  3441. parameters=[
  3442. "minMerge",
  3443. [
  3444. Column(
  3445. name="min",
  3446. entity=None,
  3447. subscriptable=None,
  3448. key=None,
  3449. )
  3450. ],
  3451. ],
  3452. alias=None,
  3453. ),
  3454. 5,
  3455. ],
  3456. alias=None,
  3457. ),
  3458. ],
  3459. alias=None,
  3460. ),
  3461. Function(
  3462. function="equals",
  3463. initializers=None,
  3464. parameters=[
  3465. Column(
  3466. name="metric_id", entity=None, subscriptable=None, key=None
  3467. ),
  3468. 9223372036854775909,
  3469. ],
  3470. alias=None,
  3471. ),
  3472. ],
  3473. alias=None,
  3474. ),
  3475. ],
  3476. alias="histogram_transaction_duration",
  3477. )
  3478. ],
  3479. "groupby": [],
  3480. "array_join": None,
  3481. "where": [
  3482. Condition(
  3483. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3484. op=Op.GTE,
  3485. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 179755),
  3486. ),
  3487. Condition(
  3488. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3489. op=Op.LT,
  3490. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 179755),
  3491. ),
  3492. Condition(
  3493. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3494. op=Op.IN,
  3495. rhs=[3],
  3496. ),
  3497. Condition(
  3498. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3499. op=Op.EQ,
  3500. rhs=3,
  3501. ),
  3502. ],
  3503. "having": [],
  3504. "orderby": [],
  3505. "limitby": None,
  3506. "limit": Limit(limit=50),
  3507. "offset": Offset(offset=0),
  3508. "granularity": None,
  3509. "totals": None,
  3510. },
  3511. {
  3512. "match": Entity("metrics_distributions"),
  3513. "select": [
  3514. Function(
  3515. function="maxIf",
  3516. initializers=None,
  3517. parameters=[
  3518. Column(name="value", entity=None, subscriptable=None, key=None),
  3519. Function(
  3520. function="equals",
  3521. initializers=None,
  3522. parameters=[
  3523. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3524. 9223372036854775911,
  3525. ],
  3526. alias=None,
  3527. ),
  3528. ],
  3529. alias="max_measurements_lcp",
  3530. ),
  3531. Function(
  3532. function="minIf",
  3533. initializers=None,
  3534. parameters=[
  3535. Column(name="value", entity=None, subscriptable=None, key=None),
  3536. Function(
  3537. function="equals",
  3538. initializers=None,
  3539. parameters=[
  3540. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3541. 9223372036854775911,
  3542. ],
  3543. alias=None,
  3544. ),
  3545. ],
  3546. alias="min_measurements_lcp",
  3547. ),
  3548. Function(
  3549. function="minIf",
  3550. initializers=None,
  3551. parameters=[
  3552. Column(name="value", entity=None, subscriptable=None, key=None),
  3553. Function(
  3554. function="equals",
  3555. initializers=None,
  3556. parameters=[
  3557. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3558. 9223372036854775910,
  3559. ],
  3560. alias=None,
  3561. ),
  3562. ],
  3563. alias="min_measurements_fcp",
  3564. ),
  3565. Function(
  3566. function="maxIf",
  3567. initializers=None,
  3568. parameters=[
  3569. Column(name="value", entity=None, subscriptable=None, key=None),
  3570. Function(
  3571. function="equals",
  3572. initializers=None,
  3573. parameters=[
  3574. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3575. 9223372036854775910,
  3576. ],
  3577. alias=None,
  3578. ),
  3579. ],
  3580. alias="max_measurements_fcp",
  3581. ),
  3582. ],
  3583. "groupby": [],
  3584. "array_join": None,
  3585. "where": [
  3586. Condition(
  3587. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3588. op=Op.GTE,
  3589. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 880411),
  3590. ),
  3591. Condition(
  3592. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3593. op=Op.LT,
  3594. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 880411),
  3595. ),
  3596. Condition(
  3597. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3598. op=Op.IN,
  3599. rhs=[4],
  3600. ),
  3601. Condition(
  3602. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3603. op=Op.EQ,
  3604. rhs=4,
  3605. ),
  3606. ],
  3607. "having": [],
  3608. "orderby": [],
  3609. "limitby": None,
  3610. "limit": Limit(limit=1),
  3611. "offset": None,
  3612. "granularity": None,
  3613. "totals": None,
  3614. },
  3615. {
  3616. "match": Entity("metrics_distributions"),
  3617. "select": [
  3618. Function(
  3619. function="histogramIf(2)",
  3620. initializers=None,
  3621. parameters=[
  3622. Column(name="value", entity=None, subscriptable=None, key=None),
  3623. Function(
  3624. function="and",
  3625. initializers=None,
  3626. parameters=[
  3627. Function(
  3628. function="and",
  3629. initializers=None,
  3630. parameters=[
  3631. Function(
  3632. function="greaterOrEquals",
  3633. initializers=None,
  3634. parameters=[
  3635. Function(
  3636. function="arrayReduce",
  3637. initializers=None,
  3638. parameters=[
  3639. "maxMerge",
  3640. [
  3641. Column(
  3642. name="max",
  3643. entity=None,
  3644. subscriptable=None,
  3645. key=None,
  3646. )
  3647. ],
  3648. ],
  3649. alias=None,
  3650. ),
  3651. 0,
  3652. ],
  3653. alias=None,
  3654. ),
  3655. Function(
  3656. function="lessOrEquals",
  3657. initializers=None,
  3658. parameters=[
  3659. Function(
  3660. function="arrayReduce",
  3661. initializers=None,
  3662. parameters=[
  3663. "minMerge",
  3664. [
  3665. Column(
  3666. name="min",
  3667. entity=None,
  3668. subscriptable=None,
  3669. key=None,
  3670. )
  3671. ],
  3672. ],
  3673. alias=None,
  3674. ),
  3675. 2,
  3676. ],
  3677. alias=None,
  3678. ),
  3679. ],
  3680. alias=None,
  3681. ),
  3682. Function(
  3683. function="equals",
  3684. initializers=None,
  3685. parameters=[
  3686. Column(
  3687. name="metric_id", entity=None, subscriptable=None, key=None
  3688. ),
  3689. 9223372036854775910,
  3690. ],
  3691. alias=None,
  3692. ),
  3693. ],
  3694. alias=None,
  3695. ),
  3696. ],
  3697. alias="histogram_measurements_fcp",
  3698. ),
  3699. Function(
  3700. function="histogramIf(2)",
  3701. initializers=None,
  3702. parameters=[
  3703. Column(name="value", entity=None, subscriptable=None, key=None),
  3704. Function(
  3705. function="and",
  3706. initializers=None,
  3707. parameters=[
  3708. Function(
  3709. function="and",
  3710. initializers=None,
  3711. parameters=[
  3712. Function(
  3713. function="greaterOrEquals",
  3714. initializers=None,
  3715. parameters=[
  3716. Function(
  3717. function="arrayReduce",
  3718. initializers=None,
  3719. parameters=[
  3720. "maxMerge",
  3721. [
  3722. Column(
  3723. name="max",
  3724. entity=None,
  3725. subscriptable=None,
  3726. key=None,
  3727. )
  3728. ],
  3729. ],
  3730. alias=None,
  3731. ),
  3732. 0,
  3733. ],
  3734. alias=None,
  3735. ),
  3736. Function(
  3737. function="lessOrEquals",
  3738. initializers=None,
  3739. parameters=[
  3740. Function(
  3741. function="arrayReduce",
  3742. initializers=None,
  3743. parameters=[
  3744. "minMerge",
  3745. [
  3746. Column(
  3747. name="min",
  3748. entity=None,
  3749. subscriptable=None,
  3750. key=None,
  3751. )
  3752. ],
  3753. ],
  3754. alias=None,
  3755. ),
  3756. 2,
  3757. ],
  3758. alias=None,
  3759. ),
  3760. ],
  3761. alias=None,
  3762. ),
  3763. Function(
  3764. function="equals",
  3765. initializers=None,
  3766. parameters=[
  3767. Column(
  3768. name="metric_id", entity=None, subscriptable=None, key=None
  3769. ),
  3770. 9223372036854775911,
  3771. ],
  3772. alias=None,
  3773. ),
  3774. ],
  3775. alias=None,
  3776. ),
  3777. ],
  3778. alias="histogram_measurements_lcp",
  3779. ),
  3780. ],
  3781. "groupby": [],
  3782. "array_join": None,
  3783. "where": [
  3784. Condition(
  3785. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3786. op=Op.GTE,
  3787. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 880411),
  3788. ),
  3789. Condition(
  3790. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3791. op=Op.LT,
  3792. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 880411),
  3793. ),
  3794. Condition(
  3795. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3796. op=Op.IN,
  3797. rhs=[4],
  3798. ),
  3799. Condition(
  3800. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3801. op=Op.EQ,
  3802. rhs=4,
  3803. ),
  3804. ],
  3805. "having": [],
  3806. "orderby": [],
  3807. "limitby": None,
  3808. "limit": Limit(limit=50),
  3809. "offset": Offset(offset=0),
  3810. "granularity": None,
  3811. "totals": None,
  3812. },
  3813. ]