hello.py 300 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726
  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="arrayElement",
  17. initializers=None,
  18. parameters=[
  19. Function(
  20. function="quantilesIf(0.5)",
  21. initializers=None,
  22. parameters=[
  23. Column(name="value", entity=None, subscriptable=None, key=None),
  24. Function(
  25. function="equals",
  26. initializers=None,
  27. parameters=[
  28. Column(
  29. name="metric_id", entity=None, subscriptable=None, key=None
  30. ),
  31. 9223372036854775909,
  32. ],
  33. alias=None,
  34. ),
  35. ],
  36. alias=None,
  37. ),
  38. 1,
  39. ],
  40. alias="p50",
  41. ),
  42. AliasedExpression(
  43. exp=Column(
  44. name="tags[9223372036854776020]",
  45. entity=None,
  46. subscriptable="tags",
  47. key="9223372036854776020",
  48. ),
  49. alias="transaction",
  50. ),
  51. ],
  52. "groupby": [
  53. AliasedExpression(
  54. exp=Column(
  55. name="tags[9223372036854776020]",
  56. entity=None,
  57. subscriptable="tags",
  58. key="9223372036854776020",
  59. ),
  60. alias="transaction",
  61. )
  62. ],
  63. "array_join": None,
  64. "where": [
  65. Condition(
  66. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  67. op=Op.GTE,
  68. rhs=datetime.datetime(2022, 3, 24, 11, 11, 33, 21219, tzinfo=pytz.utc),
  69. ),
  70. Condition(
  71. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  72. op=Op.LT,
  73. rhs=datetime.datetime(2022, 6, 22, 11, 11, 33, 21219, tzinfo=pytz.utc),
  74. ),
  75. Condition(
  76. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  77. op=Op.IN,
  78. rhs=[2],
  79. ),
  80. Condition(
  81. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  82. op=Op.EQ,
  83. rhs=2,
  84. ),
  85. Condition(
  86. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  87. op=Op.IN,
  88. rhs=[9223372036854775908, 9223372036854775909],
  89. ),
  90. ],
  91. "having": [],
  92. "orderby": [
  93. OrderBy(
  94. exp=Function(
  95. function="arrayElement",
  96. initializers=None,
  97. parameters=[
  98. Function(
  99. function="quantilesIf(0.5)",
  100. initializers=None,
  101. parameters=[
  102. Column(name="value", entity=None, subscriptable=None, key=None),
  103. Function(
  104. function="equals",
  105. initializers=None,
  106. parameters=[
  107. Column(
  108. name="metric_id",
  109. entity=None,
  110. subscriptable=None,
  111. key=None,
  112. ),
  113. 9223372036854775909,
  114. ],
  115. alias=None,
  116. ),
  117. ],
  118. alias=None,
  119. ),
  120. 1,
  121. ],
  122. alias="p50",
  123. ),
  124. direction=Direction.ASC,
  125. )
  126. ],
  127. "limitby": None,
  128. "limit": Limit(limit=51),
  129. "offset": Offset(offset=0),
  130. "granularity": None,
  131. "totals": None,
  132. }, # Checked + added
  133. {
  134. "match": Entity("metrics_sets"),
  135. "select": [
  136. Function(
  137. function="uniqIf",
  138. initializers=None,
  139. parameters=[
  140. Column(name="value", entity=None, subscriptable=None, key=None),
  141. Function(
  142. function="equals",
  143. initializers=None,
  144. parameters=[
  145. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  146. 9223372036854775908,
  147. ],
  148. alias=None,
  149. ),
  150. ],
  151. alias="count_unique_user",
  152. ),
  153. AliasedExpression(
  154. exp=Column(
  155. name="tags[9223372036854776020]",
  156. entity=None,
  157. subscriptable="tags",
  158. key="9223372036854776020",
  159. ),
  160. alias="transaction",
  161. ),
  162. ],
  163. "groupby": [
  164. AliasedExpression(
  165. exp=Column(
  166. name="tags[9223372036854776020]",
  167. entity=None,
  168. subscriptable="tags",
  169. key="9223372036854776020",
  170. ),
  171. alias="transaction",
  172. )
  173. ],
  174. "array_join": None,
  175. "where": [
  176. Condition(
  177. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  178. op=Op.GTE,
  179. rhs=datetime.datetime(2022, 3, 24, 11, 11, 33, 21219, tzinfo=pytz.utc),
  180. ),
  181. Condition(
  182. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  183. op=Op.LT,
  184. rhs=datetime.datetime(2022, 6, 22, 11, 11, 33, 21219, tzinfo=pytz.utc),
  185. ),
  186. Condition(
  187. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  188. op=Op.IN,
  189. rhs=[2],
  190. ),
  191. Condition(
  192. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  193. op=Op.EQ,
  194. rhs=2,
  195. ),
  196. Condition(
  197. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  198. op=Op.IN,
  199. rhs=[9223372036854775908, 9223372036854775909],
  200. ),
  201. Condition(
  202. lhs=Function(
  203. function="tuple",
  204. initializers=None,
  205. parameters=[
  206. Column(
  207. name="tags[9223372036854776020]",
  208. entity=None,
  209. subscriptable="tags",
  210. key="9223372036854776020",
  211. )
  212. ],
  213. alias=None,
  214. ),
  215. op=Op.IN,
  216. rhs=Function(
  217. function="tuple", initializers=None, parameters=[(12,), (17,)], alias=None
  218. ),
  219. ), # transaction IN [...]
  220. ],
  221. "having": [],
  222. "orderby": [],
  223. "limitby": None,
  224. "limit": Limit(limit=51),
  225. "offset": Offset(offset=0),
  226. "granularity": None,
  227. "totals": None,
  228. }, # Checked + added
  229. {
  230. "match": Entity("metrics_distributions"),
  231. "select": [
  232. Function(
  233. function="arrayElement",
  234. initializers=None,
  235. parameters=[
  236. Function(
  237. function="quantilesIf(0.5)",
  238. initializers=None,
  239. parameters=[
  240. Column(name="value", entity=None, subscriptable=None, key=None),
  241. Function(
  242. function="equals",
  243. initializers=None,
  244. parameters=[
  245. Column(
  246. name="metric_id", entity=None, subscriptable=None, key=None
  247. ),
  248. 9223372036854775909,
  249. ],
  250. alias=None,
  251. ),
  252. ],
  253. alias=None,
  254. ),
  255. 1,
  256. ],
  257. alias="p50_transaction_duration",
  258. ),
  259. AliasedExpression(
  260. exp=Column(
  261. name="tags[9223372036854776020]",
  262. entity=None,
  263. subscriptable="tags",
  264. key="9223372036854776020",
  265. ),
  266. alias="transaction",
  267. ),
  268. ],
  269. "groupby": [
  270. Function(
  271. function="transform",
  272. initializers=None,
  273. parameters=[
  274. Column(name="project_id", entity=None, subscriptable=None, key=None),
  275. [5],
  276. ["bar"],
  277. "",
  278. ],
  279. alias="project",
  280. ),
  281. AliasedExpression(
  282. exp=Column(
  283. name="tags[9223372036854776020]",
  284. entity=None,
  285. subscriptable="tags",
  286. key="9223372036854776020",
  287. ),
  288. alias="transaction",
  289. ),
  290. ],
  291. "array_join": None,
  292. "where": [
  293. Condition(
  294. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  295. op=Op.GTE,
  296. rhs=datetime.datetime(2022, 3, 24, 11, 11, 34, 26663, tzinfo=pytz.utc),
  297. ),
  298. Condition(
  299. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  300. op=Op.LT,
  301. rhs=datetime.datetime(2022, 6, 22, 11, 11, 34, 26663, tzinfo=pytz.utc),
  302. ),
  303. Condition(
  304. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  305. op=Op.IN,
  306. rhs=[5],
  307. ),
  308. Condition(
  309. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  310. op=Op.EQ,
  311. rhs=5,
  312. ),
  313. Condition(
  314. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  315. op=Op.IN,
  316. rhs=[9223372036854775909],
  317. ),
  318. ],
  319. "having": [
  320. Condition(
  321. lhs=Function(
  322. function="arrayElement",
  323. initializers=None,
  324. parameters=[
  325. Function(
  326. function="quantilesIf(0.5)",
  327. initializers=None,
  328. parameters=[
  329. Column(name="value", entity=None, subscriptable=None, key=None),
  330. Function(
  331. function="equals",
  332. initializers=None,
  333. parameters=[
  334. Column(
  335. name="metric_id",
  336. entity=None,
  337. subscriptable=None,
  338. key=None,
  339. ),
  340. 9223372036854775909,
  341. ],
  342. alias=None,
  343. ),
  344. ],
  345. alias=None,
  346. ),
  347. 1,
  348. ],
  349. alias="p50_transaction_duration",
  350. ),
  351. op=Op.LT,
  352. rhs=50.0,
  353. )
  354. ],
  355. "orderby": [],
  356. "limitby": None,
  357. "limit": Limit(limit=51),
  358. "offset": Offset(offset=0),
  359. "granularity": None,
  360. "totals": None,
  361. }, # Checked + discarded
  362. {
  363. "match": Entity("metrics_distributions"),
  364. "select": [
  365. Function(
  366. function="arrayElement",
  367. initializers=None,
  368. parameters=[
  369. Function(
  370. function="quantilesIf(0.5)",
  371. initializers=None,
  372. parameters=[
  373. Column(name="value", entity=None, subscriptable=None, key=None),
  374. Function(
  375. function="equals",
  376. initializers=None,
  377. parameters=[
  378. Column(
  379. name="metric_id", entity=None, subscriptable=None, key=None
  380. ),
  381. 9223372036854775909,
  382. ],
  383. alias=None,
  384. ),
  385. ],
  386. alias=None,
  387. ),
  388. 1,
  389. ],
  390. alias="p50_transaction_duration",
  391. ),
  392. AliasedExpression(
  393. exp=Column(
  394. name="tags[9223372036854776020]",
  395. entity=None,
  396. subscriptable="tags",
  397. key="9223372036854776020",
  398. ),
  399. alias="transaction",
  400. ),
  401. ],
  402. "groupby": [
  403. Function(
  404. function="transform",
  405. initializers=None,
  406. parameters=[
  407. Column(name="project_id", entity=None, subscriptable=None, key=None),
  408. [6],
  409. ["bar"],
  410. "",
  411. ],
  412. alias="project",
  413. ),
  414. AliasedExpression(
  415. exp=Column(
  416. name="tags[9223372036854776020]",
  417. entity=None,
  418. subscriptable="tags",
  419. key="9223372036854776020",
  420. ),
  421. alias="transaction",
  422. ),
  423. ],
  424. "array_join": None,
  425. "where": [
  426. Condition(
  427. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  428. op=Op.GTE,
  429. rhs=datetime.datetime(2022, 3, 24, 11, 11, 34, 303387, tzinfo=pytz.utc),
  430. ),
  431. Condition(
  432. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  433. op=Op.LT,
  434. rhs=datetime.datetime(2022, 6, 22, 11, 11, 34, 303387, tzinfo=pytz.utc),
  435. ),
  436. Condition(
  437. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  438. op=Op.IN,
  439. rhs=[6],
  440. ),
  441. Condition(
  442. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  443. op=Op.EQ,
  444. rhs=6,
  445. ),
  446. Condition(
  447. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  448. op=Op.IN,
  449. rhs=[9223372036854775909],
  450. ),
  451. ],
  452. "having": [
  453. Condition(
  454. lhs=Function(
  455. function="arrayElement",
  456. initializers=None,
  457. parameters=[
  458. Function(
  459. function="quantilesIf(0.75)",
  460. initializers=None,
  461. parameters=[
  462. Column(name="value", entity=None, subscriptable=None, key=None),
  463. Function(
  464. function="equals",
  465. initializers=None,
  466. parameters=[
  467. Column(
  468. name="metric_id",
  469. entity=None,
  470. subscriptable=None,
  471. key=None,
  472. ),
  473. 9223372036854775909,
  474. ],
  475. alias=None,
  476. ),
  477. ],
  478. alias=None,
  479. ),
  480. 1,
  481. ],
  482. alias="p75_transaction_duration",
  483. ),
  484. op=Op.LT,
  485. rhs=50.0,
  486. )
  487. ],
  488. "orderby": [],
  489. "limitby": None,
  490. "limit": Limit(limit=51),
  491. "offset": Offset(offset=0),
  492. "granularity": None,
  493. "totals": None,
  494. }, # Checked + discarded
  495. {
  496. "match": Entity("metrics_distributions"),
  497. "select": [
  498. Function(
  499. function="countIf",
  500. initializers=None,
  501. parameters=[
  502. Column(name="value", entity=None, subscriptable=None, key=None),
  503. Function(
  504. function="and",
  505. initializers=None,
  506. parameters=[
  507. Function(
  508. function="equals",
  509. initializers=None,
  510. parameters=[
  511. Column(
  512. name="tags[226]",
  513. entity=None,
  514. subscriptable="tags",
  515. key="226",
  516. ),
  517. 250,
  518. ],
  519. alias=None,
  520. ),
  521. Function(
  522. function="equals",
  523. initializers=None,
  524. parameters=[
  525. Column(
  526. name="metric_id", entity=None, subscriptable=None, key=None
  527. ),
  528. 9223372036854775914,
  529. ],
  530. alias=None,
  531. ),
  532. ],
  533. alias=None,
  534. ),
  535. ],
  536. alias="count_web_vitals_measurements_cls_good",
  537. ),
  538. Function(
  539. function="countIf",
  540. initializers=None,
  541. parameters=[
  542. Column(name="value", entity=None, subscriptable=None, key=None),
  543. Function(
  544. function="and",
  545. initializers=None,
  546. parameters=[
  547. Function(
  548. function="equals",
  549. initializers=None,
  550. parameters=[
  551. Column(
  552. name="tags[226]",
  553. entity=None,
  554. subscriptable="tags",
  555. key="226",
  556. ),
  557. 236,
  558. ],
  559. alias=None,
  560. ),
  561. Function(
  562. function="equals",
  563. initializers=None,
  564. parameters=[
  565. Column(
  566. name="metric_id", entity=None, subscriptable=None, key=None
  567. ),
  568. 9223372036854775915,
  569. ],
  570. alias=None,
  571. ),
  572. ],
  573. alias=None,
  574. ),
  575. ],
  576. alias="count_web_vitals_measurements_fid_meh",
  577. ),
  578. AliasedExpression(
  579. exp=Column(
  580. name="tags[9223372036854776020]",
  581. entity=None,
  582. subscriptable="tags",
  583. key="9223372036854776020",
  584. ),
  585. alias="transaction",
  586. ),
  587. Function(
  588. function="countIf",
  589. initializers=None,
  590. parameters=[
  591. Column(name="value", entity=None, subscriptable=None, key=None),
  592. Function(
  593. function="and",
  594. initializers=None,
  595. parameters=[
  596. Function(
  597. function="equals",
  598. initializers=None,
  599. parameters=[
  600. Column(
  601. name="tags[226]",
  602. entity=None,
  603. subscriptable="tags",
  604. key="226",
  605. ),
  606. 250,
  607. ],
  608. alias=None,
  609. ),
  610. Function(
  611. function="equals",
  612. initializers=None,
  613. parameters=[
  614. Column(
  615. name="metric_id", entity=None, subscriptable=None, key=None
  616. ),
  617. 9223372036854775916,
  618. ],
  619. alias=None,
  620. ),
  621. ],
  622. alias=None,
  623. ),
  624. ],
  625. alias="count_web_vitals_measurements_fp_good",
  626. ),
  627. Function(
  628. function="countIf",
  629. initializers=None,
  630. parameters=[
  631. Column(name="value", entity=None, subscriptable=None, key=None),
  632. Function(
  633. function="and",
  634. initializers=None,
  635. parameters=[
  636. Function(
  637. function="equals",
  638. initializers=None,
  639. parameters=[
  640. Column(
  641. name="tags[226]",
  642. entity=None,
  643. subscriptable="tags",
  644. key="226",
  645. ),
  646. 250,
  647. ],
  648. alias=None,
  649. ),
  650. Function(
  651. function="equals",
  652. initializers=None,
  653. parameters=[
  654. Column(
  655. name="metric_id", entity=None, subscriptable=None, key=None
  656. ),
  657. 9223372036854775911,
  658. ],
  659. alias=None,
  660. ),
  661. ],
  662. alias=None,
  663. ),
  664. ],
  665. alias="count_web_vitals_measurements_lcp_good",
  666. ),
  667. Function(
  668. function="countIf",
  669. initializers=None,
  670. parameters=[
  671. Column(name="value", entity=None, subscriptable=None, key=None),
  672. Function(
  673. function="and",
  674. initializers=None,
  675. parameters=[
  676. Function(
  677. function="equals",
  678. initializers=None,
  679. parameters=[
  680. Column(
  681. name="tags[226]",
  682. entity=None,
  683. subscriptable="tags",
  684. key="226",
  685. ),
  686. 236,
  687. ],
  688. alias=None,
  689. ),
  690. Function(
  691. function="equals",
  692. initializers=None,
  693. parameters=[
  694. Column(
  695. name="metric_id", entity=None, subscriptable=None, key=None
  696. ),
  697. 9223372036854775910,
  698. ],
  699. alias=None,
  700. ),
  701. ],
  702. alias=None,
  703. ),
  704. ],
  705. alias="count_web_vitals_measurements_fcp_meh",
  706. ),
  707. ],
  708. "groupby": [
  709. AliasedExpression(
  710. exp=Column(
  711. name="tags[9223372036854776020]",
  712. entity=None,
  713. subscriptable="tags",
  714. key="9223372036854776020",
  715. ),
  716. alias="transaction",
  717. )
  718. ],
  719. "array_join": None,
  720. "where": [
  721. Condition(
  722. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  723. op=Op.GTE,
  724. rhs=datetime.datetime(2022, 3, 24, 11, 11, 35, 447729, tzinfo=pytz.utc),
  725. ),
  726. Condition(
  727. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  728. op=Op.LT,
  729. rhs=datetime.datetime(2022, 6, 22, 11, 11, 35, 447729, tzinfo=pytz.utc),
  730. ),
  731. Condition(
  732. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  733. op=Op.IN,
  734. rhs=[11],
  735. ),
  736. Condition(
  737. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  738. op=Op.EQ,
  739. rhs=11,
  740. ),
  741. Condition(
  742. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  743. op=Op.IN,
  744. rhs=[
  745. 9223372036854775910,
  746. 9223372036854775911,
  747. 9223372036854775914,
  748. 9223372036854775915,
  749. 9223372036854775916,
  750. ],
  751. ),
  752. ],
  753. "having": [],
  754. "orderby": [],
  755. "limitby": None,
  756. "limit": Limit(limit=51),
  757. "offset": Offset(offset=0),
  758. "granularity": None,
  759. "totals": None,
  760. }, # Checked + added
  761. {
  762. "match": Entity("metrics_distributions"),
  763. "select": [
  764. Function(
  765. function="toUInt64",
  766. initializers=None,
  767. parameters=[0],
  768. alias="count_web_vitals_measurements_lcp_poor",
  769. ),
  770. AliasedExpression(
  771. exp=Column(
  772. name="tags[9223372036854776020]",
  773. entity=None,
  774. subscriptable="tags",
  775. key="9223372036854776020",
  776. ),
  777. alias="transaction",
  778. ),
  779. ],
  780. "groupby": [
  781. AliasedExpression(
  782. exp=Column(
  783. name="tags[9223372036854776020]",
  784. entity=None,
  785. subscriptable="tags",
  786. key="9223372036854776020",
  787. ),
  788. alias="transaction",
  789. )
  790. ],
  791. "array_join": None,
  792. "where": [
  793. Condition(
  794. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  795. op=Op.GTE,
  796. rhs=datetime.datetime(2022, 3, 24, 11, 11, 35, 707018, tzinfo=pytz.utc),
  797. ),
  798. Condition(
  799. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  800. op=Op.LT,
  801. rhs=datetime.datetime(2022, 6, 22, 11, 11, 35, 707018, tzinfo=pytz.utc),
  802. ),
  803. Condition(
  804. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  805. op=Op.IN,
  806. rhs=[12],
  807. ),
  808. Condition(
  809. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  810. op=Op.EQ,
  811. rhs=12,
  812. ),
  813. Condition(
  814. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  815. op=Op.IN,
  816. rhs=[9223372036854775911],
  817. ),
  818. ],
  819. "having": [],
  820. "orderby": [],
  821. "limitby": None,
  822. "limit": Limit(limit=51),
  823. "offset": Offset(offset=0),
  824. "granularity": None,
  825. "totals": None,
  826. }, # Checked + discarded
  827. {
  828. "match": Entity("metrics_distributions"),
  829. "select": [
  830. AliasedExpression(
  831. exp=Column(
  832. name="tags[9223372036854776021]",
  833. entity=None,
  834. subscriptable="tags",
  835. key="9223372036854776021",
  836. ),
  837. alias="transaction.status",
  838. ),
  839. AliasedExpression(
  840. exp=Column(
  841. name="tags[9223372036854776020]",
  842. entity=None,
  843. subscriptable="tags",
  844. key="9223372036854776020",
  845. ),
  846. alias="transaction",
  847. ),
  848. Function(
  849. function="arrayElement",
  850. initializers=None,
  851. parameters=[
  852. Function(
  853. function="quantilesIf(0.95)",
  854. initializers=None,
  855. parameters=[
  856. Column(name="value", entity=None, subscriptable=None, key=None),
  857. Function(
  858. function="equals",
  859. initializers=None,
  860. parameters=[
  861. Column(
  862. name="metric_id", entity=None, subscriptable=None, key=None
  863. ),
  864. 9223372036854775909,
  865. ],
  866. alias=None,
  867. ),
  868. ],
  869. alias=None,
  870. ),
  871. 1,
  872. ],
  873. alias="p95",
  874. ),
  875. Function(
  876. function="divide",
  877. initializers=None,
  878. parameters=[
  879. Function(
  880. function="countIf",
  881. initializers=None,
  882. parameters=[
  883. Column(name="value", entity=None, subscriptable=None, key=None),
  884. Function(
  885. function="equals",
  886. initializers=None,
  887. parameters=[
  888. Column(
  889. name="metric_id", entity=None, subscriptable=None, key=None
  890. ),
  891. 9223372036854775909,
  892. ],
  893. alias=None,
  894. ),
  895. ],
  896. alias=None,
  897. ),
  898. Function(
  899. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  900. ),
  901. ],
  902. alias="epm",
  903. ),
  904. Function(
  905. function="divide",
  906. initializers=None,
  907. parameters=[
  908. Function(
  909. function="countIf",
  910. initializers=None,
  911. parameters=[
  912. Column(name="value", entity=None, subscriptable=None, key=None),
  913. Function(
  914. function="and",
  915. initializers=None,
  916. parameters=[
  917. Function(
  918. function="equals",
  919. initializers=None,
  920. parameters=[
  921. Column(
  922. name="metric_id",
  923. entity=None,
  924. subscriptable=None,
  925. key=None,
  926. ),
  927. 9223372036854775909,
  928. ],
  929. alias=None,
  930. ),
  931. Function(
  932. function="notIn",
  933. initializers=None,
  934. parameters=[
  935. Column(
  936. name="tags[9223372036854776021]",
  937. entity=None,
  938. subscriptable="tags",
  939. key="9223372036854776021",
  940. ),
  941. [
  942. 9223372036854776028,
  943. 9223372036854776027,
  944. 9223372036854776029,
  945. ],
  946. ],
  947. alias=None,
  948. ),
  949. ],
  950. alias=None,
  951. ),
  952. ],
  953. alias=None,
  954. ),
  955. Function(
  956. function="countIf",
  957. initializers=None,
  958. parameters=[
  959. Column(name="value", entity=None, subscriptable=None, key=None),
  960. Function(
  961. function="equals",
  962. initializers=None,
  963. parameters=[
  964. Column(
  965. name="metric_id", entity=None, subscriptable=None, key=None
  966. ),
  967. 9223372036854775909,
  968. ],
  969. alias=None,
  970. ),
  971. ],
  972. alias=None,
  973. ),
  974. ],
  975. alias="failure_rate",
  976. ),
  977. ],
  978. "groupby": [
  979. AliasedExpression(
  980. exp=Column(
  981. name="tags[9223372036854776021]",
  982. entity=None,
  983. subscriptable="tags",
  984. key="9223372036854776021",
  985. ),
  986. alias="transaction.status",
  987. ),
  988. Function(
  989. function="toInt8", initializers=None, parameters=[0], alias="team_key_transaction"
  990. ),
  991. AliasedExpression(
  992. exp=Column(
  993. name="tags[9223372036854776020]",
  994. entity=None,
  995. subscriptable="tags",
  996. key="9223372036854776020",
  997. ),
  998. alias="transaction",
  999. ),
  1000. Function(
  1001. function="transform",
  1002. initializers=None,
  1003. parameters=[
  1004. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1005. [13],
  1006. ["bar"],
  1007. "",
  1008. ],
  1009. alias="project",
  1010. ),
  1011. ],
  1012. "array_join": None,
  1013. "where": [
  1014. Condition(
  1015. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1016. op=Op.GTE,
  1017. rhs=datetime.datetime(2022, 3, 24, 11, 11, 36, 75132, tzinfo=pytz.utc),
  1018. ),
  1019. Condition(
  1020. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1021. op=Op.LT,
  1022. rhs=datetime.datetime(2022, 6, 22, 11, 11, 36, 75132, tzinfo=pytz.utc),
  1023. ),
  1024. Condition(
  1025. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1026. op=Op.IN,
  1027. rhs=[13],
  1028. ),
  1029. Condition(
  1030. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1031. op=Op.EQ,
  1032. rhs=14,
  1033. ),
  1034. Condition(
  1035. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  1036. op=Op.IN,
  1037. rhs=[9223372036854775909],
  1038. ),
  1039. ],
  1040. "having": [],
  1041. "orderby": [
  1042. OrderBy(
  1043. exp=Function(
  1044. function="arrayElement",
  1045. initializers=None,
  1046. parameters=[
  1047. Function(
  1048. function="quantilesIf(0.95)",
  1049. initializers=None,
  1050. parameters=[
  1051. Column(name="value", entity=None, subscriptable=None, key=None),
  1052. Function(
  1053. function="equals",
  1054. initializers=None,
  1055. parameters=[
  1056. Column(
  1057. name="metric_id",
  1058. entity=None,
  1059. subscriptable=None,
  1060. key=None,
  1061. ),
  1062. 9223372036854775909,
  1063. ],
  1064. alias=None,
  1065. ),
  1066. ],
  1067. alias=None,
  1068. ),
  1069. 1,
  1070. ],
  1071. alias="p95",
  1072. ),
  1073. direction=Direction.ASC,
  1074. )
  1075. ],
  1076. "limitby": None,
  1077. "limit": Limit(limit=51),
  1078. "offset": Offset(offset=0),
  1079. "granularity": None,
  1080. "totals": None,
  1081. }, # Checked
  1082. {
  1083. "match": Entity("metrics_distributions"),
  1084. "select": [
  1085. Function(
  1086. function="arrayElement",
  1087. initializers=None,
  1088. parameters=[
  1089. Function(
  1090. function="quantilesIf(0.5)",
  1091. initializers=None,
  1092. parameters=[
  1093. Column(name="value", entity=None, subscriptable=None, key=None),
  1094. Function(
  1095. function="equals",
  1096. initializers=None,
  1097. parameters=[
  1098. Column(
  1099. name="metric_id", entity=None, subscriptable=None, key=None
  1100. ),
  1101. 9223372036854775909,
  1102. ],
  1103. alias=None,
  1104. ),
  1105. ],
  1106. alias=None,
  1107. ),
  1108. 1,
  1109. ],
  1110. alias="p50",
  1111. )
  1112. ],
  1113. "groupby": [],
  1114. "array_join": None,
  1115. "where": [
  1116. Condition(
  1117. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1118. op=Op.GTE,
  1119. rhs=datetime.datetime(2022, 3, 24, 11, 11, 36, 936975, tzinfo=pytz.utc),
  1120. ),
  1121. Condition(
  1122. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1123. op=Op.LT,
  1124. rhs=datetime.datetime(2022, 6, 22, 11, 11, 36, 936975, tzinfo=pytz.utc),
  1125. ),
  1126. Condition(
  1127. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1128. op=Op.IN,
  1129. rhs=[17],
  1130. ),
  1131. Condition(
  1132. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1133. op=Op.EQ,
  1134. rhs=18,
  1135. ),
  1136. Condition(
  1137. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  1138. op=Op.IN,
  1139. rhs=[9223372036854775909],
  1140. ),
  1141. ],
  1142. "having": [],
  1143. "orderby": [],
  1144. "limitby": None,
  1145. "limit": Limit(limit=101),
  1146. "offset": Offset(offset=0),
  1147. "granularity": None,
  1148. "totals": None,
  1149. }, # Checked
  1150. {
  1151. "match": Entity("metrics_distributions"),
  1152. "select": [
  1153. Function(
  1154. function="divide",
  1155. initializers=None,
  1156. parameters=[
  1157. Function(
  1158. function="plus",
  1159. initializers=None,
  1160. parameters=[
  1161. Function(
  1162. function="countIf",
  1163. initializers=None,
  1164. parameters=[
  1165. Column(name="value", entity=None, subscriptable=None, key=None),
  1166. Function(
  1167. function="and",
  1168. initializers=None,
  1169. parameters=[
  1170. Function(
  1171. function="equals",
  1172. initializers=None,
  1173. parameters=[
  1174. Column(
  1175. name="metric_id",
  1176. entity=None,
  1177. subscriptable=None,
  1178. key=None,
  1179. ),
  1180. 9223372036854775909,
  1181. ],
  1182. alias=None,
  1183. ),
  1184. Function(
  1185. function="equals",
  1186. initializers=None,
  1187. parameters=[
  1188. Column(
  1189. name="tags[446]",
  1190. entity=None,
  1191. subscriptable="tags",
  1192. key="446",
  1193. ),
  1194. 429,
  1195. ],
  1196. alias=None,
  1197. ),
  1198. ],
  1199. alias=None,
  1200. ),
  1201. ],
  1202. alias=None,
  1203. ),
  1204. Function(
  1205. function="divide",
  1206. initializers=None,
  1207. parameters=[
  1208. Function(
  1209. function="countIf",
  1210. initializers=None,
  1211. parameters=[
  1212. Column(
  1213. name="value",
  1214. entity=None,
  1215. subscriptable=None,
  1216. key=None,
  1217. ),
  1218. Function(
  1219. function="and",
  1220. initializers=None,
  1221. parameters=[
  1222. Function(
  1223. function="equals",
  1224. initializers=None,
  1225. parameters=[
  1226. Column(
  1227. name="metric_id",
  1228. entity=None,
  1229. subscriptable=None,
  1230. key=None,
  1231. ),
  1232. 9223372036854775909,
  1233. ],
  1234. alias=None,
  1235. ),
  1236. Function(
  1237. function="equals",
  1238. initializers=None,
  1239. parameters=[
  1240. Column(
  1241. name="tags[427]",
  1242. entity=None,
  1243. subscriptable="tags",
  1244. key="427",
  1245. ),
  1246. 429,
  1247. ],
  1248. alias=None,
  1249. ),
  1250. ],
  1251. alias=None,
  1252. ),
  1253. ],
  1254. alias=None,
  1255. ),
  1256. 2,
  1257. ],
  1258. alias=None,
  1259. ),
  1260. ],
  1261. alias=None,
  1262. ),
  1263. Function(
  1264. function="countIf",
  1265. initializers=None,
  1266. parameters=[
  1267. Function(
  1268. function="equals",
  1269. initializers=None,
  1270. parameters=[
  1271. Column(
  1272. name="metric_id", entity=None, subscriptable=None, key=None
  1273. ),
  1274. 9223372036854775909,
  1275. ],
  1276. alias=None,
  1277. )
  1278. ],
  1279. alias=None,
  1280. ),
  1281. ],
  1282. alias="apdex",
  1283. ),
  1284. Function(
  1285. function="arrayElement",
  1286. initializers=None,
  1287. parameters=[
  1288. Function(
  1289. function="quantilesIf(0.75)",
  1290. initializers=None,
  1291. parameters=[
  1292. Column(name="value", entity=None, subscriptable=None, key=None),
  1293. Function(
  1294. function="equals",
  1295. initializers=None,
  1296. parameters=[
  1297. Column(
  1298. name="metric_id", entity=None, subscriptable=None, key=None
  1299. ),
  1300. 9223372036854775914,
  1301. ],
  1302. alias=None,
  1303. ),
  1304. ],
  1305. alias=None,
  1306. ),
  1307. 1,
  1308. ],
  1309. alias="p75_measurements_cls",
  1310. ),
  1311. Function(
  1312. function="divide",
  1313. initializers=None,
  1314. parameters=[
  1315. Function(
  1316. function="countIf",
  1317. initializers=None,
  1318. parameters=[
  1319. Column(name="value", entity=None, subscriptable=None, key=None),
  1320. Function(
  1321. function="equals",
  1322. initializers=None,
  1323. parameters=[
  1324. Column(
  1325. name="metric_id", entity=None, subscriptable=None, key=None
  1326. ),
  1327. 9223372036854775909,
  1328. ],
  1329. alias=None,
  1330. ),
  1331. ],
  1332. alias=None,
  1333. ),
  1334. Function(
  1335. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  1336. ),
  1337. ],
  1338. alias="tpm",
  1339. ),
  1340. Function(
  1341. function="arrayElement",
  1342. initializers=None,
  1343. parameters=[
  1344. Function(
  1345. function="quantilesIf(0.75)",
  1346. initializers=None,
  1347. parameters=[
  1348. Column(name="value", entity=None, subscriptable=None, key=None),
  1349. Function(
  1350. function="equals",
  1351. initializers=None,
  1352. parameters=[
  1353. Column(
  1354. name="metric_id", entity=None, subscriptable=None, key=None
  1355. ),
  1356. 9223372036854775915,
  1357. ],
  1358. alias=None,
  1359. ),
  1360. ],
  1361. alias=None,
  1362. ),
  1363. 1,
  1364. ],
  1365. alias="p75_measurements_fid",
  1366. ),
  1367. AliasedExpression(
  1368. exp=Column(
  1369. name="tags[9223372036854776020]",
  1370. entity=None,
  1371. subscriptable="tags",
  1372. key="9223372036854776020",
  1373. ),
  1374. alias="transaction",
  1375. ),
  1376. Function(
  1377. function="arrayElement",
  1378. initializers=None,
  1379. parameters=[
  1380. Function(
  1381. function="quantilesIf(0.75)",
  1382. initializers=None,
  1383. parameters=[
  1384. Column(name="value", entity=None, subscriptable=None, key=None),
  1385. Function(
  1386. function="equals",
  1387. initializers=None,
  1388. parameters=[
  1389. Column(
  1390. name="metric_id", entity=None, subscriptable=None, key=None
  1391. ),
  1392. 9223372036854775910,
  1393. ],
  1394. alias=None,
  1395. ),
  1396. ],
  1397. alias=None,
  1398. ),
  1399. 1,
  1400. ],
  1401. alias="p75_measurements_fcp",
  1402. ),
  1403. Function(
  1404. function="arrayElement",
  1405. initializers=None,
  1406. parameters=[
  1407. Function(
  1408. function="quantilesIf(0.75)",
  1409. initializers=None,
  1410. parameters=[
  1411. Column(name="value", entity=None, subscriptable=None, key=None),
  1412. Function(
  1413. function="equals",
  1414. initializers=None,
  1415. parameters=[
  1416. Column(
  1417. name="metric_id", entity=None, subscriptable=None, key=None
  1418. ),
  1419. 9223372036854775911,
  1420. ],
  1421. alias=None,
  1422. ),
  1423. ],
  1424. alias=None,
  1425. ),
  1426. 1,
  1427. ],
  1428. alias="p75_measurements_lcp",
  1429. ),
  1430. ],
  1431. "groupby": [
  1432. AliasedExpression(
  1433. exp=Column(
  1434. name="tags[9223372036854776020]",
  1435. entity=None,
  1436. subscriptable="tags",
  1437. key="9223372036854776020",
  1438. ),
  1439. alias="transaction",
  1440. ),
  1441. Function(
  1442. function="transform",
  1443. initializers=None,
  1444. parameters=[
  1445. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1446. [18],
  1447. ["bar"],
  1448. "",
  1449. ],
  1450. alias="project",
  1451. ),
  1452. ],
  1453. "array_join": None,
  1454. "where": [
  1455. Condition(
  1456. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1457. op=Op.GTE,
  1458. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 278535, tzinfo=pytz.utc),
  1459. ),
  1460. Condition(
  1461. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1462. op=Op.LT,
  1463. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 278535, tzinfo=pytz.utc),
  1464. ),
  1465. Condition(
  1466. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1467. op=Op.IN,
  1468. rhs=[18],
  1469. ),
  1470. Condition(
  1471. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1472. op=Op.EQ,
  1473. rhs=19,
  1474. ),
  1475. Condition(
  1476. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  1477. op=Op.IN,
  1478. rhs=[
  1479. 9223372036854775908,
  1480. 9223372036854775909,
  1481. 9223372036854775910,
  1482. 9223372036854775911,
  1483. 9223372036854775914,
  1484. 9223372036854775915,
  1485. ],
  1486. ),
  1487. ],
  1488. "having": [],
  1489. "orderby": [],
  1490. "limitby": None,
  1491. "limit": Limit(limit=51),
  1492. "offset": Offset(offset=0),
  1493. "granularity": None,
  1494. "totals": None,
  1495. }, # Checked
  1496. {
  1497. "match": Entity("metrics_sets"),
  1498. "select": [
  1499. Function(
  1500. function="uniqIf",
  1501. initializers=None,
  1502. parameters=[
  1503. Column(name="value", entity=None, subscriptable=None, key=None),
  1504. Function(
  1505. function="equals",
  1506. initializers=None,
  1507. parameters=[
  1508. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  1509. 9223372036854775908,
  1510. ],
  1511. alias=None,
  1512. ),
  1513. ],
  1514. alias="count_unique_user",
  1515. ),
  1516. AliasedExpression(
  1517. exp=Column(
  1518. name="tags[9223372036854776020]",
  1519. entity=None,
  1520. subscriptable="tags",
  1521. key="9223372036854776020",
  1522. ),
  1523. alias="transaction",
  1524. ),
  1525. Function(
  1526. function="uniqIf",
  1527. initializers=None,
  1528. parameters=[
  1529. Column(name="value", entity=None, subscriptable=None, key=None),
  1530. Function(
  1531. function="and",
  1532. initializers=None,
  1533. parameters=[
  1534. Function(
  1535. function="equals",
  1536. initializers=None,
  1537. parameters=[
  1538. Column(
  1539. name="metric_id", entity=None, subscriptable=None, key=None
  1540. ),
  1541. 9223372036854775908,
  1542. ],
  1543. alias=None,
  1544. ),
  1545. Function(
  1546. function="equals",
  1547. initializers=None,
  1548. parameters=[
  1549. Column(
  1550. name="tags[440]",
  1551. entity=None,
  1552. subscriptable="tags",
  1553. key="440",
  1554. ),
  1555. 429,
  1556. ],
  1557. alias=None,
  1558. ),
  1559. ],
  1560. alias=None,
  1561. ),
  1562. ],
  1563. alias="count_miserable_user",
  1564. ),
  1565. Function(
  1566. function="divide",
  1567. initializers=None,
  1568. parameters=[
  1569. Function(
  1570. function="plus",
  1571. initializers=None,
  1572. parameters=[
  1573. Function(
  1574. function="uniqIf",
  1575. initializers=None,
  1576. parameters=[
  1577. Column(name="value", entity=None, subscriptable=None, key=None),
  1578. Function(
  1579. function="and",
  1580. initializers=None,
  1581. parameters=[
  1582. Function(
  1583. function="equals",
  1584. initializers=None,
  1585. parameters=[
  1586. Column(
  1587. name="metric_id",
  1588. entity=None,
  1589. subscriptable=None,
  1590. key=None,
  1591. ),
  1592. 9223372036854775908,
  1593. ],
  1594. alias=None,
  1595. ),
  1596. Function(
  1597. function="equals",
  1598. initializers=None,
  1599. parameters=[
  1600. Column(
  1601. name="tags[440]",
  1602. entity=None,
  1603. subscriptable="tags",
  1604. key="440",
  1605. ),
  1606. 429,
  1607. ],
  1608. alias=None,
  1609. ),
  1610. ],
  1611. alias=None,
  1612. ),
  1613. ],
  1614. alias="count_miserable_user",
  1615. ),
  1616. 5.8875,
  1617. ],
  1618. alias=None,
  1619. ),
  1620. Function(
  1621. function="plus",
  1622. initializers=None,
  1623. parameters=[
  1624. Function(
  1625. function="nullIf",
  1626. initializers=None,
  1627. parameters=[
  1628. Function(
  1629. function="uniqIf",
  1630. initializers=None,
  1631. parameters=[
  1632. Column(
  1633. name="value",
  1634. entity=None,
  1635. subscriptable=None,
  1636. key=None,
  1637. ),
  1638. Function(
  1639. function="equals",
  1640. initializers=None,
  1641. parameters=[
  1642. Column(
  1643. name="metric_id",
  1644. entity=None,
  1645. subscriptable=None,
  1646. key=None,
  1647. ),
  1648. 9223372036854775908,
  1649. ],
  1650. alias=None,
  1651. ),
  1652. ],
  1653. alias="count_unique_user",
  1654. ),
  1655. 0,
  1656. ],
  1657. alias=None,
  1658. ),
  1659. 117.75,
  1660. ],
  1661. alias=None,
  1662. ),
  1663. ],
  1664. alias="user_misery",
  1665. ),
  1666. ],
  1667. "groupby": [
  1668. AliasedExpression(
  1669. exp=Column(
  1670. name="tags[9223372036854776020]",
  1671. entity=None,
  1672. subscriptable="tags",
  1673. key="9223372036854776020",
  1674. ),
  1675. alias="transaction",
  1676. ),
  1677. Function(
  1678. function="transform",
  1679. initializers=None,
  1680. parameters=[
  1681. Column(name="project_id", entity=None, subscriptable=None, key=None),
  1682. [18],
  1683. ["bar"],
  1684. "",
  1685. ],
  1686. alias="project",
  1687. ),
  1688. ],
  1689. "array_join": None,
  1690. "where": [
  1691. Condition(
  1692. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1693. op=Op.GTE,
  1694. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 278535, tzinfo=pytz.utc),
  1695. ),
  1696. Condition(
  1697. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  1698. op=Op.LT,
  1699. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 278535, tzinfo=pytz.utc),
  1700. ),
  1701. Condition(
  1702. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  1703. op=Op.IN,
  1704. rhs=[18],
  1705. ),
  1706. Condition(
  1707. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  1708. op=Op.EQ,
  1709. rhs=19,
  1710. ),
  1711. Condition(
  1712. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  1713. op=Op.IN,
  1714. rhs=[
  1715. 9223372036854775908,
  1716. 9223372036854775909,
  1717. 9223372036854775910,
  1718. 9223372036854775911,
  1719. 9223372036854775914,
  1720. 9223372036854775915,
  1721. ],
  1722. ),
  1723. Condition(
  1724. lhs=Function(
  1725. function="tuple",
  1726. initializers=None,
  1727. parameters=[
  1728. Column(
  1729. name="tags[9223372036854776020]",
  1730. entity=None,
  1731. subscriptable="tags",
  1732. key="9223372036854776020",
  1733. ),
  1734. Function(
  1735. function="transform",
  1736. initializers=None,
  1737. parameters=[
  1738. Column(
  1739. name="project_id", entity=None, subscriptable=None, key=None
  1740. ),
  1741. [18],
  1742. ["bar"],
  1743. "",
  1744. ],
  1745. alias="project",
  1746. ),
  1747. ],
  1748. alias=None,
  1749. ),
  1750. op=Op.IN,
  1751. rhs=Function(
  1752. function="tuple", initializers=None, parameters=[(437, "bar")], alias=None
  1753. ),
  1754. ),
  1755. ],
  1756. "having": [],
  1757. "orderby": [],
  1758. "limitby": None,
  1759. "limit": Limit(limit=51),
  1760. "offset": Offset(offset=0),
  1761. "granularity": None,
  1762. "totals": None,
  1763. }, # Checked
  1764. {
  1765. "match": Entity("metrics_distributions"),
  1766. "select": [
  1767. Function(
  1768. function="divide",
  1769. initializers=None,
  1770. parameters=[
  1771. Function(
  1772. function="plus",
  1773. initializers=None,
  1774. parameters=[
  1775. Function(
  1776. function="countIf",
  1777. initializers=None,
  1778. parameters=[
  1779. Column(name="value", entity=None, subscriptable=None, key=None),
  1780. Function(
  1781. function="and",
  1782. initializers=None,
  1783. parameters=[
  1784. Function(
  1785. function="equals",
  1786. initializers=None,
  1787. parameters=[
  1788. Column(
  1789. name="metric_id",
  1790. entity=None,
  1791. subscriptable=None,
  1792. key=None,
  1793. ),
  1794. 9223372036854775909,
  1795. ],
  1796. alias=None,
  1797. ),
  1798. Function(
  1799. function="equals",
  1800. initializers=None,
  1801. parameters=[
  1802. Column(
  1803. name="tags[446]",
  1804. entity=None,
  1805. subscriptable="tags",
  1806. key="446",
  1807. ),
  1808. 429,
  1809. ],
  1810. alias=None,
  1811. ),
  1812. ],
  1813. alias=None,
  1814. ),
  1815. ],
  1816. alias=None,
  1817. ),
  1818. Function(
  1819. function="divide",
  1820. initializers=None,
  1821. parameters=[
  1822. Function(
  1823. function="countIf",
  1824. initializers=None,
  1825. parameters=[
  1826. Column(
  1827. name="value",
  1828. entity=None,
  1829. subscriptable=None,
  1830. key=None,
  1831. ),
  1832. Function(
  1833. function="and",
  1834. initializers=None,
  1835. parameters=[
  1836. Function(
  1837. function="equals",
  1838. initializers=None,
  1839. parameters=[
  1840. Column(
  1841. name="metric_id",
  1842. entity=None,
  1843. subscriptable=None,
  1844. key=None,
  1845. ),
  1846. 9223372036854775909,
  1847. ],
  1848. alias=None,
  1849. ),
  1850. Function(
  1851. function="equals",
  1852. initializers=None,
  1853. parameters=[
  1854. Column(
  1855. name="tags[427]",
  1856. entity=None,
  1857. subscriptable="tags",
  1858. key="427",
  1859. ),
  1860. 429,
  1861. ],
  1862. alias=None,
  1863. ),
  1864. ],
  1865. alias=None,
  1866. ),
  1867. ],
  1868. alias=None,
  1869. ),
  1870. 2,
  1871. ],
  1872. alias=None,
  1873. ),
  1874. ],
  1875. alias=None,
  1876. ),
  1877. Function(
  1878. function="countIf",
  1879. initializers=None,
  1880. parameters=[
  1881. Function(
  1882. function="equals",
  1883. initializers=None,
  1884. parameters=[
  1885. Column(
  1886. name="metric_id", entity=None, subscriptable=None, key=None
  1887. ),
  1888. 9223372036854775909,
  1889. ],
  1890. alias=None,
  1891. )
  1892. ],
  1893. alias=None,
  1894. ),
  1895. ],
  1896. alias="apdex",
  1897. ),
  1898. Function(
  1899. function="arrayElement",
  1900. initializers=None,
  1901. parameters=[
  1902. Function(
  1903. function="quantilesIf(0.75)",
  1904. initializers=None,
  1905. parameters=[
  1906. Column(name="value", entity=None, subscriptable=None, key=None),
  1907. Function(
  1908. function="equals",
  1909. initializers=None,
  1910. parameters=[
  1911. Column(
  1912. name="metric_id", entity=None, subscriptable=None, key=None
  1913. ),
  1914. 9223372036854775914,
  1915. ],
  1916. alias=None,
  1917. ),
  1918. ],
  1919. alias=None,
  1920. ),
  1921. 1,
  1922. ],
  1923. alias="p75_measurements_cls",
  1924. ),
  1925. Function(
  1926. function="divide",
  1927. initializers=None,
  1928. parameters=[
  1929. Function(
  1930. function="countIf",
  1931. initializers=None,
  1932. parameters=[
  1933. Column(name="value", entity=None, subscriptable=None, key=None),
  1934. Function(
  1935. function="equals",
  1936. initializers=None,
  1937. parameters=[
  1938. Column(
  1939. name="metric_id", entity=None, subscriptable=None, key=None
  1940. ),
  1941. 9223372036854775909,
  1942. ],
  1943. alias=None,
  1944. ),
  1945. ],
  1946. alias=None,
  1947. ),
  1948. Function(
  1949. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  1950. ),
  1951. ],
  1952. alias="tpm",
  1953. ),
  1954. Function(
  1955. function="arrayElement",
  1956. initializers=None,
  1957. parameters=[
  1958. Function(
  1959. function="quantilesIf(0.75)",
  1960. initializers=None,
  1961. parameters=[
  1962. Column(name="value", entity=None, subscriptable=None, key=None),
  1963. Function(
  1964. function="equals",
  1965. initializers=None,
  1966. parameters=[
  1967. Column(
  1968. name="metric_id", entity=None, subscriptable=None, key=None
  1969. ),
  1970. 9223372036854775915,
  1971. ],
  1972. alias=None,
  1973. ),
  1974. ],
  1975. alias=None,
  1976. ),
  1977. 1,
  1978. ],
  1979. alias="p75_measurements_fid",
  1980. ),
  1981. AliasedExpression(
  1982. exp=Column(
  1983. name="tags[9223372036854776020]",
  1984. entity=None,
  1985. subscriptable="tags",
  1986. key="9223372036854776020",
  1987. ),
  1988. alias="transaction",
  1989. ),
  1990. Function(
  1991. function="arrayElement",
  1992. initializers=None,
  1993. parameters=[
  1994. Function(
  1995. function="quantilesIf(0.75)",
  1996. initializers=None,
  1997. parameters=[
  1998. Column(name="value", entity=None, subscriptable=None, key=None),
  1999. Function(
  2000. function="equals",
  2001. initializers=None,
  2002. parameters=[
  2003. Column(
  2004. name="metric_id", entity=None, subscriptable=None, key=None
  2005. ),
  2006. 9223372036854775910,
  2007. ],
  2008. alias=None,
  2009. ),
  2010. ],
  2011. alias=None,
  2012. ),
  2013. 1,
  2014. ],
  2015. alias="p75_measurements_fcp",
  2016. ),
  2017. Function(
  2018. function="arrayElement",
  2019. initializers=None,
  2020. parameters=[
  2021. Function(
  2022. function="quantilesIf(0.75)",
  2023. initializers=None,
  2024. parameters=[
  2025. Column(name="value", entity=None, subscriptable=None, key=None),
  2026. Function(
  2027. function="equals",
  2028. initializers=None,
  2029. parameters=[
  2030. Column(
  2031. name="metric_id", entity=None, subscriptable=None, key=None
  2032. ),
  2033. 9223372036854775911,
  2034. ],
  2035. alias=None,
  2036. ),
  2037. ],
  2038. alias=None,
  2039. ),
  2040. 1,
  2041. ],
  2042. alias="p75_measurements_lcp",
  2043. ),
  2044. ],
  2045. "groupby": [
  2046. AliasedExpression(
  2047. exp=Column(
  2048. name="tags[9223372036854776020]",
  2049. entity=None,
  2050. subscriptable="tags",
  2051. key="9223372036854776020",
  2052. ),
  2053. alias="transaction",
  2054. ),
  2055. Function(
  2056. function="transform",
  2057. initializers=None,
  2058. parameters=[
  2059. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2060. [18],
  2061. ["bar"],
  2062. "",
  2063. ],
  2064. alias="project",
  2065. ),
  2066. ],
  2067. "array_join": None,
  2068. "where": [
  2069. Condition(
  2070. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2071. op=Op.GTE,
  2072. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 440461, tzinfo=pytz.utc),
  2073. ),
  2074. Condition(
  2075. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2076. op=Op.LT,
  2077. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 440461, tzinfo=pytz.utc),
  2078. ),
  2079. Condition(
  2080. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2081. op=Op.IN,
  2082. rhs=[18],
  2083. ),
  2084. Condition(
  2085. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2086. op=Op.EQ,
  2087. rhs=19,
  2088. ),
  2089. Condition(
  2090. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  2091. op=Op.IN,
  2092. rhs=[
  2093. 9223372036854775908,
  2094. 9223372036854775909,
  2095. 9223372036854775910,
  2096. 9223372036854775911,
  2097. 9223372036854775914,
  2098. 9223372036854775915,
  2099. ],
  2100. ),
  2101. ],
  2102. "having": [],
  2103. "orderby": [],
  2104. "limitby": None,
  2105. "limit": Limit(limit=51),
  2106. "offset": Offset(offset=0),
  2107. "granularity": None,
  2108. "totals": None,
  2109. }, # Checked
  2110. {
  2111. "match": Entity("metrics_sets"),
  2112. "select": [
  2113. Function(
  2114. function="uniqIf",
  2115. initializers=None,
  2116. parameters=[
  2117. Column(name="value", entity=None, subscriptable=None, key=None),
  2118. Function(
  2119. function="equals",
  2120. initializers=None,
  2121. parameters=[
  2122. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  2123. 9223372036854775908,
  2124. ],
  2125. alias=None,
  2126. ),
  2127. ],
  2128. alias="count_unique_user",
  2129. ),
  2130. AliasedExpression(
  2131. exp=Column(
  2132. name="tags[9223372036854776020]",
  2133. entity=None,
  2134. subscriptable="tags",
  2135. key="9223372036854776020",
  2136. ),
  2137. alias="transaction",
  2138. ),
  2139. Function(
  2140. function="uniqIf",
  2141. initializers=None,
  2142. parameters=[
  2143. Column(name="value", entity=None, subscriptable=None, key=None),
  2144. Function(
  2145. function="and",
  2146. initializers=None,
  2147. parameters=[
  2148. Function(
  2149. function="equals",
  2150. initializers=None,
  2151. parameters=[
  2152. Column(
  2153. name="metric_id", entity=None, subscriptable=None, key=None
  2154. ),
  2155. 9223372036854775908,
  2156. ],
  2157. alias=None,
  2158. ),
  2159. Function(
  2160. function="equals",
  2161. initializers=None,
  2162. parameters=[
  2163. Column(
  2164. name="tags[440]",
  2165. entity=None,
  2166. subscriptable="tags",
  2167. key="440",
  2168. ),
  2169. 429,
  2170. ],
  2171. alias=None,
  2172. ),
  2173. ],
  2174. alias=None,
  2175. ),
  2176. ],
  2177. alias="count_miserable_user",
  2178. ),
  2179. Function(
  2180. function="divide",
  2181. initializers=None,
  2182. parameters=[
  2183. Function(
  2184. function="plus",
  2185. initializers=None,
  2186. parameters=[
  2187. Function(
  2188. function="uniqIf",
  2189. initializers=None,
  2190. parameters=[
  2191. Column(name="value", entity=None, subscriptable=None, key=None),
  2192. Function(
  2193. function="and",
  2194. initializers=None,
  2195. parameters=[
  2196. Function(
  2197. function="equals",
  2198. initializers=None,
  2199. parameters=[
  2200. Column(
  2201. name="metric_id",
  2202. entity=None,
  2203. subscriptable=None,
  2204. key=None,
  2205. ),
  2206. 9223372036854775908,
  2207. ],
  2208. alias=None,
  2209. ),
  2210. Function(
  2211. function="equals",
  2212. initializers=None,
  2213. parameters=[
  2214. Column(
  2215. name="tags[440]",
  2216. entity=None,
  2217. subscriptable="tags",
  2218. key="440",
  2219. ),
  2220. 429,
  2221. ],
  2222. alias=None,
  2223. ),
  2224. ],
  2225. alias=None,
  2226. ),
  2227. ],
  2228. alias="count_miserable_user",
  2229. ),
  2230. 5.8875,
  2231. ],
  2232. alias=None,
  2233. ),
  2234. Function(
  2235. function="plus",
  2236. initializers=None,
  2237. parameters=[
  2238. Function(
  2239. function="nullIf",
  2240. initializers=None,
  2241. parameters=[
  2242. Function(
  2243. function="uniqIf",
  2244. initializers=None,
  2245. parameters=[
  2246. Column(
  2247. name="value",
  2248. entity=None,
  2249. subscriptable=None,
  2250. key=None,
  2251. ),
  2252. Function(
  2253. function="equals",
  2254. initializers=None,
  2255. parameters=[
  2256. Column(
  2257. name="metric_id",
  2258. entity=None,
  2259. subscriptable=None,
  2260. key=None,
  2261. ),
  2262. 9223372036854775908,
  2263. ],
  2264. alias=None,
  2265. ),
  2266. ],
  2267. alias="count_unique_user",
  2268. ),
  2269. 0,
  2270. ],
  2271. alias=None,
  2272. ),
  2273. 117.75,
  2274. ],
  2275. alias=None,
  2276. ),
  2277. ],
  2278. alias="user_misery",
  2279. ),
  2280. ],
  2281. "groupby": [
  2282. AliasedExpression(
  2283. exp=Column(
  2284. name="tags[9223372036854776020]",
  2285. entity=None,
  2286. subscriptable="tags",
  2287. key="9223372036854776020",
  2288. ),
  2289. alias="transaction",
  2290. ),
  2291. Function(
  2292. function="transform",
  2293. initializers=None,
  2294. parameters=[
  2295. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2296. [18],
  2297. ["bar"],
  2298. "",
  2299. ],
  2300. alias="project",
  2301. ),
  2302. ],
  2303. "array_join": None,
  2304. "where": [
  2305. Condition(
  2306. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2307. op=Op.GTE,
  2308. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 440461, tzinfo=pytz.utc),
  2309. ),
  2310. Condition(
  2311. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2312. op=Op.LT,
  2313. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 440461, tzinfo=pytz.utc),
  2314. ),
  2315. Condition(
  2316. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2317. op=Op.IN,
  2318. rhs=[18],
  2319. ),
  2320. Condition(
  2321. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2322. op=Op.EQ,
  2323. rhs=19,
  2324. ),
  2325. Condition(
  2326. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  2327. op=Op.IN,
  2328. rhs=[
  2329. 9223372036854775908,
  2330. 9223372036854775909,
  2331. 9223372036854775910,
  2332. 9223372036854775911,
  2333. 9223372036854775914,
  2334. 9223372036854775915,
  2335. ],
  2336. ),
  2337. Condition(
  2338. lhs=Function(
  2339. function="tuple",
  2340. initializers=None,
  2341. parameters=[
  2342. Column(
  2343. name="tags[9223372036854776020]",
  2344. entity=None,
  2345. subscriptable="tags",
  2346. key="9223372036854776020",
  2347. ),
  2348. Function(
  2349. function="transform",
  2350. initializers=None,
  2351. parameters=[
  2352. Column(
  2353. name="project_id", entity=None, subscriptable=None, key=None
  2354. ),
  2355. [18],
  2356. ["bar"],
  2357. "",
  2358. ],
  2359. alias="project",
  2360. ),
  2361. ],
  2362. alias=None,
  2363. ),
  2364. op=Op.IN,
  2365. rhs=Function(
  2366. function="tuple", initializers=None, parameters=[(437, "bar")], alias=None
  2367. ),
  2368. ),
  2369. ],
  2370. "having": [],
  2371. "orderby": [],
  2372. "limitby": None,
  2373. "limit": Limit(limit=51),
  2374. "offset": Offset(offset=0),
  2375. "granularity": None,
  2376. "totals": None,
  2377. }, # Checked
  2378. {
  2379. "match": Entity("metrics_distributions"),
  2380. "select": [
  2381. Function(
  2382. function="divide",
  2383. initializers=None,
  2384. parameters=[
  2385. Function(
  2386. function="countIf",
  2387. initializers=None,
  2388. parameters=[
  2389. Column(name="value", entity=None, subscriptable=None, key=None),
  2390. Function(
  2391. function="equals",
  2392. initializers=None,
  2393. parameters=[
  2394. Column(
  2395. name="metric_id", entity=None, subscriptable=None, key=None
  2396. ),
  2397. 9223372036854775909,
  2398. ],
  2399. alias=None,
  2400. ),
  2401. ],
  2402. alias=None,
  2403. ),
  2404. Function(
  2405. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  2406. ),
  2407. ],
  2408. alias="epm",
  2409. ),
  2410. AliasedExpression(
  2411. exp=Column(
  2412. name="tags[9223372036854776010]",
  2413. entity=None,
  2414. subscriptable="tags",
  2415. key="9223372036854776010",
  2416. ),
  2417. alias="environment",
  2418. ),
  2419. ],
  2420. "groupby": [
  2421. Function(
  2422. function="transform",
  2423. initializers=None,
  2424. parameters=[
  2425. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2426. [19],
  2427. ["bar"],
  2428. "",
  2429. ],
  2430. alias="project.name",
  2431. ),
  2432. AliasedExpression(
  2433. exp=Column(
  2434. name="tags[9223372036854776010]",
  2435. entity=None,
  2436. subscriptable="tags",
  2437. key="9223372036854776010",
  2438. ),
  2439. alias="environment",
  2440. ),
  2441. ],
  2442. "array_join": None,
  2443. "where": [
  2444. Condition(
  2445. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2446. op=Op.GTE,
  2447. rhs=datetime.datetime(2022, 3, 24, 11, 11, 37, 719279, tzinfo=pytz.utc),
  2448. ),
  2449. Condition(
  2450. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2451. op=Op.LT,
  2452. rhs=datetime.datetime(2022, 6, 22, 11, 11, 37, 719279, tzinfo=pytz.utc),
  2453. ),
  2454. Condition(
  2455. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2456. op=Op.IN,
  2457. rhs=[19],
  2458. ),
  2459. Condition(
  2460. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2461. op=Op.EQ,
  2462. rhs=20,
  2463. ),
  2464. Condition(
  2465. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  2466. op=Op.IN,
  2467. rhs=[9223372036854775909],
  2468. ),
  2469. ],
  2470. "having": [],
  2471. "orderby": [],
  2472. "limitby": None,
  2473. "limit": Limit(limit=51),
  2474. "offset": Offset(offset=0),
  2475. "granularity": None,
  2476. "totals": None,
  2477. }, # Checked
  2478. {
  2479. "match": Entity("metrics_distributions"),
  2480. "select": [
  2481. AliasedExpression(
  2482. exp=Column(
  2483. name="tags[" "9223372036854776021]",
  2484. entity=None,
  2485. subscriptable="tags",
  2486. key="9223372036854776021",
  2487. ),
  2488. alias="transaction.status",
  2489. ),
  2490. AliasedExpression(
  2491. exp=Column(
  2492. name="tags[9223372036854776020]",
  2493. entity=None,
  2494. subscriptable="tags",
  2495. key="9223372036854776020",
  2496. ),
  2497. alias="transaction",
  2498. ),
  2499. Function(
  2500. function="arrayElement",
  2501. initializers=None,
  2502. parameters=[
  2503. Function(
  2504. function="quantilesIf(0.95)",
  2505. initializers=None,
  2506. parameters=[
  2507. Column(name="value", entity=None, subscriptable=None, key=None),
  2508. Function(
  2509. function="equals",
  2510. initializers=None,
  2511. parameters=[
  2512. Column(
  2513. name="metric_id", entity=None, subscriptable=None, key=None
  2514. ),
  2515. 9223372036854775909,
  2516. ],
  2517. alias=None,
  2518. ),
  2519. ],
  2520. alias=None,
  2521. ),
  2522. 1,
  2523. ],
  2524. alias="p95",
  2525. ),
  2526. Function(
  2527. function="divide",
  2528. initializers=None,
  2529. parameters=[
  2530. Function(
  2531. function="countIf",
  2532. initializers=None,
  2533. parameters=[
  2534. Column(name="value", entity=None, subscriptable=None, key=None),
  2535. Function(
  2536. function="equals",
  2537. initializers=None,
  2538. parameters=[
  2539. Column(
  2540. name="metric_id", entity=None, subscriptable=None, key=None
  2541. ),
  2542. 9223372036854775909,
  2543. ],
  2544. alias=None,
  2545. ),
  2546. ],
  2547. alias=None,
  2548. ),
  2549. Function(
  2550. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  2551. ),
  2552. ],
  2553. alias="epm",
  2554. ),
  2555. Function(
  2556. function="divide",
  2557. initializers=None,
  2558. parameters=[
  2559. Function(
  2560. function="countIf",
  2561. initializers=None,
  2562. parameters=[
  2563. Column(name="value", entity=None, subscriptable=None, key=None),
  2564. Function(
  2565. function="and",
  2566. initializers=None,
  2567. parameters=[
  2568. Function(
  2569. function="equals",
  2570. initializers=None,
  2571. parameters=[
  2572. Column(
  2573. name="metric_id",
  2574. entity=None,
  2575. subscriptable=None,
  2576. key=None,
  2577. ),
  2578. 9223372036854775909,
  2579. ],
  2580. alias=None,
  2581. ),
  2582. Function(
  2583. function="notIn",
  2584. initializers=None,
  2585. parameters=[
  2586. Column(
  2587. name="tags[9223372036854776021]",
  2588. entity=None,
  2589. subscriptable="tags",
  2590. key="9223372036854776021",
  2591. ),
  2592. [
  2593. 9223372036854776028,
  2594. 9223372036854776027,
  2595. 9223372036854776029,
  2596. ],
  2597. ],
  2598. alias=None,
  2599. ),
  2600. ],
  2601. alias=None,
  2602. ),
  2603. ],
  2604. alias=None,
  2605. ),
  2606. Function(
  2607. function="countIf",
  2608. initializers=None,
  2609. parameters=[
  2610. Column(name="value", entity=None, subscriptable=None, key=None),
  2611. Function(
  2612. function="equals",
  2613. initializers=None,
  2614. parameters=[
  2615. Column(
  2616. name="metric_id", entity=None, subscriptable=None, key=None
  2617. ),
  2618. 9223372036854775909,
  2619. ],
  2620. alias=None,
  2621. ),
  2622. ],
  2623. alias=None,
  2624. ),
  2625. ],
  2626. alias="failure_rate",
  2627. ),
  2628. ],
  2629. "groupby": [
  2630. AliasedExpression(
  2631. exp=Column(
  2632. name="tags[9223372036854776021]",
  2633. entity=None,
  2634. subscriptable="tags",
  2635. key="9223372036854776021",
  2636. ),
  2637. alias="transaction.status",
  2638. ),
  2639. Function(
  2640. function="in",
  2641. initializers=None,
  2642. parameters=[
  2643. (
  2644. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2645. Column(
  2646. name="tags[9223372036854776020]",
  2647. entity=None,
  2648. subscriptable="tags",
  2649. key="9223372036854776020",
  2650. ),
  2651. ),
  2652. [(20, 487)],
  2653. ],
  2654. alias="team_key_transaction",
  2655. ),
  2656. AliasedExpression(
  2657. exp=Column(
  2658. name="tags[9223372036854776020]",
  2659. entity=None,
  2660. subscriptable="tags",
  2661. key="9223372036854776020",
  2662. ),
  2663. alias="transaction",
  2664. ),
  2665. Function(
  2666. function="transform",
  2667. initializers=None,
  2668. parameters=[
  2669. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2670. [20],
  2671. ["bar"],
  2672. "",
  2673. ],
  2674. alias="project",
  2675. ),
  2676. ],
  2677. "array_join": None,
  2678. "where": [
  2679. Condition(
  2680. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2681. op=Op.GTE,
  2682. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 32475, tzinfo=pytz.utc),
  2683. ),
  2684. Condition(
  2685. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2686. op=Op.LT,
  2687. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 32475, tzinfo=pytz.utc),
  2688. ),
  2689. Condition(
  2690. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2691. op=Op.IN,
  2692. rhs=[20],
  2693. ),
  2694. Condition(
  2695. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2696. op=Op.EQ,
  2697. rhs=21,
  2698. ),
  2699. Condition(
  2700. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  2701. op=Op.IN,
  2702. rhs=[9223372036854775909],
  2703. ),
  2704. ],
  2705. "having": [],
  2706. "orderby": [
  2707. OrderBy(
  2708. exp=Function(
  2709. function="in",
  2710. initializers=None,
  2711. parameters=[
  2712. (
  2713. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2714. Column(
  2715. name="tags[9223372036854776020]",
  2716. entity=None,
  2717. subscriptable="tags",
  2718. key="9223372036854776020",
  2719. ),
  2720. ),
  2721. [(20, 487)],
  2722. ],
  2723. alias="team_key_transaction",
  2724. ),
  2725. direction=Direction.ASC,
  2726. ),
  2727. OrderBy(
  2728. exp=Function(
  2729. function="arrayElement",
  2730. initializers=None,
  2731. parameters=[
  2732. Function(
  2733. function="quantilesIf(0.95)",
  2734. initializers=None,
  2735. parameters=[
  2736. Column(name="value", entity=None, subscriptable=None, key=None),
  2737. Function(
  2738. function="equals",
  2739. initializers=None,
  2740. parameters=[
  2741. Column(
  2742. name="metric_id",
  2743. entity=None,
  2744. subscriptable=None,
  2745. key=None,
  2746. ),
  2747. 9223372036854775909,
  2748. ],
  2749. alias=None,
  2750. ),
  2751. ],
  2752. alias=None,
  2753. ),
  2754. 1,
  2755. ],
  2756. alias="p95",
  2757. ),
  2758. direction=Direction.ASC,
  2759. ),
  2760. ],
  2761. "limitby": None,
  2762. "limit": Limit(limit=51),
  2763. "offset": Offset(offset=0),
  2764. "granularity": None,
  2765. "totals": None,
  2766. }, # Checked
  2767. {
  2768. "match": Entity("metrics_distributions"),
  2769. "select": [
  2770. AliasedExpression(
  2771. exp=Column(
  2772. name="tags[9223372036854776021]",
  2773. entity=None,
  2774. subscriptable="tags",
  2775. key="9223372036854776021",
  2776. ),
  2777. alias="transaction.status",
  2778. ),
  2779. AliasedExpression(
  2780. exp=Column(
  2781. name="tags[9223372036854776020]",
  2782. entity=None,
  2783. subscriptable="tags",
  2784. key="9223372036854776020",
  2785. ),
  2786. alias="transaction",
  2787. ),
  2788. Function(
  2789. function="arrayElement",
  2790. initializers=None,
  2791. parameters=[
  2792. Function(
  2793. function="quantilesIf(0.95)",
  2794. initializers=None,
  2795. parameters=[
  2796. Column(name="value", entity=None, subscriptable=None, key=None),
  2797. Function(
  2798. function="equals",
  2799. initializers=None,
  2800. parameters=[
  2801. Column(
  2802. name="metric_id", entity=None, subscriptable=None, key=None
  2803. ),
  2804. 9223372036854775909,
  2805. ],
  2806. alias=None,
  2807. ),
  2808. ],
  2809. alias=None,
  2810. ),
  2811. 1,
  2812. ],
  2813. alias="p95",
  2814. ),
  2815. Function(
  2816. function="divide",
  2817. initializers=None,
  2818. parameters=[
  2819. Function(
  2820. function="countIf",
  2821. initializers=None,
  2822. parameters=[
  2823. Column(name="value", entity=None, subscriptable=None, key=None),
  2824. Function(
  2825. function="equals",
  2826. initializers=None,
  2827. parameters=[
  2828. Column(
  2829. name="metric_id", entity=None, subscriptable=None, key=None
  2830. ),
  2831. 9223372036854775909,
  2832. ],
  2833. alias=None,
  2834. ),
  2835. ],
  2836. alias=None,
  2837. ),
  2838. Function(
  2839. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  2840. ),
  2841. ],
  2842. alias="epm",
  2843. ),
  2844. Function(
  2845. function="divide",
  2846. initializers=None,
  2847. parameters=[
  2848. Function(
  2849. function="countIf",
  2850. initializers=None,
  2851. parameters=[
  2852. Column(name="value", entity=None, subscriptable=None, key=None),
  2853. Function(
  2854. function="and",
  2855. initializers=None,
  2856. parameters=[
  2857. Function(
  2858. function="equals",
  2859. initializers=None,
  2860. parameters=[
  2861. Column(
  2862. name="metric_id",
  2863. entity=None,
  2864. subscriptable=None,
  2865. key=None,
  2866. ),
  2867. 9223372036854775909,
  2868. ],
  2869. alias=None,
  2870. ),
  2871. Function(
  2872. function="notIn",
  2873. initializers=None,
  2874. parameters=[
  2875. Column(
  2876. name="tags[9223372036854776021]",
  2877. entity=None,
  2878. subscriptable="tags",
  2879. key="9223372036854776021",
  2880. ),
  2881. [
  2882. 9223372036854776028,
  2883. 9223372036854776027,
  2884. 9223372036854776029,
  2885. ],
  2886. ],
  2887. alias=None,
  2888. ),
  2889. ],
  2890. alias=None,
  2891. ),
  2892. ],
  2893. alias=None,
  2894. ),
  2895. Function(
  2896. function="countIf",
  2897. initializers=None,
  2898. parameters=[
  2899. Column(name="value", entity=None, subscriptable=None, key=None),
  2900. Function(
  2901. function="equals",
  2902. initializers=None,
  2903. parameters=[
  2904. Column(
  2905. name="metric_id", entity=None, subscriptable=None, key=None
  2906. ),
  2907. 9223372036854775909,
  2908. ],
  2909. alias=None,
  2910. ),
  2911. ],
  2912. alias=None,
  2913. ),
  2914. ],
  2915. alias="failure_rate",
  2916. ),
  2917. ],
  2918. "groupby": [
  2919. AliasedExpression(
  2920. exp=Column(
  2921. name="tags[9223372036854776021]",
  2922. entity=None,
  2923. subscriptable="tags",
  2924. key="9223372036854776021",
  2925. ),
  2926. alias="transaction.status",
  2927. ),
  2928. Function(
  2929. function="in",
  2930. initializers=None,
  2931. parameters=[
  2932. (
  2933. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2934. Column(
  2935. name="tags[9223372036854776020]",
  2936. entity=None,
  2937. subscriptable="tags",
  2938. key="9223372036854776020",
  2939. ),
  2940. ),
  2941. [(20, 487)],
  2942. ],
  2943. alias="team_key_transaction",
  2944. ),
  2945. AliasedExpression(
  2946. exp=Column(
  2947. name="tags[9223372036854776020]",
  2948. entity=None,
  2949. subscriptable="tags",
  2950. key="9223372036854776020",
  2951. ),
  2952. alias="transaction",
  2953. ),
  2954. Function(
  2955. function="transform",
  2956. initializers=None,
  2957. parameters=[
  2958. Column(name="project_id", entity=None, subscriptable=None, key=None),
  2959. [20],
  2960. ["bar"],
  2961. "",
  2962. ],
  2963. alias="project",
  2964. ),
  2965. ],
  2966. "array_join": None,
  2967. "where": [
  2968. Condition(
  2969. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2970. op=Op.GTE,
  2971. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 127281, tzinfo=pytz.utc),
  2972. ),
  2973. Condition(
  2974. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  2975. op=Op.LT,
  2976. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 127281, tzinfo=pytz.utc),
  2977. ),
  2978. Condition(
  2979. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  2980. op=Op.IN,
  2981. rhs=[20],
  2982. ),
  2983. Condition(
  2984. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  2985. op=Op.EQ,
  2986. rhs=21,
  2987. ),
  2988. Condition(
  2989. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  2990. op=Op.IN,
  2991. rhs=[9223372036854775909],
  2992. ),
  2993. ],
  2994. "having": [],
  2995. "orderby": [
  2996. OrderBy(
  2997. exp=Function(
  2998. function="in",
  2999. initializers=None,
  3000. parameters=[
  3001. (
  3002. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3003. Column(
  3004. name="tags[9223372036854776020]",
  3005. entity=None,
  3006. subscriptable="tags",
  3007. key="9223372036854776020",
  3008. ),
  3009. ),
  3010. [(20, 487)],
  3011. ],
  3012. alias="team_key_transaction",
  3013. ),
  3014. direction=Direction.ASC,
  3015. ),
  3016. OrderBy(
  3017. exp=Function(
  3018. function="arrayElement",
  3019. initializers=None,
  3020. parameters=[
  3021. Function(
  3022. function="quantilesIf(0.95)",
  3023. initializers=None,
  3024. parameters=[
  3025. Column(name="value", entity=None, subscriptable=None, key=None),
  3026. Function(
  3027. function="equals",
  3028. initializers=None,
  3029. parameters=[
  3030. Column(
  3031. name="metric_id",
  3032. entity=None,
  3033. subscriptable=None,
  3034. key=None,
  3035. ),
  3036. 9223372036854775909,
  3037. ],
  3038. alias=None,
  3039. ),
  3040. ],
  3041. alias=None,
  3042. ),
  3043. 1,
  3044. ],
  3045. alias="p95",
  3046. ),
  3047. direction=Direction.ASC,
  3048. ),
  3049. ],
  3050. "limitby": None,
  3051. "limit": Limit(limit=51),
  3052. "offset": Offset(offset=0),
  3053. "granularity": None,
  3054. "totals": None,
  3055. }, # Checked
  3056. {
  3057. "match": Entity("metrics_distributions"),
  3058. "select": [
  3059. AliasedExpression(
  3060. exp=Column(
  3061. name="tags[" "9223372036854776021]",
  3062. entity=None,
  3063. subscriptable="tags",
  3064. key="9223372036854776021",
  3065. ),
  3066. alias="transaction.status",
  3067. ),
  3068. AliasedExpression(
  3069. exp=Column(
  3070. name="tags[9223372036854776020]",
  3071. entity=None,
  3072. subscriptable="tags",
  3073. key="9223372036854776020",
  3074. ),
  3075. alias="transaction",
  3076. ),
  3077. Function(
  3078. function="arrayElement",
  3079. initializers=None,
  3080. parameters=[
  3081. Function(
  3082. function="quantilesIf(0.95)",
  3083. initializers=None,
  3084. parameters=[
  3085. Column(name="value", entity=None, subscriptable=None, key=None),
  3086. Function(
  3087. function="equals",
  3088. initializers=None,
  3089. parameters=[
  3090. Column(
  3091. name="metric_id", entity=None, subscriptable=None, key=None
  3092. ),
  3093. 9223372036854775909,
  3094. ],
  3095. alias=None,
  3096. ),
  3097. ],
  3098. alias=None,
  3099. ),
  3100. 1,
  3101. ],
  3102. alias="p95",
  3103. ),
  3104. Function(
  3105. function="divide",
  3106. initializers=None,
  3107. parameters=[
  3108. Function(
  3109. function="countIf",
  3110. initializers=None,
  3111. parameters=[
  3112. Column(name="value", entity=None, subscriptable=None, key=None),
  3113. Function(
  3114. function="equals",
  3115. initializers=None,
  3116. parameters=[
  3117. Column(
  3118. name="metric_id", entity=None, subscriptable=None, key=None
  3119. ),
  3120. 9223372036854775909,
  3121. ],
  3122. alias=None,
  3123. ),
  3124. ],
  3125. alias=None,
  3126. ),
  3127. Function(
  3128. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  3129. ),
  3130. ],
  3131. alias="epm",
  3132. ),
  3133. Function(
  3134. function="divide",
  3135. initializers=None,
  3136. parameters=[
  3137. Function(
  3138. function="countIf",
  3139. initializers=None,
  3140. parameters=[
  3141. Column(name="value", entity=None, subscriptable=None, key=None),
  3142. Function(
  3143. function="and",
  3144. initializers=None,
  3145. parameters=[
  3146. Function(
  3147. function="equals",
  3148. initializers=None,
  3149. parameters=[
  3150. Column(
  3151. name="metric_id",
  3152. entity=None,
  3153. subscriptable=None,
  3154. key=None,
  3155. ),
  3156. 9223372036854775909,
  3157. ],
  3158. alias=None,
  3159. ),
  3160. Function(
  3161. function="notIn",
  3162. initializers=None,
  3163. parameters=[
  3164. Column(
  3165. name="tags[9223372036854776021]",
  3166. entity=None,
  3167. subscriptable="tags",
  3168. key="9223372036854776021",
  3169. ),
  3170. [
  3171. 9223372036854776028,
  3172. 9223372036854776027,
  3173. 9223372036854776029,
  3174. ],
  3175. ],
  3176. alias=None,
  3177. ),
  3178. ],
  3179. alias=None,
  3180. ),
  3181. ],
  3182. alias=None,
  3183. ),
  3184. Function(
  3185. function="countIf",
  3186. initializers=None,
  3187. parameters=[
  3188. Column(name="value", entity=None, subscriptable=None, key=None),
  3189. Function(
  3190. function="equals",
  3191. initializers=None,
  3192. parameters=[
  3193. Column(
  3194. name="metric_id", entity=None, subscriptable=None, key=None
  3195. ),
  3196. 9223372036854775909,
  3197. ],
  3198. alias=None,
  3199. ),
  3200. ],
  3201. alias=None,
  3202. ),
  3203. ],
  3204. alias="failure_rate",
  3205. ),
  3206. ],
  3207. "groupby": [
  3208. AliasedExpression(
  3209. exp=Column(
  3210. name="tags[9223372036854776021]",
  3211. entity=None,
  3212. subscriptable="tags",
  3213. key="9223372036854776021",
  3214. ),
  3215. alias="transaction.status",
  3216. ),
  3217. Function(
  3218. function="in",
  3219. initializers=None,
  3220. parameters=[
  3221. (
  3222. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3223. Column(
  3224. name="tags[9223372036854776020]",
  3225. entity=None,
  3226. subscriptable="tags",
  3227. key="9223372036854776020",
  3228. ),
  3229. ),
  3230. [(21, 508), (21, 512)],
  3231. ],
  3232. alias="team_key_transaction",
  3233. ),
  3234. AliasedExpression(
  3235. exp=Column(
  3236. name="tags[9223372036854776020]",
  3237. entity=None,
  3238. subscriptable="tags",
  3239. key="9223372036854776020",
  3240. ),
  3241. alias="transaction",
  3242. ),
  3243. Function(
  3244. function="transform",
  3245. initializers=None,
  3246. parameters=[
  3247. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3248. [21],
  3249. ["bar"],
  3250. "",
  3251. ],
  3252. alias="project",
  3253. ),
  3254. ],
  3255. "array_join": None,
  3256. "where": [
  3257. Condition(
  3258. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3259. op=Op.GTE,
  3260. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 458313, tzinfo=pytz.utc),
  3261. ),
  3262. Condition(
  3263. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3264. op=Op.LT,
  3265. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 458313, tzinfo=pytz.utc),
  3266. ),
  3267. Condition(
  3268. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3269. op=Op.IN,
  3270. rhs=[21],
  3271. ),
  3272. Condition(
  3273. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3274. op=Op.EQ,
  3275. rhs=22,
  3276. ),
  3277. Condition(
  3278. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3279. op=Op.IN,
  3280. rhs=[9223372036854775909],
  3281. ),
  3282. ],
  3283. "having": [],
  3284. "orderby": [
  3285. OrderBy(
  3286. exp=Function(
  3287. function="in",
  3288. initializers=None,
  3289. parameters=[
  3290. (
  3291. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3292. Column(
  3293. name="tags[9223372036854776020]",
  3294. entity=None,
  3295. subscriptable="tags",
  3296. key="9223372036854776020",
  3297. ),
  3298. ),
  3299. [(21, 508), (21, 512)],
  3300. ],
  3301. alias="team_key_transaction",
  3302. ),
  3303. direction=Direction.ASC,
  3304. ),
  3305. OrderBy(
  3306. exp=Function(
  3307. function="arrayElement",
  3308. initializers=None,
  3309. parameters=[
  3310. Function(
  3311. function="quantilesIf(0.95)",
  3312. initializers=None,
  3313. parameters=[
  3314. Column(name="value", entity=None, subscriptable=None, key=None),
  3315. Function(
  3316. function="equals",
  3317. initializers=None,
  3318. parameters=[
  3319. Column(
  3320. name="metric_id",
  3321. entity=None,
  3322. subscriptable=None,
  3323. key=None,
  3324. ),
  3325. 9223372036854775909,
  3326. ],
  3327. alias=None,
  3328. ),
  3329. ],
  3330. alias=None,
  3331. ),
  3332. 1,
  3333. ],
  3334. alias="p95",
  3335. ),
  3336. direction=Direction.ASC,
  3337. ),
  3338. ],
  3339. "limitby": None,
  3340. "limit": Limit(limit=51),
  3341. "offset": Offset(offset=0),
  3342. "granularity": None,
  3343. "totals": None,
  3344. }, # Checked
  3345. {
  3346. "match": Entity("metrics_distributions"),
  3347. "select": [
  3348. AliasedExpression(
  3349. exp=Column(
  3350. name="tags[9223372036854776021]",
  3351. entity=None,
  3352. subscriptable="tags",
  3353. key="9223372036854776021",
  3354. ),
  3355. alias="transaction.status",
  3356. ),
  3357. AliasedExpression(
  3358. exp=Column(
  3359. name="tags[9223372036854776020]",
  3360. entity=None,
  3361. subscriptable="tags",
  3362. key="9223372036854776020",
  3363. ),
  3364. alias="transaction",
  3365. ),
  3366. Function(
  3367. function="arrayElement",
  3368. initializers=None,
  3369. parameters=[
  3370. Function(
  3371. function="quantilesIf(0.95)",
  3372. initializers=None,
  3373. parameters=[
  3374. Column(name="value", entity=None, subscriptable=None, key=None),
  3375. Function(
  3376. function="equals",
  3377. initializers=None,
  3378. parameters=[
  3379. Column(
  3380. name="metric_id", entity=None, subscriptable=None, key=None
  3381. ),
  3382. 9223372036854775909,
  3383. ],
  3384. alias=None,
  3385. ),
  3386. ],
  3387. alias=None,
  3388. ),
  3389. 1,
  3390. ],
  3391. alias="p95",
  3392. ),
  3393. Function(
  3394. function="divide",
  3395. initializers=None,
  3396. parameters=[
  3397. Function(
  3398. function="countIf",
  3399. initializers=None,
  3400. parameters=[
  3401. Column(name="value", entity=None, subscriptable=None, key=None),
  3402. Function(
  3403. function="equals",
  3404. initializers=None,
  3405. parameters=[
  3406. Column(
  3407. name="metric_id", entity=None, subscriptable=None, key=None
  3408. ),
  3409. 9223372036854775909,
  3410. ],
  3411. alias=None,
  3412. ),
  3413. ],
  3414. alias=None,
  3415. ),
  3416. Function(
  3417. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  3418. ),
  3419. ],
  3420. alias="epm",
  3421. ),
  3422. Function(
  3423. function="divide",
  3424. initializers=None,
  3425. parameters=[
  3426. Function(
  3427. function="countIf",
  3428. initializers=None,
  3429. parameters=[
  3430. Column(name="value", entity=None, subscriptable=None, key=None),
  3431. Function(
  3432. function="and",
  3433. initializers=None,
  3434. parameters=[
  3435. Function(
  3436. function="equals",
  3437. initializers=None,
  3438. parameters=[
  3439. Column(
  3440. name="metric_id",
  3441. entity=None,
  3442. subscriptable=None,
  3443. key=None,
  3444. ),
  3445. 9223372036854775909,
  3446. ],
  3447. alias=None,
  3448. ),
  3449. Function(
  3450. function="notIn",
  3451. initializers=None,
  3452. parameters=[
  3453. Column(
  3454. name="tags[9223372036854776021]",
  3455. entity=None,
  3456. subscriptable="tags",
  3457. key="9223372036854776021",
  3458. ),
  3459. [
  3460. 9223372036854776028,
  3461. 9223372036854776027,
  3462. 9223372036854776029,
  3463. ],
  3464. ],
  3465. alias=None,
  3466. ),
  3467. ],
  3468. alias=None,
  3469. ),
  3470. ],
  3471. alias=None,
  3472. ),
  3473. Function(
  3474. function="countIf",
  3475. initializers=None,
  3476. parameters=[
  3477. Column(name="value", entity=None, subscriptable=None, key=None),
  3478. Function(
  3479. function="equals",
  3480. initializers=None,
  3481. parameters=[
  3482. Column(
  3483. name="metric_id", entity=None, subscriptable=None, key=None
  3484. ),
  3485. 9223372036854775909,
  3486. ],
  3487. alias=None,
  3488. ),
  3489. ],
  3490. alias=None,
  3491. ),
  3492. ],
  3493. alias="failure_rate",
  3494. ),
  3495. ],
  3496. "groupby": [
  3497. AliasedExpression(
  3498. exp=Column(
  3499. name="tags[9223372036854776021]",
  3500. entity=None,
  3501. subscriptable="tags",
  3502. key="9223372036854776021",
  3503. ),
  3504. alias="transaction.status",
  3505. ),
  3506. Function(
  3507. function="in",
  3508. initializers=None,
  3509. parameters=[
  3510. (
  3511. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3512. Column(
  3513. name="tags[9223372036854776020]",
  3514. entity=None,
  3515. subscriptable="tags",
  3516. key="9223372036854776020",
  3517. ),
  3518. ),
  3519. [(21, 508), (21, 512)],
  3520. ],
  3521. alias="team_key_transaction",
  3522. ),
  3523. AliasedExpression(
  3524. exp=Column(
  3525. name="tags[9223372036854776020]",
  3526. entity=None,
  3527. subscriptable="tags",
  3528. key="9223372036854776020",
  3529. ),
  3530. alias="transaction",
  3531. ),
  3532. Function(
  3533. function="transform",
  3534. initializers=None,
  3535. parameters=[
  3536. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3537. [21],
  3538. ["bar"],
  3539. "",
  3540. ],
  3541. alias="project",
  3542. ),
  3543. ],
  3544. "array_join": None,
  3545. "where": [
  3546. Condition(
  3547. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3548. op=Op.GTE,
  3549. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 552260, tzinfo=pytz.utc),
  3550. ),
  3551. Condition(
  3552. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3553. op=Op.LT,
  3554. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 552260, tzinfo=pytz.utc),
  3555. ),
  3556. Condition(
  3557. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3558. op=Op.IN,
  3559. rhs=[21],
  3560. ),
  3561. Condition(
  3562. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3563. op=Op.EQ,
  3564. rhs=22,
  3565. ),
  3566. Condition(
  3567. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3568. op=Op.IN,
  3569. rhs=[9223372036854775909],
  3570. ),
  3571. ],
  3572. "having": [],
  3573. "orderby": [
  3574. OrderBy(
  3575. exp=Function(
  3576. function="in",
  3577. initializers=None,
  3578. parameters=[
  3579. (
  3580. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3581. Column(
  3582. name="tags[9223372036854776020]",
  3583. entity=None,
  3584. subscriptable="tags",
  3585. key="9223372036854776020",
  3586. ),
  3587. ),
  3588. [(21, 508), (21, 512)],
  3589. ],
  3590. alias="team_key_transaction",
  3591. ),
  3592. direction=Direction.DESC,
  3593. ),
  3594. OrderBy(
  3595. exp=Function(
  3596. function="arrayElement",
  3597. initializers=None,
  3598. parameters=[
  3599. Function(
  3600. function="quantilesIf(0.95)",
  3601. initializers=None,
  3602. parameters=[
  3603. Column(name="value", entity=None, subscriptable=None, key=None),
  3604. Function(
  3605. function="equals",
  3606. initializers=None,
  3607. parameters=[
  3608. Column(
  3609. name="metric_id",
  3610. entity=None,
  3611. subscriptable=None,
  3612. key=None,
  3613. ),
  3614. 9223372036854775909,
  3615. ],
  3616. alias=None,
  3617. ),
  3618. ],
  3619. alias=None,
  3620. ),
  3621. 1,
  3622. ],
  3623. alias="p95",
  3624. ),
  3625. direction=Direction.ASC,
  3626. ),
  3627. ],
  3628. "limitby": None,
  3629. "limit": Limit(limit=51),
  3630. "offset": Offset(offset=0),
  3631. "granularity": None,
  3632. "totals": None,
  3633. }, # Checked
  3634. {
  3635. "match": Entity("metrics_distributions"),
  3636. "select": [
  3637. AliasedExpression(
  3638. exp=Column(
  3639. name="tags[9223372036854776021]",
  3640. entity=None,
  3641. subscriptable="tags",
  3642. key="9223372036854776021",
  3643. ),
  3644. alias="transaction.status",
  3645. ),
  3646. AliasedExpression(
  3647. exp=Column(
  3648. name="tags[9223372036854776020]",
  3649. entity=None,
  3650. subscriptable="tags",
  3651. key="9223372036854776020",
  3652. ),
  3653. alias="transaction",
  3654. ),
  3655. Function(
  3656. function="arrayElement",
  3657. initializers=None,
  3658. parameters=[
  3659. Function(
  3660. function="quantilesIf(0.95)",
  3661. initializers=None,
  3662. parameters=[
  3663. Column(name="value", entity=None, subscriptable=None, key=None),
  3664. Function(
  3665. function="equals",
  3666. initializers=None,
  3667. parameters=[
  3668. Column(
  3669. name="metric_id", entity=None, subscriptable=None, key=None
  3670. ),
  3671. 9223372036854775909,
  3672. ],
  3673. alias=None,
  3674. ),
  3675. ],
  3676. alias=None,
  3677. ),
  3678. 1,
  3679. ],
  3680. alias="p95",
  3681. ),
  3682. Function(
  3683. function="divide",
  3684. initializers=None,
  3685. parameters=[
  3686. Function(
  3687. function="countIf",
  3688. initializers=None,
  3689. parameters=[
  3690. Column(name="value", entity=None, subscriptable=None, key=None),
  3691. Function(
  3692. function="equals",
  3693. initializers=None,
  3694. parameters=[
  3695. Column(
  3696. name="metric_id", entity=None, subscriptable=None, key=None
  3697. ),
  3698. 9223372036854775909,
  3699. ],
  3700. alias=None,
  3701. ),
  3702. ],
  3703. alias=None,
  3704. ),
  3705. Function(
  3706. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  3707. ),
  3708. ],
  3709. alias="epm",
  3710. ),
  3711. Function(
  3712. function="divide",
  3713. initializers=None,
  3714. parameters=[
  3715. Function(
  3716. function="countIf",
  3717. initializers=None,
  3718. parameters=[
  3719. Column(name="value", entity=None, subscriptable=None, key=None),
  3720. Function(
  3721. function="and",
  3722. initializers=None,
  3723. parameters=[
  3724. Function(
  3725. function="equals",
  3726. initializers=None,
  3727. parameters=[
  3728. Column(
  3729. name="metric_id",
  3730. entity=None,
  3731. subscriptable=None,
  3732. key=None,
  3733. ),
  3734. 9223372036854775909,
  3735. ],
  3736. alias=None,
  3737. ),
  3738. Function(
  3739. function="notIn",
  3740. initializers=None,
  3741. parameters=[
  3742. Column(
  3743. name="tags[9223372036854776021]",
  3744. entity=None,
  3745. subscriptable="tags",
  3746. key="9223372036854776021",
  3747. ),
  3748. [
  3749. 9223372036854776028,
  3750. 9223372036854776027,
  3751. 9223372036854776029,
  3752. ],
  3753. ],
  3754. alias=None,
  3755. ),
  3756. ],
  3757. alias=None,
  3758. ),
  3759. ],
  3760. alias=None,
  3761. ),
  3762. Function(
  3763. function="countIf",
  3764. initializers=None,
  3765. parameters=[
  3766. Column(name="value", entity=None, subscriptable=None, key=None),
  3767. Function(
  3768. function="equals",
  3769. initializers=None,
  3770. parameters=[
  3771. Column(
  3772. name="metric_id", entity=None, subscriptable=None, key=None
  3773. ),
  3774. 9223372036854775909,
  3775. ],
  3776. alias=None,
  3777. ),
  3778. ],
  3779. alias=None,
  3780. ),
  3781. ],
  3782. alias="failure_rate",
  3783. ),
  3784. ],
  3785. "groupby": [
  3786. AliasedExpression(
  3787. exp=Column(
  3788. name="tags[9223372036854776021]",
  3789. entity=None,
  3790. subscriptable="tags",
  3791. key="9223372036854776021",
  3792. ),
  3793. alias="transaction.status",
  3794. ),
  3795. Function(
  3796. function="in",
  3797. initializers=None,
  3798. parameters=[
  3799. (
  3800. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3801. Column(
  3802. name="tags[9223372036854776020]",
  3803. entity=None,
  3804. subscriptable="tags",
  3805. key="9223372036854776020",
  3806. ),
  3807. ),
  3808. [(22, 533), (22, 537)],
  3809. ],
  3810. alias="team_key_transaction",
  3811. ),
  3812. AliasedExpression(
  3813. exp=Column(
  3814. name="tags[9223372036854776020]",
  3815. entity=None,
  3816. subscriptable="tags",
  3817. key="9223372036854776020",
  3818. ),
  3819. alias="transaction",
  3820. ),
  3821. Function(
  3822. function="transform",
  3823. initializers=None,
  3824. parameters=[
  3825. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3826. [22],
  3827. ["bar"],
  3828. "",
  3829. ],
  3830. alias="project",
  3831. ),
  3832. ],
  3833. "array_join": None,
  3834. "where": [
  3835. Condition(
  3836. lhs=Function(
  3837. function="in",
  3838. initializers=None,
  3839. parameters=[
  3840. (
  3841. Column(name="project_id", entity=None, subscriptable=None, key=None),
  3842. Column(
  3843. name="tags[9223372036854776020]",
  3844. entity=None,
  3845. subscriptable="tags",
  3846. key="9223372036854776020",
  3847. ),
  3848. ),
  3849. [(22, 533), (22, 537)],
  3850. ],
  3851. alias="team_key_transaction",
  3852. ),
  3853. op=Op.NEQ,
  3854. rhs=0,
  3855. ),
  3856. Condition(
  3857. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3858. op=Op.GTE,
  3859. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 893701, tzinfo=pytz.utc),
  3860. ),
  3861. Condition(
  3862. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  3863. op=Op.LT,
  3864. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 893701, tzinfo=pytz.utc),
  3865. ),
  3866. Condition(
  3867. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  3868. op=Op.IN,
  3869. rhs=[22],
  3870. ),
  3871. Condition(
  3872. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  3873. op=Op.EQ,
  3874. rhs=23,
  3875. ),
  3876. Condition(
  3877. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  3878. op=Op.IN,
  3879. rhs=[9223372036854775909],
  3880. ),
  3881. ],
  3882. "having": [],
  3883. "orderby": [
  3884. OrderBy(
  3885. exp=Function(
  3886. function="arrayElement",
  3887. initializers=None,
  3888. parameters=[
  3889. Function(
  3890. function="quantilesIf(0.95)",
  3891. initializers=None,
  3892. parameters=[
  3893. Column(name="value", entity=None, subscriptable=None, key=None),
  3894. Function(
  3895. function="equals",
  3896. initializers=None,
  3897. parameters=[
  3898. Column(
  3899. name="metric_id",
  3900. entity=None,
  3901. subscriptable=None,
  3902. key=None,
  3903. ),
  3904. 9223372036854775909,
  3905. ],
  3906. alias=None,
  3907. ),
  3908. ],
  3909. alias=None,
  3910. ),
  3911. 1,
  3912. ],
  3913. alias="p95",
  3914. ),
  3915. direction=Direction.ASC,
  3916. )
  3917. ],
  3918. "limitby": None,
  3919. "limit": Limit(limit=51),
  3920. "offset": Offset(offset=0),
  3921. "granularity": None,
  3922. "totals": None,
  3923. }, # Checked
  3924. {
  3925. "match": Entity("metrics_distributions"),
  3926. "select": [
  3927. AliasedExpression(
  3928. exp=Column(
  3929. name="tags[9223372036854776021]",
  3930. entity=None,
  3931. subscriptable="tags",
  3932. key="9223372036854776021",
  3933. ),
  3934. alias="transaction.status",
  3935. ),
  3936. AliasedExpression(
  3937. exp=Column(
  3938. name="tags[9223372036854776020]",
  3939. entity=None,
  3940. subscriptable="tags",
  3941. key="9223372036854776020",
  3942. ),
  3943. alias="transaction",
  3944. ),
  3945. Function(
  3946. function="arrayElement",
  3947. initializers=None,
  3948. parameters=[
  3949. Function(
  3950. function="quantilesIf(0.95)",
  3951. initializers=None,
  3952. parameters=[
  3953. Column(name="value", entity=None, subscriptable=None, key=None),
  3954. Function(
  3955. function="equals",
  3956. initializers=None,
  3957. parameters=[
  3958. Column(
  3959. name="metric_id", entity=None, subscriptable=None, key=None
  3960. ),
  3961. 9223372036854775909,
  3962. ],
  3963. alias=None,
  3964. ),
  3965. ],
  3966. alias=None,
  3967. ),
  3968. 1,
  3969. ],
  3970. alias="p95",
  3971. ),
  3972. Function(
  3973. function="divide",
  3974. initializers=None,
  3975. parameters=[
  3976. Function(
  3977. function="countIf",
  3978. initializers=None,
  3979. parameters=[
  3980. Column(name="value", entity=None, subscriptable=None, key=None),
  3981. Function(
  3982. function="equals",
  3983. initializers=None,
  3984. parameters=[
  3985. Column(
  3986. name="metric_id", entity=None, subscriptable=None, key=None
  3987. ),
  3988. 9223372036854775909,
  3989. ],
  3990. alias=None,
  3991. ),
  3992. ],
  3993. alias=None,
  3994. ),
  3995. Function(
  3996. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  3997. ),
  3998. ],
  3999. alias="epm",
  4000. ),
  4001. Function(
  4002. function="divide",
  4003. initializers=None,
  4004. parameters=[
  4005. Function(
  4006. function="countIf",
  4007. initializers=None,
  4008. parameters=[
  4009. Column(name="value", entity=None, subscriptable=None, key=None),
  4010. Function(
  4011. function="and",
  4012. initializers=None,
  4013. parameters=[
  4014. Function(
  4015. function="equals",
  4016. initializers=None,
  4017. parameters=[
  4018. Column(
  4019. name="metric_id",
  4020. entity=None,
  4021. subscriptable=None,
  4022. key=None,
  4023. ),
  4024. 9223372036854775909,
  4025. ],
  4026. alias=None,
  4027. ),
  4028. Function(
  4029. function="notIn",
  4030. initializers=None,
  4031. parameters=[
  4032. Column(
  4033. name="tags[9223372036854776021]",
  4034. entity=None,
  4035. subscriptable="tags",
  4036. key="9223372036854776021",
  4037. ),
  4038. [
  4039. 9223372036854776028,
  4040. 9223372036854776027,
  4041. 9223372036854776029,
  4042. ],
  4043. ],
  4044. alias=None,
  4045. ),
  4046. ],
  4047. alias=None,
  4048. ),
  4049. ],
  4050. alias=None,
  4051. ),
  4052. Function(
  4053. function="countIf",
  4054. initializers=None,
  4055. parameters=[
  4056. Column(name="value", entity=None, subscriptable=None, key=None),
  4057. Function(
  4058. function="equals",
  4059. initializers=None,
  4060. parameters=[
  4061. Column(
  4062. name="metric_id", entity=None, subscriptable=None, key=None
  4063. ),
  4064. 9223372036854775909,
  4065. ],
  4066. alias=None,
  4067. ),
  4068. ],
  4069. alias=None,
  4070. ),
  4071. ],
  4072. alias="failure_rate",
  4073. ),
  4074. ],
  4075. "groupby": [
  4076. AliasedExpression(
  4077. exp=Column(
  4078. name="tags[9223372036854776021]",
  4079. entity=None,
  4080. subscriptable="tags",
  4081. key="9223372036854776021",
  4082. ),
  4083. alias="transaction.status",
  4084. ),
  4085. Function(
  4086. function="in",
  4087. initializers=None,
  4088. parameters=[
  4089. (
  4090. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4091. Column(
  4092. name="tags[9223372036854776020]",
  4093. entity=None,
  4094. subscriptable="tags",
  4095. key="9223372036854776020",
  4096. ),
  4097. ),
  4098. [(22, 533), (22, 537)],
  4099. ],
  4100. alias="team_key_transaction",
  4101. ),
  4102. AliasedExpression(
  4103. exp=Column(
  4104. name="tags[9223372036854776020]",
  4105. entity=None,
  4106. subscriptable="tags",
  4107. key="9223372036854776020",
  4108. ),
  4109. alias="transaction",
  4110. ),
  4111. Function(
  4112. function="transform",
  4113. initializers=None,
  4114. parameters=[
  4115. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4116. [22],
  4117. ["bar"],
  4118. "",
  4119. ],
  4120. alias="project",
  4121. ),
  4122. ],
  4123. "array_join": None,
  4124. "where": [
  4125. Condition(
  4126. lhs=Function(
  4127. function="in",
  4128. initializers=None,
  4129. parameters=[
  4130. (
  4131. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4132. Column(
  4133. name="tags[9223372036854776020]",
  4134. entity=None,
  4135. subscriptable="tags",
  4136. key="9223372036854776020",
  4137. ),
  4138. ),
  4139. [(22, 533), (22, 537)],
  4140. ],
  4141. alias="team_key_transaction",
  4142. ),
  4143. op=Op.EQ,
  4144. rhs=1,
  4145. ),
  4146. Condition(
  4147. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4148. op=Op.GTE,
  4149. rhs=datetime.datetime(2022, 3, 24, 11, 11, 38, 987457, tzinfo=pytz.utc),
  4150. ),
  4151. Condition(
  4152. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4153. op=Op.LT,
  4154. rhs=datetime.datetime(2022, 6, 22, 11, 11, 38, 987457, tzinfo=pytz.utc),
  4155. ),
  4156. Condition(
  4157. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  4158. op=Op.IN,
  4159. rhs=[22],
  4160. ),
  4161. Condition(
  4162. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  4163. op=Op.EQ,
  4164. rhs=23,
  4165. ),
  4166. Condition(
  4167. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  4168. op=Op.IN,
  4169. rhs=[9223372036854775909],
  4170. ),
  4171. ],
  4172. "having": [],
  4173. "orderby": [
  4174. OrderBy(
  4175. exp=Function(
  4176. function="arrayElement",
  4177. initializers=None,
  4178. parameters=[
  4179. Function(
  4180. function="quantilesIf(0.95)",
  4181. initializers=None,
  4182. parameters=[
  4183. Column(name="value", entity=None, subscriptable=None, key=None),
  4184. Function(
  4185. function="equals",
  4186. initializers=None,
  4187. parameters=[
  4188. Column(
  4189. name="metric_id",
  4190. entity=None,
  4191. subscriptable=None,
  4192. key=None,
  4193. ),
  4194. 9223372036854775909,
  4195. ],
  4196. alias=None,
  4197. ),
  4198. ],
  4199. alias=None,
  4200. ),
  4201. 1,
  4202. ],
  4203. alias="p95",
  4204. ),
  4205. direction=Direction.ASC,
  4206. )
  4207. ],
  4208. "limitby": None,
  4209. "limit": Limit(limit=51),
  4210. "offset": Offset(offset=0),
  4211. "granularity": None,
  4212. "totals": None,
  4213. }, # Checked
  4214. {
  4215. "match": Entity("metrics_distributions"),
  4216. "select": [
  4217. AliasedExpression(
  4218. exp=Column(
  4219. name="tags[" "9223372036854776021]",
  4220. entity=None,
  4221. subscriptable="tags",
  4222. key="9223372036854776021",
  4223. ),
  4224. alias="transaction.status",
  4225. ),
  4226. AliasedExpression(
  4227. exp=Column(
  4228. name="tags[9223372036854776020]",
  4229. entity=None,
  4230. subscriptable="tags",
  4231. key="9223372036854776020",
  4232. ),
  4233. alias="transaction",
  4234. ),
  4235. Function(
  4236. function="arrayElement",
  4237. initializers=None,
  4238. parameters=[
  4239. Function(
  4240. function="quantilesIf(0.95)",
  4241. initializers=None,
  4242. parameters=[
  4243. Column(name="value", entity=None, subscriptable=None, key=None),
  4244. Function(
  4245. function="equals",
  4246. initializers=None,
  4247. parameters=[
  4248. Column(
  4249. name="metric_id", entity=None, subscriptable=None, key=None
  4250. ),
  4251. 9223372036854775909,
  4252. ],
  4253. alias=None,
  4254. ),
  4255. ],
  4256. alias=None,
  4257. ),
  4258. 1,
  4259. ],
  4260. alias="p95",
  4261. ),
  4262. Function(
  4263. function="divide",
  4264. initializers=None,
  4265. parameters=[
  4266. Function(
  4267. function="countIf",
  4268. initializers=None,
  4269. parameters=[
  4270. Column(name="value", entity=None, subscriptable=None, key=None),
  4271. Function(
  4272. function="equals",
  4273. initializers=None,
  4274. parameters=[
  4275. Column(
  4276. name="metric_id", entity=None, subscriptable=None, key=None
  4277. ),
  4278. 9223372036854775909,
  4279. ],
  4280. alias=None,
  4281. ),
  4282. ],
  4283. alias=None,
  4284. ),
  4285. Function(
  4286. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  4287. ),
  4288. ],
  4289. alias="epm",
  4290. ),
  4291. Function(
  4292. function="divide",
  4293. initializers=None,
  4294. parameters=[
  4295. Function(
  4296. function="countIf",
  4297. initializers=None,
  4298. parameters=[
  4299. Column(name="value", entity=None, subscriptable=None, key=None),
  4300. Function(
  4301. function="and",
  4302. initializers=None,
  4303. parameters=[
  4304. Function(
  4305. function="equals",
  4306. initializers=None,
  4307. parameters=[
  4308. Column(
  4309. name="metric_id",
  4310. entity=None,
  4311. subscriptable=None,
  4312. key=None,
  4313. ),
  4314. 9223372036854775909,
  4315. ],
  4316. alias=None,
  4317. ),
  4318. Function(
  4319. function="notIn",
  4320. initializers=None,
  4321. parameters=[
  4322. Column(
  4323. name="tags[9223372036854776021]",
  4324. entity=None,
  4325. subscriptable="tags",
  4326. key="9223372036854776021",
  4327. ),
  4328. [
  4329. 9223372036854776028,
  4330. 9223372036854776027,
  4331. 9223372036854776029,
  4332. ],
  4333. ],
  4334. alias=None,
  4335. ),
  4336. ],
  4337. alias=None,
  4338. ),
  4339. ],
  4340. alias=None,
  4341. ),
  4342. Function(
  4343. function="countIf",
  4344. initializers=None,
  4345. parameters=[
  4346. Column(name="value", entity=None, subscriptable=None, key=None),
  4347. Function(
  4348. function="equals",
  4349. initializers=None,
  4350. parameters=[
  4351. Column(
  4352. name="metric_id", entity=None, subscriptable=None, key=None
  4353. ),
  4354. 9223372036854775909,
  4355. ],
  4356. alias=None,
  4357. ),
  4358. ],
  4359. alias=None,
  4360. ),
  4361. ],
  4362. alias="failure_rate",
  4363. ),
  4364. ],
  4365. "groupby": [
  4366. AliasedExpression(
  4367. exp=Column(
  4368. name="tags[9223372036854776021]",
  4369. entity=None,
  4370. subscriptable="tags",
  4371. key="9223372036854776021",
  4372. ),
  4373. alias="transaction.status",
  4374. ),
  4375. Function(
  4376. function="in",
  4377. initializers=None,
  4378. parameters=[
  4379. (
  4380. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4381. Column(
  4382. name="tags[9223372036854776020]",
  4383. entity=None,
  4384. subscriptable="tags",
  4385. key="9223372036854776020",
  4386. ),
  4387. ),
  4388. [(22, 533), (22, 537)],
  4389. ],
  4390. alias="team_key_transaction",
  4391. ),
  4392. AliasedExpression(
  4393. exp=Column(
  4394. name="tags[9223372036854776020]",
  4395. entity=None,
  4396. subscriptable="tags",
  4397. key="9223372036854776020",
  4398. ),
  4399. alias="transaction",
  4400. ),
  4401. Function(
  4402. function="transform",
  4403. initializers=None,
  4404. parameters=[
  4405. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4406. [22],
  4407. ["bar"],
  4408. "",
  4409. ],
  4410. alias="project",
  4411. ),
  4412. ],
  4413. "array_join": None,
  4414. "where": [
  4415. Condition(
  4416. lhs=Function(
  4417. function="in",
  4418. initializers=None,
  4419. parameters=[
  4420. (
  4421. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4422. Column(
  4423. name="tags[9223372036854776020]",
  4424. entity=None,
  4425. subscriptable="tags",
  4426. key="9223372036854776020",
  4427. ),
  4428. ),
  4429. [(22, 533), (22, 537)],
  4430. ],
  4431. alias="team_key_transaction",
  4432. ),
  4433. op=Op.EQ,
  4434. rhs=0,
  4435. ),
  4436. Condition(
  4437. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4438. op=Op.GTE,
  4439. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 77835, tzinfo=pytz.utc),
  4440. ),
  4441. Condition(
  4442. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4443. op=Op.LT,
  4444. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 77835, tzinfo=pytz.utc),
  4445. ),
  4446. Condition(
  4447. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  4448. op=Op.IN,
  4449. rhs=[22],
  4450. ),
  4451. Condition(
  4452. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  4453. op=Op.EQ,
  4454. rhs=23,
  4455. ),
  4456. Condition(
  4457. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  4458. op=Op.IN,
  4459. rhs=[9223372036854775909],
  4460. ),
  4461. ],
  4462. "having": [],
  4463. "orderby": [
  4464. OrderBy(
  4465. exp=Function(
  4466. function="arrayElement",
  4467. initializers=None,
  4468. parameters=[
  4469. Function(
  4470. function="quantilesIf(0.95)",
  4471. initializers=None,
  4472. parameters=[
  4473. Column(name="value", entity=None, subscriptable=None, key=None),
  4474. Function(
  4475. function="equals",
  4476. initializers=None,
  4477. parameters=[
  4478. Column(
  4479. name="metric_id",
  4480. entity=None,
  4481. subscriptable=None,
  4482. key=None,
  4483. ),
  4484. 9223372036854775909,
  4485. ],
  4486. alias=None,
  4487. ),
  4488. ],
  4489. alias=None,
  4490. ),
  4491. 1,
  4492. ],
  4493. alias="p95",
  4494. ),
  4495. direction=Direction.ASC,
  4496. )
  4497. ],
  4498. "limitby": None,
  4499. "limit": Limit(limit=51),
  4500. "offset": Offset(offset=0),
  4501. "granularity": None,
  4502. "totals": None,
  4503. }, # Checked
  4504. {
  4505. "match": Entity("metrics_distributions"),
  4506. "select": [
  4507. AliasedExpression(
  4508. exp=Column(
  4509. name="tags[9223372036854776021]",
  4510. entity=None,
  4511. subscriptable="tags",
  4512. key="9223372036854776021",
  4513. ),
  4514. alias="transaction.status",
  4515. ),
  4516. AliasedExpression(
  4517. exp=Column(
  4518. name="tags[9223372036854776020]",
  4519. entity=None,
  4520. subscriptable="tags",
  4521. key="9223372036854776020",
  4522. ),
  4523. alias="transaction",
  4524. ),
  4525. Function(
  4526. function="arrayElement",
  4527. initializers=None,
  4528. parameters=[
  4529. Function(
  4530. function="quantilesIf(0.95)",
  4531. initializers=None,
  4532. parameters=[
  4533. Column(name="value", entity=None, subscriptable=None, key=None),
  4534. Function(
  4535. function="equals",
  4536. initializers=None,
  4537. parameters=[
  4538. Column(
  4539. name="metric_id", entity=None, subscriptable=None, key=None
  4540. ),
  4541. 9223372036854775909,
  4542. ],
  4543. alias=None,
  4544. ),
  4545. ],
  4546. alias=None,
  4547. ),
  4548. 1,
  4549. ],
  4550. alias="p95",
  4551. ),
  4552. Function(
  4553. function="divide",
  4554. initializers=None,
  4555. parameters=[
  4556. Function(
  4557. function="countIf",
  4558. initializers=None,
  4559. parameters=[
  4560. Column(name="value", entity=None, subscriptable=None, key=None),
  4561. Function(
  4562. function="equals",
  4563. initializers=None,
  4564. parameters=[
  4565. Column(
  4566. name="metric_id", entity=None, subscriptable=None, key=None
  4567. ),
  4568. 9223372036854775909,
  4569. ],
  4570. alias=None,
  4571. ),
  4572. ],
  4573. alias=None,
  4574. ),
  4575. Function(
  4576. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  4577. ),
  4578. ],
  4579. alias="epm",
  4580. ),
  4581. Function(
  4582. function="divide",
  4583. initializers=None,
  4584. parameters=[
  4585. Function(
  4586. function="countIf",
  4587. initializers=None,
  4588. parameters=[
  4589. Column(name="value", entity=None, subscriptable=None, key=None),
  4590. Function(
  4591. function="and",
  4592. initializers=None,
  4593. parameters=[
  4594. Function(
  4595. function="equals",
  4596. initializers=None,
  4597. parameters=[
  4598. Column(
  4599. name="metric_id",
  4600. entity=None,
  4601. subscriptable=None,
  4602. key=None,
  4603. ),
  4604. 9223372036854775909,
  4605. ],
  4606. alias=None,
  4607. ),
  4608. Function(
  4609. function="notIn",
  4610. initializers=None,
  4611. parameters=[
  4612. Column(
  4613. name="tags[9223372036854776021]",
  4614. entity=None,
  4615. subscriptable="tags",
  4616. key="9223372036854776021",
  4617. ),
  4618. [
  4619. 9223372036854776028,
  4620. 9223372036854776027,
  4621. 9223372036854776029,
  4622. ],
  4623. ],
  4624. alias=None,
  4625. ),
  4626. ],
  4627. alias=None,
  4628. ),
  4629. ],
  4630. alias=None,
  4631. ),
  4632. Function(
  4633. function="countIf",
  4634. initializers=None,
  4635. parameters=[
  4636. Column(name="value", entity=None, subscriptable=None, key=None),
  4637. Function(
  4638. function="equals",
  4639. initializers=None,
  4640. parameters=[
  4641. Column(
  4642. name="metric_id", entity=None, subscriptable=None, key=None
  4643. ),
  4644. 9223372036854775909,
  4645. ],
  4646. alias=None,
  4647. ),
  4648. ],
  4649. alias=None,
  4650. ),
  4651. ],
  4652. alias="failure_rate",
  4653. ),
  4654. ],
  4655. "groupby": [
  4656. AliasedExpression(
  4657. exp=Column(
  4658. name="tags[9223372036854776021]",
  4659. entity=None,
  4660. subscriptable="tags",
  4661. key="9223372036854776021",
  4662. ),
  4663. alias="transaction.status",
  4664. ),
  4665. Function(
  4666. function="in",
  4667. initializers=None,
  4668. parameters=[
  4669. (
  4670. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4671. Column(
  4672. name="tags[9223372036854776020]",
  4673. entity=None,
  4674. subscriptable="tags",
  4675. key="9223372036854776020",
  4676. ),
  4677. ),
  4678. [(22, 533), (22, 537)],
  4679. ],
  4680. alias="team_key_transaction",
  4681. ),
  4682. AliasedExpression(
  4683. exp=Column(
  4684. name="tags[9223372036854776020]",
  4685. entity=None,
  4686. subscriptable="tags",
  4687. key="9223372036854776020",
  4688. ),
  4689. alias="transaction",
  4690. ),
  4691. Function(
  4692. function="transform",
  4693. initializers=None,
  4694. parameters=[
  4695. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4696. [22],
  4697. ["bar"],
  4698. "",
  4699. ],
  4700. alias="project",
  4701. ),
  4702. ],
  4703. "array_join": None,
  4704. "where": [
  4705. Condition(
  4706. lhs=Function(
  4707. function="in",
  4708. initializers=None,
  4709. parameters=[
  4710. (
  4711. Column(name="project_id", entity=None, subscriptable=None, key=None),
  4712. Column(
  4713. name="tags[9223372036854776020]",
  4714. entity=None,
  4715. subscriptable="tags",
  4716. key="9223372036854776020",
  4717. ),
  4718. ),
  4719. [(22, 533), (22, 537)],
  4720. ],
  4721. alias="team_key_transaction",
  4722. ),
  4723. op=Op.EQ,
  4724. rhs=0,
  4725. ),
  4726. Condition(
  4727. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4728. op=Op.GTE,
  4729. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 170133, tzinfo=pytz.utc),
  4730. ),
  4731. Condition(
  4732. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4733. op=Op.LT,
  4734. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 170133, tzinfo=pytz.utc),
  4735. ),
  4736. Condition(
  4737. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  4738. op=Op.IN,
  4739. rhs=[22],
  4740. ),
  4741. Condition(
  4742. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  4743. op=Op.EQ,
  4744. rhs=23,
  4745. ),
  4746. Condition(
  4747. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  4748. op=Op.IN,
  4749. rhs=[9223372036854775909],
  4750. ),
  4751. ],
  4752. "having": [],
  4753. "orderby": [
  4754. OrderBy(
  4755. exp=Function(
  4756. function="arrayElement",
  4757. initializers=None,
  4758. parameters=[
  4759. Function(
  4760. function="quantilesIf(0.95)",
  4761. initializers=None,
  4762. parameters=[
  4763. Column(name="value", entity=None, subscriptable=None, key=None),
  4764. Function(
  4765. function="equals",
  4766. initializers=None,
  4767. parameters=[
  4768. Column(
  4769. name="metric_id",
  4770. entity=None,
  4771. subscriptable=None,
  4772. key=None,
  4773. ),
  4774. 9223372036854775909,
  4775. ],
  4776. alias=None,
  4777. ),
  4778. ],
  4779. alias=None,
  4780. ),
  4781. 1,
  4782. ],
  4783. alias="p95",
  4784. ),
  4785. direction=Direction.ASC,
  4786. )
  4787. ],
  4788. "limitby": None,
  4789. "limit": Limit(limit=51),
  4790. "offset": Offset(offset=0),
  4791. "granularity": None,
  4792. "totals": None,
  4793. }, # Checked
  4794. {
  4795. "match": Entity("metrics_distributions"),
  4796. "select": [
  4797. Function(
  4798. function="arrayElement",
  4799. initializers=None,
  4800. parameters=[
  4801. Function(
  4802. function="quantilesIf(0.5)",
  4803. initializers=None,
  4804. parameters=[
  4805. Column(name="value", entity=None, subscriptable=None, key=None),
  4806. Function(
  4807. function="equals",
  4808. initializers=None,
  4809. parameters=[
  4810. Column(
  4811. name="metric_id", entity=None, subscriptable=None, key=None
  4812. ),
  4813. 9223372036854775909,
  4814. ],
  4815. alias=None,
  4816. ),
  4817. ],
  4818. alias=None,
  4819. ),
  4820. 1,
  4821. ],
  4822. alias="p50",
  4823. ),
  4824. AliasedExpression(
  4825. exp=Column(
  4826. name="tags[9223372036854776020]",
  4827. entity=None,
  4828. subscriptable="tags",
  4829. key="9223372036854776020",
  4830. ),
  4831. alias="title",
  4832. ),
  4833. ],
  4834. "groupby": [
  4835. AliasedExpression(
  4836. exp=Column(
  4837. name="tags[9223372036854776020]",
  4838. entity=None,
  4839. subscriptable="tags",
  4840. key="9223372036854776020",
  4841. ),
  4842. alias="title",
  4843. )
  4844. ],
  4845. "array_join": None,
  4846. "where": [
  4847. Condition(
  4848. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4849. op=Op.GTE,
  4850. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 419992, tzinfo=pytz.utc),
  4851. ),
  4852. Condition(
  4853. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  4854. op=Op.LT,
  4855. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 419992, tzinfo=pytz.utc),
  4856. ),
  4857. Condition(
  4858. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  4859. op=Op.IN,
  4860. rhs=[23],
  4861. ),
  4862. Condition(
  4863. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  4864. op=Op.EQ,
  4865. rhs=24,
  4866. ),
  4867. Condition(
  4868. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  4869. op=Op.IN,
  4870. rhs=[9223372036854775909],
  4871. ),
  4872. ],
  4873. "having": [],
  4874. "orderby": [],
  4875. "limitby": None,
  4876. "limit": Limit(limit=51),
  4877. "offset": Offset(offset=0),
  4878. "granularity": None,
  4879. "totals": None,
  4880. }, # Checked
  4881. {
  4882. "match": Entity("metrics_distributions"),
  4883. "select": [
  4884. AliasedExpression(
  4885. exp=Column(
  4886. name="tags[9223372036854776021]",
  4887. entity=None,
  4888. subscriptable="tags",
  4889. key="9223372036854776021",
  4890. ),
  4891. alias="transaction.status",
  4892. ),
  4893. AliasedExpression(
  4894. exp=Column(
  4895. name="tags[9223372036854776020]",
  4896. entity=None,
  4897. subscriptable="tags",
  4898. key="9223372036854776020",
  4899. ),
  4900. alias="transaction",
  4901. ),
  4902. Function(
  4903. function="arrayElement",
  4904. initializers=None,
  4905. parameters=[
  4906. Function(
  4907. function="quantilesIf(0.95)",
  4908. initializers=None,
  4909. parameters=[
  4910. Column(name="value", entity=None, subscriptable=None, key=None),
  4911. Function(
  4912. function="equals",
  4913. initializers=None,
  4914. parameters=[
  4915. Column(
  4916. name="metric_id", entity=None, subscriptable=None, key=None
  4917. ),
  4918. 9223372036854775909,
  4919. ],
  4920. alias=None,
  4921. ),
  4922. ],
  4923. alias=None,
  4924. ),
  4925. 1,
  4926. ],
  4927. alias="p95",
  4928. ),
  4929. Function(
  4930. function="divide",
  4931. initializers=None,
  4932. parameters=[
  4933. Function(
  4934. function="countIf",
  4935. initializers=None,
  4936. parameters=[
  4937. Column(name="value", entity=None, subscriptable=None, key=None),
  4938. Function(
  4939. function="equals",
  4940. initializers=None,
  4941. parameters=[
  4942. Column(
  4943. name="metric_id", entity=None, subscriptable=None, key=None
  4944. ),
  4945. 9223372036854775909,
  4946. ],
  4947. alias=None,
  4948. ),
  4949. ],
  4950. alias=None,
  4951. ),
  4952. Function(
  4953. function="divide", initializers=None, parameters=[7776000.0, 60], alias=None
  4954. ),
  4955. ],
  4956. alias="epm",
  4957. ),
  4958. Function(
  4959. function="divide",
  4960. initializers=None,
  4961. parameters=[
  4962. Function(
  4963. function="countIf",
  4964. initializers=None,
  4965. parameters=[
  4966. Column(name="value", entity=None, subscriptable=None, key=None),
  4967. Function(
  4968. function="and",
  4969. initializers=None,
  4970. parameters=[
  4971. Function(
  4972. function="equals",
  4973. initializers=None,
  4974. parameters=[
  4975. Column(
  4976. name="metric_id",
  4977. entity=None,
  4978. subscriptable=None,
  4979. key=None,
  4980. ),
  4981. 9223372036854775909,
  4982. ],
  4983. alias=None,
  4984. ),
  4985. Function(
  4986. function="notIn",
  4987. initializers=None,
  4988. parameters=[
  4989. Column(
  4990. name="tags[9223372036854776021]",
  4991. entity=None,
  4992. subscriptable="tags",
  4993. key="9223372036854776021",
  4994. ),
  4995. [
  4996. 9223372036854776028,
  4997. 9223372036854776027,
  4998. 9223372036854776029,
  4999. ],
  5000. ],
  5001. alias=None,
  5002. ),
  5003. ],
  5004. alias=None,
  5005. ),
  5006. ],
  5007. alias=None,
  5008. ),
  5009. Function(
  5010. function="countIf",
  5011. initializers=None,
  5012. parameters=[
  5013. Column(name="value", entity=None, subscriptable=None, key=None),
  5014. Function(
  5015. function="equals",
  5016. initializers=None,
  5017. parameters=[
  5018. Column(
  5019. name="metric_id", entity=None, subscriptable=None, key=None
  5020. ),
  5021. 9223372036854775909,
  5022. ],
  5023. alias=None,
  5024. ),
  5025. ],
  5026. alias=None,
  5027. ),
  5028. ],
  5029. alias="failure_rate",
  5030. ),
  5031. ],
  5032. "groupby": [
  5033. AliasedExpression(
  5034. exp=Column(
  5035. name="tags[9223372036854776021]",
  5036. entity=None,
  5037. subscriptable="tags",
  5038. key="9223372036854776021",
  5039. ),
  5040. alias="transaction.status",
  5041. ),
  5042. Function(
  5043. function="in",
  5044. initializers=None,
  5045. parameters=[
  5046. (
  5047. Column(name="project_id", entity=None, subscriptable=None, key=None),
  5048. Column(
  5049. name="tags[9223372036854776020]",
  5050. entity=None,
  5051. subscriptable="tags",
  5052. key="9223372036854776020",
  5053. ),
  5054. ),
  5055. [(24, 592)],
  5056. ],
  5057. alias="team_key_transaction",
  5058. ),
  5059. AliasedExpression(
  5060. exp=Column(
  5061. name="tags[9223372036854776020]",
  5062. entity=None,
  5063. subscriptable="tags",
  5064. key="9223372036854776020",
  5065. ),
  5066. alias="transaction",
  5067. ),
  5068. Function(
  5069. function="transform",
  5070. initializers=None,
  5071. parameters=[
  5072. Column(name="project_id", entity=None, subscriptable=None, key=None),
  5073. [24],
  5074. ["bar"],
  5075. "",
  5076. ],
  5077. alias="project",
  5078. ),
  5079. ],
  5080. "array_join": None,
  5081. "where": [
  5082. Condition(
  5083. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5084. op=Op.GTE,
  5085. rhs=datetime.datetime(2022, 3, 24, 11, 11, 39, 719119, tzinfo=pytz.utc),
  5086. ),
  5087. Condition(
  5088. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5089. op=Op.LT,
  5090. rhs=datetime.datetime(2022, 6, 22, 11, 11, 39, 719119, tzinfo=pytz.utc),
  5091. ),
  5092. Condition(
  5093. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5094. op=Op.IN,
  5095. rhs=[24],
  5096. ),
  5097. Condition(
  5098. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5099. op=Op.EQ,
  5100. rhs=25,
  5101. ),
  5102. Condition(
  5103. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5104. op=Op.IN,
  5105. rhs=[9223372036854775909],
  5106. ),
  5107. ],
  5108. "having": [],
  5109. "orderby": [
  5110. OrderBy(
  5111. exp=Function(
  5112. function="arrayElement",
  5113. initializers=None,
  5114. parameters=[
  5115. Function(
  5116. function="quantilesIf(0.95)",
  5117. initializers=None,
  5118. parameters=[
  5119. Column(name="value", entity=None, subscriptable=None, key=None),
  5120. Function(
  5121. function="equals",
  5122. initializers=None,
  5123. parameters=[
  5124. Column(
  5125. name="metric_id",
  5126. entity=None,
  5127. subscriptable=None,
  5128. key=None,
  5129. ),
  5130. 9223372036854775909,
  5131. ],
  5132. alias=None,
  5133. ),
  5134. ],
  5135. alias=None,
  5136. ),
  5137. 1,
  5138. ],
  5139. alias="p95",
  5140. ),
  5141. direction=Direction.ASC,
  5142. )
  5143. ],
  5144. "limitby": None,
  5145. "limit": Limit(limit=51),
  5146. "offset": Offset(offset=0),
  5147. "granularity": None,
  5148. "totals": None,
  5149. }, # Checked
  5150. ]
  5151. series_queries = [
  5152. Query(
  5153. match=Entity("metrics_sets"),
  5154. select=[
  5155. Function(
  5156. function="uniqIf",
  5157. initializers=None,
  5158. parameters=[
  5159. Column(name="value", entity=None, subscriptable=None, key=None),
  5160. Function(
  5161. function="equals",
  5162. initializers=None,
  5163. parameters=[
  5164. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5165. 9223372036854775908,
  5166. ],
  5167. alias=None,
  5168. ),
  5169. ],
  5170. alias="count_unique_user",
  5171. )
  5172. ],
  5173. groupby=[
  5174. Function(
  5175. function="toStartOfInterval",
  5176. initializers=None,
  5177. parameters=[
  5178. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5179. Function(
  5180. function="toIntervalSecond",
  5181. initializers=None,
  5182. parameters=[3600],
  5183. alias=None,
  5184. ),
  5185. "Universal",
  5186. ],
  5187. alias="time",
  5188. )
  5189. ],
  5190. array_join=None,
  5191. where=[
  5192. Condition(
  5193. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5194. op=Op.GTE,
  5195. rhs=datetime.datetime(2022, 6, 21, 10, 0, tzinfo=None),
  5196. ),
  5197. Condition(
  5198. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5199. op=Op.LT,
  5200. rhs=datetime.datetime(2022, 6, 21, 12, 0, tzinfo=None),
  5201. ),
  5202. Condition(
  5203. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5204. op=Op.IN,
  5205. rhs=[2],
  5206. ),
  5207. Condition(
  5208. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5209. op=Op.EQ,
  5210. rhs=2,
  5211. ),
  5212. Condition(
  5213. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5214. op=Op.IN,
  5215. rhs=[9223372036854775908],
  5216. ),
  5217. ],
  5218. having=[],
  5219. orderby=[
  5220. OrderBy(
  5221. exp=Function(
  5222. function="toStartOfInterval",
  5223. initializers=None,
  5224. parameters=[
  5225. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5226. Function(
  5227. function="toIntervalSecond",
  5228. initializers=None,
  5229. parameters=[3600],
  5230. alias=None,
  5231. ),
  5232. "Universal",
  5233. ],
  5234. alias="time",
  5235. ),
  5236. direction=Direction.ASC,
  5237. )
  5238. ],
  5239. limitby=None,
  5240. limit=Limit(limit=50),
  5241. offset=None,
  5242. granularity=Granularity(granularity=60),
  5243. totals=None,
  5244. ),
  5245. Query(
  5246. match=Entity("metrics_distributions"),
  5247. select=[
  5248. Function(
  5249. function="divide",
  5250. initializers=None,
  5251. parameters=[
  5252. Function(
  5253. function="countIf",
  5254. initializers=None,
  5255. parameters=[
  5256. Column(name="value", entity=None, subscriptable=None, key=None),
  5257. Function(
  5258. function="and",
  5259. initializers=None,
  5260. parameters=[
  5261. Function(
  5262. function="equals",
  5263. initializers=None,
  5264. parameters=[
  5265. Column(
  5266. name="metric_id",
  5267. entity=None,
  5268. subscriptable=None,
  5269. key=None,
  5270. ),
  5271. 9223372036854775909,
  5272. ],
  5273. alias=None,
  5274. ),
  5275. Function(
  5276. function="notIn",
  5277. initializers=None,
  5278. parameters=[
  5279. Column(
  5280. name="tags[9223372036854776021]",
  5281. entity=None,
  5282. subscriptable="tags",
  5283. key="9223372036854776021",
  5284. ),
  5285. [
  5286. 9223372036854776028,
  5287. 9223372036854776027,
  5288. 9223372036854776029,
  5289. ],
  5290. ],
  5291. alias=None,
  5292. ),
  5293. ],
  5294. alias=None,
  5295. ),
  5296. ],
  5297. alias=None,
  5298. ),
  5299. Function(
  5300. function="countIf",
  5301. initializers=None,
  5302. parameters=[
  5303. Column(name="value", entity=None, subscriptable=None, key=None),
  5304. Function(
  5305. function="equals",
  5306. initializers=None,
  5307. parameters=[
  5308. Column(
  5309. name="metric_id",
  5310. entity=None,
  5311. subscriptable=None,
  5312. key=None,
  5313. ),
  5314. 9223372036854775909,
  5315. ],
  5316. alias=None,
  5317. ),
  5318. ],
  5319. alias=None,
  5320. ),
  5321. ],
  5322. alias="failure_rate",
  5323. )
  5324. ],
  5325. groupby=[
  5326. Function(
  5327. function="toStartOfInterval",
  5328. initializers=None,
  5329. parameters=[
  5330. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5331. Function(
  5332. function="toIntervalSecond",
  5333. initializers=None,
  5334. parameters=[3600],
  5335. alias=None,
  5336. ),
  5337. "Universal",
  5338. ],
  5339. alias="time",
  5340. )
  5341. ],
  5342. array_join=None,
  5343. where=[
  5344. Condition(
  5345. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5346. op=Op.GTE,
  5347. rhs=datetime.datetime(2022, 6, 21, 10, 0, tzinfo=pytz.utc),
  5348. ),
  5349. Condition(
  5350. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5351. op=Op.LT,
  5352. rhs=datetime.datetime(2022, 6, 21, 16, 0, tzinfo=None),
  5353. ),
  5354. Condition(
  5355. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5356. op=Op.IN,
  5357. rhs=[4],
  5358. ),
  5359. Condition(
  5360. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5361. op=Op.EQ,
  5362. rhs=4,
  5363. ),
  5364. Condition(
  5365. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5366. op=Op.IN,
  5367. rhs=[9223372036854775909],
  5368. ),
  5369. ],
  5370. having=[],
  5371. orderby=[
  5372. OrderBy(
  5373. exp=Function(
  5374. function="toStartOfInterval",
  5375. initializers=None,
  5376. parameters=[
  5377. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5378. Function(
  5379. function="toIntervalSecond",
  5380. initializers=None,
  5381. parameters=[3600],
  5382. alias=None,
  5383. ),
  5384. "Universal",
  5385. ],
  5386. alias="time",
  5387. ),
  5388. direction=Direction.ASC,
  5389. )
  5390. ],
  5391. limitby=None,
  5392. limit=Limit(limit=50),
  5393. offset=None,
  5394. granularity=Granularity(granularity=60),
  5395. totals=None,
  5396. ),
  5397. Query(
  5398. match=Entity("metrics_distributions"),
  5399. select=[
  5400. Function(
  5401. function="divide",
  5402. initializers=None,
  5403. parameters=[
  5404. Function(
  5405. function="countIf",
  5406. initializers=None,
  5407. parameters=[
  5408. Column(name="value", entity=None, subscriptable=None, key=None),
  5409. Function(
  5410. function="equals",
  5411. initializers=None,
  5412. parameters=[
  5413. Column(
  5414. name="metric_id",
  5415. entity=None,
  5416. subscriptable=None,
  5417. key=None,
  5418. ),
  5419. 9223372036854775909,
  5420. ],
  5421. alias=None,
  5422. ),
  5423. ],
  5424. alias=None,
  5425. ),
  5426. Function(
  5427. function="divide",
  5428. initializers=None,
  5429. parameters=[3600.0, 60],
  5430. alias=None,
  5431. ),
  5432. ],
  5433. alias="epm_3600",
  5434. )
  5435. ],
  5436. groupby=[
  5437. Function(
  5438. function="toStartOfInterval",
  5439. initializers=None,
  5440. parameters=[
  5441. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5442. Function(
  5443. function="toIntervalSecond",
  5444. initializers=None,
  5445. parameters=[3600],
  5446. alias=None,
  5447. ),
  5448. "Universal",
  5449. ],
  5450. alias="time",
  5451. )
  5452. ],
  5453. array_join=None,
  5454. where=[
  5455. Condition(
  5456. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5457. op=Op.GTE,
  5458. rhs=datetime.datetime(2022, 6, 21, 10, 0, tzinfo=pytz.utc),
  5459. ),
  5460. Condition(
  5461. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5462. op=Op.LT,
  5463. rhs=datetime.datetime(2022, 6, 21, 12, 0, tzinfo=pytz.utc),
  5464. ),
  5465. Condition(
  5466. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5467. op=Op.IN,
  5468. rhs=[7],
  5469. ),
  5470. Condition(
  5471. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5472. op=Op.EQ,
  5473. rhs=7,
  5474. ),
  5475. Condition(
  5476. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5477. op=Op.IN,
  5478. rhs=[9223372036854775909],
  5479. ),
  5480. ],
  5481. having=[],
  5482. orderby=[
  5483. OrderBy(
  5484. exp=Function(
  5485. function="toStartOfInterval",
  5486. initializers=None,
  5487. parameters=[
  5488. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5489. Function(
  5490. function="toIntervalSecond",
  5491. initializers=None,
  5492. parameters=[3600],
  5493. alias=None,
  5494. ),
  5495. "Universal",
  5496. ],
  5497. alias="time",
  5498. ),
  5499. direction=Direction.ASC,
  5500. )
  5501. ],
  5502. limitby=None,
  5503. limit=Limit(limit=50),
  5504. offset=None,
  5505. granularity=Granularity(granularity=60),
  5506. totals=None,
  5507. ),
  5508. Query(
  5509. match=Entity("metrics_distributions"),
  5510. select=[
  5511. Function(
  5512. function="divide",
  5513. initializers=None,
  5514. parameters=[
  5515. Function(
  5516. function="countIf",
  5517. initializers=None,
  5518. parameters=[
  5519. Column(name="value", entity=None, subscriptable=None, key=None),
  5520. Function(
  5521. function="equals",
  5522. initializers=None,
  5523. parameters=[
  5524. Column(
  5525. name="metric_id",
  5526. entity=None,
  5527. subscriptable=None,
  5528. key=None,
  5529. ),
  5530. 9223372036854775909,
  5531. ],
  5532. alias=None,
  5533. ),
  5534. ],
  5535. alias=None,
  5536. ),
  5537. Function(
  5538. function="divide",
  5539. initializers=None,
  5540. parameters=[3600.0, 60],
  5541. alias=None,
  5542. ),
  5543. ],
  5544. alias="epm_3600",
  5545. )
  5546. ],
  5547. groupby=[
  5548. Function(
  5549. function="toStartOfInterval",
  5550. initializers=None,
  5551. parameters=[
  5552. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5553. Function(
  5554. function="toIntervalSecond",
  5555. initializers=None,
  5556. parameters=[3600],
  5557. alias=None,
  5558. ),
  5559. "Universal",
  5560. ],
  5561. alias="time",
  5562. )
  5563. ],
  5564. array_join=None,
  5565. where=[
  5566. Condition(
  5567. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5568. op=Op.GTE,
  5569. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  5570. ),
  5571. Condition(
  5572. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5573. op=Op.LT,
  5574. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  5575. ),
  5576. Condition(
  5577. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5578. op=Op.IN,
  5579. rhs=[7],
  5580. ),
  5581. Condition(
  5582. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5583. op=Op.EQ,
  5584. rhs=7,
  5585. ),
  5586. Condition(
  5587. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5588. op=Op.IN,
  5589. rhs=[9223372036854775909],
  5590. ),
  5591. ],
  5592. having=[],
  5593. orderby=[
  5594. OrderBy(
  5595. exp=Function(
  5596. function="toStartOfInterval",
  5597. initializers=None,
  5598. parameters=[
  5599. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5600. Function(
  5601. function="toIntervalSecond",
  5602. initializers=None,
  5603. parameters=[3600],
  5604. alias=None,
  5605. ),
  5606. "Universal",
  5607. ],
  5608. alias="time",
  5609. ),
  5610. direction=Direction.ASC,
  5611. )
  5612. ],
  5613. limitby=None,
  5614. limit=Limit(limit=50),
  5615. offset=None,
  5616. granularity=Granularity(granularity=60),
  5617. totals=None,
  5618. ),
  5619. Query(
  5620. match=Entity("metrics_distributions"),
  5621. select=[
  5622. Function(
  5623. function="divide",
  5624. initializers=None,
  5625. parameters=[
  5626. Function(
  5627. function="countIf",
  5628. initializers=None,
  5629. parameters=[
  5630. Column(name="value", entity=None, subscriptable=None, key=None),
  5631. Function(
  5632. function="equals",
  5633. initializers=None,
  5634. parameters=[
  5635. Column(
  5636. name="metric_id",
  5637. entity=None,
  5638. subscriptable=None,
  5639. key=None,
  5640. ),
  5641. 9223372036854775909,
  5642. ],
  5643. alias=None,
  5644. ),
  5645. ],
  5646. alias=None,
  5647. ),
  5648. Function(
  5649. function="divide",
  5650. initializers=None,
  5651. parameters=[3600.0, 60],
  5652. alias=None,
  5653. ),
  5654. ],
  5655. alias="epm_3600",
  5656. )
  5657. ],
  5658. groupby=[
  5659. Function(
  5660. function="toStartOfInterval",
  5661. initializers=None,
  5662. parameters=[
  5663. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5664. Function(
  5665. function="toIntervalSecond",
  5666. initializers=None,
  5667. parameters=[3600],
  5668. alias=None,
  5669. ),
  5670. "Universal",
  5671. ],
  5672. alias="time",
  5673. )
  5674. ],
  5675. array_join=None,
  5676. where=[
  5677. Condition(
  5678. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5679. op=Op.GTE,
  5680. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  5681. ),
  5682. Condition(
  5683. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5684. op=Op.LT,
  5685. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  5686. ),
  5687. Condition(
  5688. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5689. op=Op.IN,
  5690. rhs=[7],
  5691. ),
  5692. Condition(
  5693. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5694. op=Op.EQ,
  5695. rhs=7,
  5696. ),
  5697. Condition(
  5698. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5699. op=Op.IN,
  5700. rhs=[9223372036854775909],
  5701. ),
  5702. ],
  5703. having=[],
  5704. orderby=[
  5705. OrderBy(
  5706. exp=Function(
  5707. function="toStartOfInterval",
  5708. initializers=None,
  5709. parameters=[
  5710. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5711. Function(
  5712. function="toIntervalSecond",
  5713. initializers=None,
  5714. parameters=[3600],
  5715. alias=None,
  5716. ),
  5717. "Universal",
  5718. ],
  5719. alias="time",
  5720. ),
  5721. direction=Direction.ASC,
  5722. )
  5723. ],
  5724. limitby=None,
  5725. limit=Limit(limit=50),
  5726. offset=None,
  5727. granularity=Granularity(granularity=60),
  5728. totals=None,
  5729. ),
  5730. Query(
  5731. match=Entity("metrics_distributions"),
  5732. select=[
  5733. Function(
  5734. function="divide",
  5735. initializers=None,
  5736. parameters=[
  5737. Function(
  5738. function="countIf",
  5739. initializers=None,
  5740. parameters=[
  5741. Column(name="value", entity=None, subscriptable=None, key=None),
  5742. Function(
  5743. function="equals",
  5744. initializers=None,
  5745. parameters=[
  5746. Column(
  5747. name="metric_id",
  5748. entity=None,
  5749. subscriptable=None,
  5750. key=None,
  5751. ),
  5752. 9223372036854775909,
  5753. ],
  5754. alias=None,
  5755. ),
  5756. ],
  5757. alias=None,
  5758. ),
  5759. Function(
  5760. function="divide",
  5761. initializers=None,
  5762. parameters=[3600.0, 60],
  5763. alias=None,
  5764. ),
  5765. ],
  5766. alias="epm_3600",
  5767. )
  5768. ],
  5769. groupby=[
  5770. Function(
  5771. function="toStartOfInterval",
  5772. initializers=None,
  5773. parameters=[
  5774. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5775. Function(
  5776. function="toIntervalSecond",
  5777. initializers=None,
  5778. parameters=[3600],
  5779. alias=None,
  5780. ),
  5781. "Universal",
  5782. ],
  5783. alias="time",
  5784. )
  5785. ],
  5786. array_join=None,
  5787. where=[
  5788. Condition(
  5789. lhs=Column(
  5790. name="tags[9223372036854776020]",
  5791. entity=None,
  5792. subscriptable="tags",
  5793. key="9223372036854776020",
  5794. ),
  5795. op=Op.EQ,
  5796. rhs=108,
  5797. ),
  5798. Condition(
  5799. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5800. op=Op.GTE,
  5801. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  5802. ),
  5803. Condition(
  5804. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5805. op=Op.LT,
  5806. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  5807. ),
  5808. Condition(
  5809. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5810. op=Op.IN,
  5811. rhs=[7],
  5812. ),
  5813. Condition(
  5814. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5815. op=Op.EQ,
  5816. rhs=7,
  5817. ),
  5818. Condition(
  5819. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5820. op=Op.IN,
  5821. rhs=[9223372036854775909],
  5822. ),
  5823. ],
  5824. having=[],
  5825. orderby=[
  5826. OrderBy(
  5827. exp=Function(
  5828. function="toStartOfInterval",
  5829. initializers=None,
  5830. parameters=[
  5831. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5832. Function(
  5833. function="toIntervalSecond",
  5834. initializers=None,
  5835. parameters=[3600],
  5836. alias=None,
  5837. ),
  5838. "Universal",
  5839. ],
  5840. alias="time",
  5841. ),
  5842. direction=Direction.ASC,
  5843. )
  5844. ],
  5845. limitby=None,
  5846. limit=Limit(limit=50),
  5847. offset=None,
  5848. granularity=Granularity(granularity=60),
  5849. totals=None,
  5850. ),
  5851. Query(
  5852. match=Entity("metrics_distributions"),
  5853. select=[
  5854. Function(
  5855. function="arrayElement",
  5856. initializers=None,
  5857. parameters=[
  5858. Function(
  5859. function="quantilesIf(0.75)",
  5860. initializers=None,
  5861. parameters=[
  5862. Column(name="value", entity=None, subscriptable=None, key=None),
  5863. Function(
  5864. function="equals",
  5865. initializers=None,
  5866. parameters=[
  5867. Column(
  5868. name="metric_id",
  5869. entity=None,
  5870. subscriptable=None,
  5871. key=None,
  5872. ),
  5873. 9223372036854775909,
  5874. ],
  5875. alias=None,
  5876. ),
  5877. ],
  5878. alias=None,
  5879. ),
  5880. 1,
  5881. ],
  5882. alias="p75_transaction_duration",
  5883. ),
  5884. Function(
  5885. function="arrayElement",
  5886. initializers=None,
  5887. parameters=[
  5888. Function(
  5889. function="quantilesIf(0.75)",
  5890. initializers=None,
  5891. parameters=[
  5892. Column(name="value", entity=None, subscriptable=None, key=None),
  5893. Function(
  5894. function="equals",
  5895. initializers=None,
  5896. parameters=[
  5897. Column(
  5898. name="metric_id",
  5899. entity=None,
  5900. subscriptable=None,
  5901. key=None,
  5902. ),
  5903. 9223372036854775911,
  5904. ],
  5905. alias=None,
  5906. ),
  5907. ],
  5908. alias=None,
  5909. ),
  5910. 1,
  5911. ],
  5912. alias="p75_measurements_lcp",
  5913. ),
  5914. ],
  5915. groupby=[
  5916. Function(
  5917. function="toStartOfInterval",
  5918. initializers=None,
  5919. parameters=[
  5920. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5921. Function(
  5922. function="toIntervalSecond",
  5923. initializers=None,
  5924. parameters=[3600],
  5925. alias=None,
  5926. ),
  5927. "Universal",
  5928. ],
  5929. alias="time",
  5930. )
  5931. ],
  5932. array_join=None,
  5933. where=[
  5934. Condition(
  5935. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5936. op=Op.GTE,
  5937. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  5938. ),
  5939. Condition(
  5940. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5941. op=Op.LT,
  5942. rhs=datetime.datetime(2022, 6, 21, 16, 0),
  5943. ),
  5944. Condition(
  5945. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  5946. op=Op.IN,
  5947. rhs=[8],
  5948. ),
  5949. Condition(
  5950. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  5951. op=Op.EQ,
  5952. rhs=8,
  5953. ),
  5954. Condition(
  5955. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  5956. op=Op.IN,
  5957. rhs=[9223372036854775909, 9223372036854775911],
  5958. ),
  5959. ],
  5960. having=[],
  5961. orderby=[
  5962. OrderBy(
  5963. exp=Function(
  5964. function="toStartOfInterval",
  5965. initializers=None,
  5966. parameters=[
  5967. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  5968. Function(
  5969. function="toIntervalSecond",
  5970. initializers=None,
  5971. parameters=[3600],
  5972. alias=None,
  5973. ),
  5974. "Universal",
  5975. ],
  5976. alias="time",
  5977. ),
  5978. direction=Direction.ASC,
  5979. )
  5980. ],
  5981. limitby=None,
  5982. limit=Limit(limit=50),
  5983. offset=None,
  5984. granularity=Granularity(granularity=60),
  5985. totals=None,
  5986. ),
  5987. Query(
  5988. match=Entity("metrics_distributions"),
  5989. select=[
  5990. Function(
  5991. function="sumIf",
  5992. initializers=None,
  5993. parameters=[
  5994. Column(name="value", entity=None, subscriptable=None, key=None),
  5995. Function(
  5996. function="equals",
  5997. initializers=None,
  5998. parameters=[
  5999. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6000. 9223372036854775909,
  6001. ],
  6002. alias=None,
  6003. ),
  6004. ],
  6005. alias="sum_transaction_duration",
  6006. )
  6007. ],
  6008. groupby=[
  6009. Function(
  6010. function="toStartOfInterval",
  6011. initializers=None,
  6012. parameters=[
  6013. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6014. Function(
  6015. function="toIntervalSecond",
  6016. initializers=None,
  6017. parameters=[3600],
  6018. alias=None,
  6019. ),
  6020. "Universal",
  6021. ],
  6022. alias="time",
  6023. )
  6024. ],
  6025. array_join=None,
  6026. where=[
  6027. Condition(
  6028. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6029. op=Op.GTE,
  6030. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  6031. ),
  6032. Condition(
  6033. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6034. op=Op.LT,
  6035. rhs=datetime.datetime(2022, 6, 21, 12, 0),
  6036. ),
  6037. Condition(
  6038. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6039. op=Op.IN,
  6040. rhs=[9],
  6041. ),
  6042. Condition(
  6043. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6044. op=Op.EQ,
  6045. rhs=9,
  6046. ),
  6047. Condition(
  6048. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6049. op=Op.IN,
  6050. rhs=[9223372036854775909],
  6051. ),
  6052. ],
  6053. having=[],
  6054. orderby=[
  6055. OrderBy(
  6056. exp=Function(
  6057. function="toStartOfInterval",
  6058. initializers=None,
  6059. parameters=[
  6060. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6061. Function(
  6062. function="toIntervalSecond",
  6063. initializers=None,
  6064. parameters=[3600],
  6065. alias=None,
  6066. ),
  6067. "Universal",
  6068. ],
  6069. alias="time",
  6070. ),
  6071. direction=Direction.ASC,
  6072. )
  6073. ],
  6074. limitby=None,
  6075. limit=Limit(limit=50),
  6076. offset=None,
  6077. granularity=Granularity(granularity=60),
  6078. totals=None,
  6079. ),
  6080. Query(
  6081. match=Entity("metrics_distributions"),
  6082. select=[
  6083. Function(
  6084. function="divide",
  6085. initializers=None,
  6086. parameters=[
  6087. Function(
  6088. function="countIf",
  6089. initializers=None,
  6090. parameters=[
  6091. Column(name="value", entity=None, subscriptable=None, key=None),
  6092. Function(
  6093. function="equals",
  6094. initializers=None,
  6095. parameters=[
  6096. Column(
  6097. name="metric_id",
  6098. entity=None,
  6099. subscriptable=None,
  6100. key=None,
  6101. ),
  6102. 9223372036854775909,
  6103. ],
  6104. alias=None,
  6105. ),
  6106. ],
  6107. alias=None,
  6108. ),
  6109. Function(
  6110. function="divide",
  6111. initializers=None,
  6112. parameters=[86400.0, 60],
  6113. alias=None,
  6114. ),
  6115. ],
  6116. alias="epm_86400",
  6117. )
  6118. ],
  6119. groupby=[
  6120. Function(
  6121. function="toStartOfInterval",
  6122. initializers=None,
  6123. parameters=[
  6124. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6125. Function(
  6126. function="toIntervalSecond",
  6127. initializers=None,
  6128. parameters=[86400],
  6129. alias=None,
  6130. ),
  6131. "Universal",
  6132. ],
  6133. alias="time",
  6134. )
  6135. ],
  6136. array_join=None,
  6137. where=[
  6138. Condition(
  6139. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6140. op=Op.GTE,
  6141. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  6142. ),
  6143. Condition(
  6144. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6145. op=Op.LT,
  6146. rhs=datetime.datetime(2022, 6, 22, 10, 0),
  6147. ),
  6148. Condition(
  6149. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6150. op=Op.IN,
  6151. rhs=[10],
  6152. ),
  6153. Condition(
  6154. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6155. op=Op.EQ,
  6156. rhs=10,
  6157. ),
  6158. Condition(
  6159. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6160. op=Op.IN,
  6161. rhs=[9223372036854775909],
  6162. ),
  6163. ],
  6164. having=[],
  6165. orderby=[
  6166. OrderBy(
  6167. exp=Function(
  6168. function="toStartOfInterval",
  6169. initializers=None,
  6170. parameters=[
  6171. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6172. Function(
  6173. function="toIntervalSecond",
  6174. initializers=None,
  6175. parameters=[86400],
  6176. alias=None,
  6177. ),
  6178. "Universal",
  6179. ],
  6180. alias="time",
  6181. ),
  6182. direction=Direction.ASC,
  6183. )
  6184. ],
  6185. limitby=None,
  6186. limit=Limit(limit=50),
  6187. offset=None,
  6188. granularity=Granularity(granularity=3600),
  6189. totals=None,
  6190. ),
  6191. Query(
  6192. match=Entity("metrics_distributions"),
  6193. select=[
  6194. Function(
  6195. function="divide",
  6196. initializers=None,
  6197. parameters=[
  6198. Function(
  6199. function="countIf",
  6200. initializers=None,
  6201. parameters=[
  6202. Column(name="value", entity=None, subscriptable=None, key=None),
  6203. Function(
  6204. function="equals",
  6205. initializers=None,
  6206. parameters=[
  6207. Column(
  6208. name="metric_id",
  6209. entity=None,
  6210. subscriptable=None,
  6211. key=None,
  6212. ),
  6213. 9223372036854775909,
  6214. ],
  6215. alias=None,
  6216. ),
  6217. ],
  6218. alias=None,
  6219. ),
  6220. Function(
  6221. function="divide",
  6222. initializers=None,
  6223. parameters=[86400.0, 60],
  6224. alias=None,
  6225. ),
  6226. ],
  6227. alias="tpm_86400",
  6228. )
  6229. ],
  6230. groupby=[
  6231. Function(
  6232. function="toStartOfInterval",
  6233. initializers=None,
  6234. parameters=[
  6235. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6236. Function(
  6237. function="toIntervalSecond",
  6238. initializers=None,
  6239. parameters=[86400],
  6240. alias=None,
  6241. ),
  6242. "Universal",
  6243. ],
  6244. alias="time",
  6245. )
  6246. ],
  6247. array_join=None,
  6248. where=[
  6249. Condition(
  6250. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6251. op=Op.GTE,
  6252. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  6253. ),
  6254. Condition(
  6255. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6256. op=Op.LT,
  6257. rhs=datetime.datetime(2022, 6, 22, 10, 0),
  6258. ),
  6259. Condition(
  6260. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6261. op=Op.IN,
  6262. rhs=[10],
  6263. ),
  6264. Condition(
  6265. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6266. op=Op.EQ,
  6267. rhs=10,
  6268. ),
  6269. Condition(
  6270. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6271. op=Op.IN,
  6272. rhs=[9223372036854775909],
  6273. ),
  6274. ],
  6275. having=[],
  6276. orderby=[
  6277. OrderBy(
  6278. exp=Function(
  6279. function="toStartOfInterval",
  6280. initializers=None,
  6281. parameters=[
  6282. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6283. Function(
  6284. function="toIntervalSecond",
  6285. initializers=None,
  6286. parameters=[86400],
  6287. alias=None,
  6288. ),
  6289. "Universal",
  6290. ],
  6291. alias="time",
  6292. ),
  6293. direction=Direction.ASC,
  6294. )
  6295. ],
  6296. limitby=None,
  6297. limit=Limit(limit=50),
  6298. offset=None,
  6299. granularity=Granularity(granularity=3600),
  6300. totals=None,
  6301. ),
  6302. Query(
  6303. match=Entity("metrics_distributions"),
  6304. select=[
  6305. Function(
  6306. function="divide",
  6307. initializers=None,
  6308. parameters=[
  6309. Function(
  6310. function="countIf",
  6311. initializers=None,
  6312. parameters=[
  6313. Column(name="value", entity=None, subscriptable=None, key=None),
  6314. Function(
  6315. function="equals",
  6316. initializers=None,
  6317. parameters=[
  6318. Column(
  6319. name="metric_id",
  6320. entity=None,
  6321. subscriptable=None,
  6322. key=None,
  6323. ),
  6324. 9223372036854775909,
  6325. ],
  6326. alias=None,
  6327. ),
  6328. ],
  6329. alias=None,
  6330. ),
  6331. Function(
  6332. function="divide",
  6333. initializers=None,
  6334. parameters=[3600.0, 60],
  6335. alias=None,
  6336. ),
  6337. ],
  6338. alias="epm_3600",
  6339. )
  6340. ],
  6341. groupby=[
  6342. Function(
  6343. function="toStartOfInterval",
  6344. initializers=None,
  6345. parameters=[
  6346. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6347. Function(
  6348. function="toIntervalSecond",
  6349. initializers=None,
  6350. parameters=[3600],
  6351. alias=None,
  6352. ),
  6353. "Universal",
  6354. ],
  6355. alias="time",
  6356. )
  6357. ],
  6358. array_join=None,
  6359. where=[
  6360. Condition(
  6361. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6362. op=Op.GTE,
  6363. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  6364. ),
  6365. Condition(
  6366. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6367. op=Op.LT,
  6368. rhs=datetime.datetime(2022, 6, 21, 16, 0),
  6369. ),
  6370. Condition(
  6371. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6372. op=Op.IN,
  6373. rhs=[11],
  6374. ),
  6375. Condition(
  6376. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6377. op=Op.EQ,
  6378. rhs=11,
  6379. ),
  6380. Condition(
  6381. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6382. op=Op.IN,
  6383. rhs=[9223372036854775909],
  6384. ),
  6385. ],
  6386. having=[],
  6387. orderby=[
  6388. OrderBy(
  6389. exp=Function(
  6390. function="toStartOfInterval",
  6391. initializers=None,
  6392. parameters=[
  6393. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6394. Function(
  6395. function="toIntervalSecond",
  6396. initializers=None,
  6397. parameters=[3600],
  6398. alias=None,
  6399. ),
  6400. "Universal",
  6401. ],
  6402. alias="time",
  6403. ),
  6404. direction=Direction.ASC,
  6405. )
  6406. ],
  6407. limitby=None,
  6408. limit=Limit(limit=50),
  6409. offset=None,
  6410. granularity=Granularity(granularity=60),
  6411. totals=None,
  6412. ),
  6413. Query(
  6414. match=Entity("metrics_distributions"),
  6415. select=[
  6416. Function(
  6417. function="divide",
  6418. initializers=None,
  6419. parameters=[
  6420. Function(
  6421. function="countIf",
  6422. initializers=None,
  6423. parameters=[
  6424. Column(name="value", entity=None, subscriptable=None, key=None),
  6425. Function(
  6426. function="equals",
  6427. initializers=None,
  6428. parameters=[
  6429. Column(
  6430. name="metric_id",
  6431. entity=None,
  6432. subscriptable=None,
  6433. key=None,
  6434. ),
  6435. 9223372036854775909,
  6436. ],
  6437. alias=None,
  6438. ),
  6439. ],
  6440. alias=None,
  6441. ),
  6442. Function(
  6443. function="divide",
  6444. initializers=None,
  6445. parameters=[3600.0, 60],
  6446. alias=None,
  6447. ),
  6448. ],
  6449. alias="tpm_3600",
  6450. )
  6451. ],
  6452. groupby=[
  6453. Function(
  6454. function="toStartOfInterval",
  6455. initializers=None,
  6456. parameters=[
  6457. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6458. Function(
  6459. function="toIntervalSecond",
  6460. initializers=None,
  6461. parameters=[3600],
  6462. alias=None,
  6463. ),
  6464. "Universal",
  6465. ],
  6466. alias="time",
  6467. )
  6468. ],
  6469. array_join=None,
  6470. where=[
  6471. Condition(
  6472. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6473. op=Op.GTE,
  6474. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  6475. ),
  6476. Condition(
  6477. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6478. op=Op.LT,
  6479. rhs=datetime.datetime(2022, 6, 21, 16, 0),
  6480. ),
  6481. Condition(
  6482. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6483. op=Op.IN,
  6484. rhs=[11],
  6485. ),
  6486. Condition(
  6487. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6488. op=Op.EQ,
  6489. rhs=11,
  6490. ),
  6491. Condition(
  6492. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6493. op=Op.IN,
  6494. rhs=[9223372036854775909],
  6495. ),
  6496. ],
  6497. having=[],
  6498. orderby=[
  6499. OrderBy(
  6500. exp=Function(
  6501. function="toStartOfInterval",
  6502. initializers=None,
  6503. parameters=[
  6504. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6505. Function(
  6506. function="toIntervalSecond",
  6507. initializers=None,
  6508. parameters=[3600],
  6509. alias=None,
  6510. ),
  6511. "Universal",
  6512. ],
  6513. alias="time",
  6514. ),
  6515. direction=Direction.ASC,
  6516. )
  6517. ],
  6518. limitby=None,
  6519. limit=Limit(limit=50),
  6520. offset=None,
  6521. granularity=Granularity(granularity=60),
  6522. totals=None,
  6523. ),
  6524. Query(
  6525. match=Entity("metrics_distributions"),
  6526. select=[
  6527. Function(
  6528. function="divide",
  6529. initializers=None,
  6530. parameters=[
  6531. Function(
  6532. function="countIf",
  6533. initializers=None,
  6534. parameters=[
  6535. Column(name="value", entity=None, subscriptable=None, key=None),
  6536. Function(
  6537. function="equals",
  6538. initializers=None,
  6539. parameters=[
  6540. Column(
  6541. name="metric_id",
  6542. entity=None,
  6543. subscriptable=None,
  6544. key=None,
  6545. ),
  6546. 9223372036854775909,
  6547. ],
  6548. alias=None,
  6549. ),
  6550. ],
  6551. alias=None,
  6552. ),
  6553. Function(
  6554. function="divide",
  6555. initializers=None,
  6556. parameters=[3600.0, 60],
  6557. alias=None,
  6558. ),
  6559. ],
  6560. alias="tpm_3600",
  6561. )
  6562. ],
  6563. groupby=[
  6564. Function(
  6565. function="toStartOfInterval",
  6566. initializers=None,
  6567. parameters=[
  6568. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6569. Function(
  6570. function="toIntervalSecond",
  6571. initializers=None,
  6572. parameters=[3600],
  6573. alias=None,
  6574. ),
  6575. "Universal",
  6576. ],
  6577. alias="time",
  6578. )
  6579. ],
  6580. array_join=None,
  6581. where=[
  6582. Condition(
  6583. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6584. op=Op.GTE,
  6585. rhs=datetime.datetime(2022, 6, 21, 10, 30),
  6586. ),
  6587. Condition(
  6588. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6589. op=Op.LT,
  6590. rhs=datetime.datetime(2022, 6, 21, 16, 30),
  6591. ),
  6592. Condition(
  6593. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6594. op=Op.IN,
  6595. rhs=[12],
  6596. ),
  6597. Condition(
  6598. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6599. op=Op.EQ,
  6600. rhs=12,
  6601. ),
  6602. Condition(
  6603. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6604. op=Op.IN,
  6605. rhs=[9223372036854775909],
  6606. ),
  6607. ],
  6608. having=[],
  6609. orderby=[
  6610. OrderBy(
  6611. exp=Function(
  6612. function="toStartOfInterval",
  6613. initializers=None,
  6614. parameters=[
  6615. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6616. Function(
  6617. function="toIntervalSecond",
  6618. initializers=None,
  6619. parameters=[3600],
  6620. alias=None,
  6621. ),
  6622. "Universal",
  6623. ],
  6624. alias="time",
  6625. ),
  6626. direction=Direction.ASC,
  6627. )
  6628. ],
  6629. limitby=None,
  6630. limit=Limit(limit=50),
  6631. offset=None,
  6632. granularity=Granularity(granularity=60),
  6633. totals=None,
  6634. ),
  6635. Query(
  6636. match=Entity("metrics_distributions"),
  6637. select=[
  6638. Function(
  6639. function="divide",
  6640. initializers=None,
  6641. parameters=[
  6642. Function(
  6643. function="countIf",
  6644. initializers=None,
  6645. parameters=[
  6646. Column(name="value", entity=None, subscriptable=None, key=None),
  6647. Function(
  6648. function="equals",
  6649. initializers=None,
  6650. parameters=[
  6651. Column(
  6652. name="metric_id",
  6653. entity=None,
  6654. subscriptable=None,
  6655. key=None,
  6656. ),
  6657. 9223372036854775909,
  6658. ],
  6659. alias=None,
  6660. ),
  6661. ],
  6662. alias=None,
  6663. ),
  6664. Function(
  6665. function="divide",
  6666. initializers=None,
  6667. parameters=[3600.0, 60],
  6668. alias=None,
  6669. ),
  6670. ],
  6671. alias="epm_3600",
  6672. )
  6673. ],
  6674. groupby=[
  6675. Function(
  6676. function="toStartOfInterval",
  6677. initializers=None,
  6678. parameters=[
  6679. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6680. Function(
  6681. function="toIntervalSecond",
  6682. initializers=None,
  6683. parameters=[3600],
  6684. alias=None,
  6685. ),
  6686. "Universal",
  6687. ],
  6688. alias="time",
  6689. )
  6690. ],
  6691. array_join=None,
  6692. where=[
  6693. Condition(
  6694. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6695. op=Op.GTE,
  6696. rhs=datetime.datetime(2022, 6, 21, 10, 30),
  6697. ),
  6698. Condition(
  6699. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6700. op=Op.LT,
  6701. rhs=datetime.datetime(2022, 6, 21, 16, 30),
  6702. ),
  6703. Condition(
  6704. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6705. op=Op.IN,
  6706. rhs=[12],
  6707. ),
  6708. Condition(
  6709. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6710. op=Op.EQ,
  6711. rhs=12,
  6712. ),
  6713. Condition(
  6714. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6715. op=Op.IN,
  6716. rhs=[9223372036854775909],
  6717. ),
  6718. ],
  6719. having=[],
  6720. orderby=[
  6721. OrderBy(
  6722. exp=Function(
  6723. function="toStartOfInterval",
  6724. initializers=None,
  6725. parameters=[
  6726. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6727. Function(
  6728. function="toIntervalSecond",
  6729. initializers=None,
  6730. parameters=[3600],
  6731. alias=None,
  6732. ),
  6733. "Universal",
  6734. ],
  6735. alias="time",
  6736. ),
  6737. direction=Direction.ASC,
  6738. )
  6739. ],
  6740. limitby=None,
  6741. limit=Limit(limit=50),
  6742. offset=None,
  6743. granularity=Granularity(granularity=60),
  6744. totals=None,
  6745. ),
  6746. Query(
  6747. match=Entity("metrics_distributions"),
  6748. select=[
  6749. Function(
  6750. function="divide",
  6751. initializers=None,
  6752. parameters=[
  6753. Function(
  6754. function="countIf",
  6755. initializers=None,
  6756. parameters=[
  6757. Column(name="value", entity=None, subscriptable=None, key=None),
  6758. Function(
  6759. function="equals",
  6760. initializers=None,
  6761. parameters=[
  6762. Column(
  6763. name="metric_id",
  6764. entity=None,
  6765. subscriptable=None,
  6766. key=None,
  6767. ),
  6768. 9223372036854775909,
  6769. ],
  6770. alias=None,
  6771. ),
  6772. ],
  6773. alias=None,
  6774. ),
  6775. 60.0,
  6776. ],
  6777. alias="eps_60",
  6778. )
  6779. ],
  6780. groupby=[
  6781. Function(
  6782. function="toStartOfInterval",
  6783. initializers=None,
  6784. parameters=[
  6785. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6786. Function(
  6787. function="toIntervalSecond",
  6788. initializers=None,
  6789. parameters=[60],
  6790. alias=None,
  6791. ),
  6792. "Universal",
  6793. ],
  6794. alias="time",
  6795. )
  6796. ],
  6797. array_join=None,
  6798. where=[
  6799. Condition(
  6800. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6801. op=Op.GTE,
  6802. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  6803. ),
  6804. Condition(
  6805. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6806. op=Op.LT,
  6807. rhs=datetime.datetime(2022, 6, 21, 10, 6),
  6808. ),
  6809. Condition(
  6810. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6811. op=Op.IN,
  6812. rhs=[13],
  6813. ),
  6814. Condition(
  6815. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6816. op=Op.EQ,
  6817. rhs=13,
  6818. ),
  6819. Condition(
  6820. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6821. op=Op.IN,
  6822. rhs=[9223372036854775909],
  6823. ),
  6824. ],
  6825. having=[],
  6826. orderby=[
  6827. OrderBy(
  6828. exp=Function(
  6829. function="toStartOfInterval",
  6830. initializers=None,
  6831. parameters=[
  6832. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6833. Function(
  6834. function="toIntervalSecond",
  6835. initializers=None,
  6836. parameters=[60],
  6837. alias=None,
  6838. ),
  6839. "Universal",
  6840. ],
  6841. alias="time",
  6842. ),
  6843. direction=Direction.ASC,
  6844. )
  6845. ],
  6846. limitby=None,
  6847. limit=Limit(limit=50),
  6848. offset=None,
  6849. granularity=Granularity(granularity=10),
  6850. totals=None,
  6851. ),
  6852. Query(
  6853. match=Entity("metrics_distributions"),
  6854. select=[
  6855. Function(
  6856. function="divide",
  6857. initializers=None,
  6858. parameters=[
  6859. Function(
  6860. function="countIf",
  6861. initializers=None,
  6862. parameters=[
  6863. Column(name="value", entity=None, subscriptable=None, key=None),
  6864. Function(
  6865. function="equals",
  6866. initializers=None,
  6867. parameters=[
  6868. Column(
  6869. name="metric_id",
  6870. entity=None,
  6871. subscriptable=None,
  6872. key=None,
  6873. ),
  6874. 9223372036854775909,
  6875. ],
  6876. alias=None,
  6877. ),
  6878. ],
  6879. alias=None,
  6880. ),
  6881. 60.0,
  6882. ],
  6883. alias="tps_60",
  6884. )
  6885. ],
  6886. groupby=[
  6887. Function(
  6888. function="toStartOfInterval",
  6889. initializers=None,
  6890. parameters=[
  6891. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6892. Function(
  6893. function="toIntervalSecond",
  6894. initializers=None,
  6895. parameters=[60],
  6896. alias=None,
  6897. ),
  6898. "Universal",
  6899. ],
  6900. alias="time",
  6901. )
  6902. ],
  6903. array_join=None,
  6904. where=[
  6905. Condition(
  6906. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6907. op=Op.GTE,
  6908. rhs=datetime.datetime(2022, 6, 21, 10, 0),
  6909. ),
  6910. Condition(
  6911. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6912. op=Op.LT,
  6913. rhs=datetime.datetime(2022, 6, 21, 10, 6),
  6914. ),
  6915. Condition(
  6916. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  6917. op=Op.IN,
  6918. rhs=[13],
  6919. ),
  6920. Condition(
  6921. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  6922. op=Op.EQ,
  6923. rhs=13,
  6924. ),
  6925. Condition(
  6926. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  6927. op=Op.IN,
  6928. rhs=[9223372036854775909],
  6929. ),
  6930. ],
  6931. having=[],
  6932. orderby=[
  6933. OrderBy(
  6934. exp=Function(
  6935. function="toStartOfInterval",
  6936. initializers=None,
  6937. parameters=[
  6938. Column(name="timestamp", entity=None, subscriptable=None, key=None),
  6939. Function(
  6940. function="toIntervalSecond",
  6941. initializers=None,
  6942. parameters=[60],
  6943. alias=None,
  6944. ),
  6945. "Universal",
  6946. ],
  6947. alias="time",
  6948. ),
  6949. direction=Direction.ASC,
  6950. )
  6951. ],
  6952. limitby=None,
  6953. limit=Limit(limit=50),
  6954. offset=None,
  6955. granularity=Granularity(granularity=10),
  6956. totals=None,
  6957. ),
  6958. ]
  6959. histogram_queries = [
  6960. {
  6961. "match": Entity("metrics_distributions"),
  6962. "select": [
  6963. Function(
  6964. function="arrayElement",
  6965. initializers=None,
  6966. parameters=[
  6967. Function(
  6968. function="quantilesIf(0.75)",
  6969. initializers=None,
  6970. parameters=[
  6971. Column(name="value", entity=None, subscriptable=None, key=None),
  6972. Function(
  6973. function="equals",
  6974. initializers=None,
  6975. parameters=[
  6976. Column(
  6977. name="metric_id", entity=None, subscriptable=None, key=None
  6978. ),
  6979. 9223372036854775909,
  6980. ],
  6981. alias=None,
  6982. ),
  6983. ],
  6984. alias=None,
  6985. ),
  6986. 1,
  6987. ],
  6988. alias="percentile_transaction_duration_0_75",
  6989. ),
  6990. Function(
  6991. function="arrayElement",
  6992. initializers=None,
  6993. parameters=[
  6994. Function(
  6995. function="quantilesIf(0.25)",
  6996. initializers=None,
  6997. parameters=[
  6998. Column(name="value", entity=None, subscriptable=None, key=None),
  6999. Function(
  7000. function="equals",
  7001. initializers=None,
  7002. parameters=[
  7003. Column(
  7004. name="metric_id", entity=None, subscriptable=None, key=None
  7005. ),
  7006. 9223372036854775909,
  7007. ],
  7008. alias=None,
  7009. ),
  7010. ],
  7011. alias=None,
  7012. ),
  7013. 1,
  7014. ],
  7015. alias="percentile_transaction_duration_0_25",
  7016. ),
  7017. Function(
  7018. function="maxIf",
  7019. initializers=None,
  7020. parameters=[
  7021. Column(name="value", entity=None, subscriptable=None, key=None),
  7022. Function(
  7023. function="equals",
  7024. initializers=None,
  7025. parameters=[
  7026. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7027. 9223372036854775909,
  7028. ],
  7029. alias=None,
  7030. ),
  7031. ],
  7032. alias="max_transaction_duration",
  7033. ),
  7034. Function(
  7035. function="minIf",
  7036. initializers=None,
  7037. parameters=[
  7038. Column(name="value", entity=None, subscriptable=None, key=None),
  7039. Function(
  7040. function="equals",
  7041. initializers=None,
  7042. parameters=[
  7043. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7044. 9223372036854775909,
  7045. ],
  7046. alias=None,
  7047. ),
  7048. ],
  7049. alias="min_transaction_duration",
  7050. ),
  7051. ],
  7052. "groupby": [],
  7053. "array_join": None,
  7054. "where": [
  7055. Condition(
  7056. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7057. op=Op.GTE,
  7058. rhs=datetime.datetime(2022, 3, 24, 14, 52, 58, 52294),
  7059. ),
  7060. Condition(
  7061. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7062. op=Op.LT,
  7063. rhs=datetime.datetime(2022, 6, 22, 14, 52, 58, 52294),
  7064. ),
  7065. Condition(
  7066. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  7067. op=Op.IN,
  7068. rhs=[2],
  7069. ),
  7070. Condition(
  7071. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  7072. op=Op.EQ,
  7073. rhs=2,
  7074. ),
  7075. Condition(
  7076. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7077. op=Op.IN,
  7078. rhs=[9223372036854775909],
  7079. ),
  7080. ],
  7081. "having": [],
  7082. "orderby": [],
  7083. "limitby": None,
  7084. "limit": Limit(limit=1),
  7085. "offset": None,
  7086. "granularity": None,
  7087. "totals": None,
  7088. },
  7089. {
  7090. "match": Entity("metrics_distributions"),
  7091. "select": [
  7092. Function(
  7093. function="histogramIf(5)",
  7094. initializers=None,
  7095. parameters=[
  7096. Column(name="value", entity=None, subscriptable=None, key=None),
  7097. Function(
  7098. function="and",
  7099. initializers=None,
  7100. parameters=[
  7101. Function(
  7102. function="and",
  7103. initializers=None,
  7104. parameters=[
  7105. Function(
  7106. function="greaterOrEquals",
  7107. initializers=None,
  7108. parameters=[
  7109. Function(
  7110. function="arrayReduce",
  7111. initializers=None,
  7112. parameters=[
  7113. "maxMerge",
  7114. [
  7115. Column(
  7116. name="max",
  7117. entity=None,
  7118. subscriptable=None,
  7119. key=None,
  7120. )
  7121. ],
  7122. ],
  7123. alias=None,
  7124. ),
  7125. 0,
  7126. ],
  7127. alias=None,
  7128. ),
  7129. Function(
  7130. function="lessOrEquals",
  7131. initializers=None,
  7132. parameters=[
  7133. Function(
  7134. function="arrayReduce",
  7135. initializers=None,
  7136. parameters=[
  7137. "minMerge",
  7138. [
  7139. Column(
  7140. name="min",
  7141. entity=None,
  7142. subscriptable=None,
  7143. key=None,
  7144. )
  7145. ],
  7146. ],
  7147. alias=None,
  7148. ),
  7149. 5,
  7150. ],
  7151. alias=None,
  7152. ),
  7153. ],
  7154. alias=None,
  7155. ),
  7156. Function(
  7157. function="equals",
  7158. initializers=None,
  7159. parameters=[
  7160. Column(
  7161. name="metric_id", entity=None, subscriptable=None, key=None
  7162. ),
  7163. 9223372036854775909,
  7164. ],
  7165. alias=None,
  7166. ),
  7167. ],
  7168. alias=None,
  7169. ),
  7170. ],
  7171. alias="histogram_transaction_duration",
  7172. )
  7173. ],
  7174. "groupby": [],
  7175. "array_join": None,
  7176. "where": [
  7177. Condition(
  7178. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7179. op=Op.GTE,
  7180. rhs=datetime.datetime(2022, 3, 24, 14, 52, 58, 52294),
  7181. ),
  7182. Condition(
  7183. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7184. op=Op.LT,
  7185. rhs=datetime.datetime(2022, 6, 22, 14, 52, 58, 52294),
  7186. ),
  7187. Condition(
  7188. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  7189. op=Op.IN,
  7190. rhs=[2],
  7191. ),
  7192. Condition(
  7193. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  7194. op=Op.EQ,
  7195. rhs=2,
  7196. ),
  7197. Condition(
  7198. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7199. op=Op.IN,
  7200. rhs=[9223372036854775909],
  7201. ),
  7202. ],
  7203. "having": [],
  7204. "orderby": [],
  7205. "limitby": None,
  7206. "limit": Limit(limit=50),
  7207. "offset": Offset(offset=0),
  7208. "granularity": None,
  7209. "totals": None,
  7210. },
  7211. {
  7212. "match": Entity("metrics_distributions"),
  7213. "select": [
  7214. Function(
  7215. function="maxIf",
  7216. initializers=None,
  7217. parameters=[
  7218. Column(name="value", entity=None, subscriptable=None, key=None),
  7219. Function(
  7220. function="equals",
  7221. initializers=None,
  7222. parameters=[
  7223. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7224. 9223372036854775909,
  7225. ],
  7226. alias=None,
  7227. ),
  7228. ],
  7229. alias="max_transaction_duration",
  7230. ),
  7231. Function(
  7232. function="minIf",
  7233. initializers=None,
  7234. parameters=[
  7235. Column(name="value", entity=None, subscriptable=None, key=None),
  7236. Function(
  7237. function="equals",
  7238. initializers=None,
  7239. parameters=[
  7240. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7241. 9223372036854775909,
  7242. ],
  7243. alias=None,
  7244. ),
  7245. ],
  7246. alias="min_transaction_duration",
  7247. ),
  7248. ],
  7249. "groupby": [],
  7250. "array_join": None,
  7251. "where": [
  7252. Condition(
  7253. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7254. op=Op.GTE,
  7255. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 179755),
  7256. ),
  7257. Condition(
  7258. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7259. op=Op.LT,
  7260. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 179755),
  7261. ),
  7262. Condition(
  7263. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  7264. op=Op.IN,
  7265. rhs=[3],
  7266. ),
  7267. Condition(
  7268. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  7269. op=Op.EQ,
  7270. rhs=3,
  7271. ),
  7272. Condition(
  7273. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7274. op=Op.IN,
  7275. rhs=[9223372036854775909],
  7276. ),
  7277. ],
  7278. "having": [],
  7279. "orderby": [],
  7280. "limitby": None,
  7281. "limit": Limit(limit=1),
  7282. "offset": None,
  7283. "granularity": None,
  7284. "totals": None,
  7285. },
  7286. {
  7287. "match": Entity("metrics_distributions"),
  7288. "select": [
  7289. Function(
  7290. function="histogramIf(5)",
  7291. initializers=None,
  7292. parameters=[
  7293. Column(name="value", entity=None, subscriptable=None, key=None),
  7294. Function(
  7295. function="and",
  7296. initializers=None,
  7297. parameters=[
  7298. Function(
  7299. function="and",
  7300. initializers=None,
  7301. parameters=[
  7302. Function(
  7303. function="greaterOrEquals",
  7304. initializers=None,
  7305. parameters=[
  7306. Function(
  7307. function="arrayReduce",
  7308. initializers=None,
  7309. parameters=[
  7310. "maxMerge",
  7311. [
  7312. Column(
  7313. name="max",
  7314. entity=None,
  7315. subscriptable=None,
  7316. key=None,
  7317. )
  7318. ],
  7319. ],
  7320. alias=None,
  7321. ),
  7322. 0,
  7323. ],
  7324. alias=None,
  7325. ),
  7326. Function(
  7327. function="lessOrEquals",
  7328. initializers=None,
  7329. parameters=[
  7330. Function(
  7331. function="arrayReduce",
  7332. initializers=None,
  7333. parameters=[
  7334. "minMerge",
  7335. [
  7336. Column(
  7337. name="min",
  7338. entity=None,
  7339. subscriptable=None,
  7340. key=None,
  7341. )
  7342. ],
  7343. ],
  7344. alias=None,
  7345. ),
  7346. 5,
  7347. ],
  7348. alias=None,
  7349. ),
  7350. ],
  7351. alias=None,
  7352. ),
  7353. Function(
  7354. function="equals",
  7355. initializers=None,
  7356. parameters=[
  7357. Column(
  7358. name="metric_id", entity=None, subscriptable=None, key=None
  7359. ),
  7360. 9223372036854775909,
  7361. ],
  7362. alias=None,
  7363. ),
  7364. ],
  7365. alias=None,
  7366. ),
  7367. ],
  7368. alias="histogram_transaction_duration",
  7369. )
  7370. ],
  7371. "groupby": [],
  7372. "array_join": None,
  7373. "where": [
  7374. Condition(
  7375. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7376. op=Op.GTE,
  7377. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 179755),
  7378. ),
  7379. Condition(
  7380. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7381. op=Op.LT,
  7382. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 179755),
  7383. ),
  7384. Condition(
  7385. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  7386. op=Op.IN,
  7387. rhs=[3],
  7388. ),
  7389. Condition(
  7390. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  7391. op=Op.EQ,
  7392. rhs=3,
  7393. ),
  7394. Condition(
  7395. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7396. op=Op.IN,
  7397. rhs=[9223372036854775909],
  7398. ),
  7399. ],
  7400. "having": [],
  7401. "orderby": [],
  7402. "limitby": None,
  7403. "limit": Limit(limit=50),
  7404. "offset": Offset(offset=0),
  7405. "granularity": None,
  7406. "totals": None,
  7407. },
  7408. {
  7409. "match": Entity("metrics_distributions"),
  7410. "select": [
  7411. Function(
  7412. function="maxIf",
  7413. initializers=None,
  7414. parameters=[
  7415. Column(name="value", entity=None, subscriptable=None, key=None),
  7416. Function(
  7417. function="equals",
  7418. initializers=None,
  7419. parameters=[
  7420. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7421. 9223372036854775911,
  7422. ],
  7423. alias=None,
  7424. ),
  7425. ],
  7426. alias="max_measurements_lcp",
  7427. ),
  7428. Function(
  7429. function="minIf",
  7430. initializers=None,
  7431. parameters=[
  7432. Column(name="value", entity=None, subscriptable=None, key=None),
  7433. Function(
  7434. function="equals",
  7435. initializers=None,
  7436. parameters=[
  7437. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7438. 9223372036854775911,
  7439. ],
  7440. alias=None,
  7441. ),
  7442. ],
  7443. alias="min_measurements_lcp",
  7444. ),
  7445. Function(
  7446. function="minIf",
  7447. initializers=None,
  7448. parameters=[
  7449. Column(name="value", entity=None, subscriptable=None, key=None),
  7450. Function(
  7451. function="equals",
  7452. initializers=None,
  7453. parameters=[
  7454. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7455. 9223372036854775910,
  7456. ],
  7457. alias=None,
  7458. ),
  7459. ],
  7460. alias="min_measurements_fcp",
  7461. ),
  7462. Function(
  7463. function="maxIf",
  7464. initializers=None,
  7465. parameters=[
  7466. Column(name="value", entity=None, subscriptable=None, key=None),
  7467. Function(
  7468. function="equals",
  7469. initializers=None,
  7470. parameters=[
  7471. Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7472. 9223372036854775910,
  7473. ],
  7474. alias=None,
  7475. ),
  7476. ],
  7477. alias="max_measurements_fcp",
  7478. ),
  7479. ],
  7480. "groupby": [],
  7481. "array_join": None,
  7482. "where": [
  7483. Condition(
  7484. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7485. op=Op.GTE,
  7486. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 880411),
  7487. ),
  7488. Condition(
  7489. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7490. op=Op.LT,
  7491. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 880411),
  7492. ),
  7493. Condition(
  7494. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  7495. op=Op.IN,
  7496. rhs=[4],
  7497. ),
  7498. Condition(
  7499. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  7500. op=Op.EQ,
  7501. rhs=4,
  7502. ),
  7503. Condition(
  7504. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7505. op=Op.IN,
  7506. rhs=[9223372036854775910, 9223372036854775911],
  7507. ),
  7508. ],
  7509. "having": [],
  7510. "orderby": [],
  7511. "limitby": None,
  7512. "limit": Limit(limit=1),
  7513. "offset": None,
  7514. "granularity": None,
  7515. "totals": None,
  7516. },
  7517. {
  7518. "match": Entity("metrics_distributions"),
  7519. "select": [
  7520. Function(
  7521. function="histogramIf(2)",
  7522. initializers=None,
  7523. parameters=[
  7524. Column(name="value", entity=None, subscriptable=None, key=None),
  7525. Function(
  7526. function="and",
  7527. initializers=None,
  7528. parameters=[
  7529. Function(
  7530. function="and",
  7531. initializers=None,
  7532. parameters=[
  7533. Function(
  7534. function="greaterOrEquals",
  7535. initializers=None,
  7536. parameters=[
  7537. Function(
  7538. function="arrayReduce",
  7539. initializers=None,
  7540. parameters=[
  7541. "maxMerge",
  7542. [
  7543. Column(
  7544. name="max",
  7545. entity=None,
  7546. subscriptable=None,
  7547. key=None,
  7548. )
  7549. ],
  7550. ],
  7551. alias=None,
  7552. ),
  7553. 0,
  7554. ],
  7555. alias=None,
  7556. ),
  7557. Function(
  7558. function="lessOrEquals",
  7559. initializers=None,
  7560. parameters=[
  7561. Function(
  7562. function="arrayReduce",
  7563. initializers=None,
  7564. parameters=[
  7565. "minMerge",
  7566. [
  7567. Column(
  7568. name="min",
  7569. entity=None,
  7570. subscriptable=None,
  7571. key=None,
  7572. )
  7573. ],
  7574. ],
  7575. alias=None,
  7576. ),
  7577. 2,
  7578. ],
  7579. alias=None,
  7580. ),
  7581. ],
  7582. alias=None,
  7583. ),
  7584. Function(
  7585. function="equals",
  7586. initializers=None,
  7587. parameters=[
  7588. Column(
  7589. name="metric_id", entity=None, subscriptable=None, key=None
  7590. ),
  7591. 9223372036854775910,
  7592. ],
  7593. alias=None,
  7594. ),
  7595. ],
  7596. alias=None,
  7597. ),
  7598. ],
  7599. alias="histogram_measurements_fcp",
  7600. ),
  7601. Function(
  7602. function="histogramIf(2)",
  7603. initializers=None,
  7604. parameters=[
  7605. Column(name="value", entity=None, subscriptable=None, key=None),
  7606. Function(
  7607. function="and",
  7608. initializers=None,
  7609. parameters=[
  7610. Function(
  7611. function="and",
  7612. initializers=None,
  7613. parameters=[
  7614. Function(
  7615. function="greaterOrEquals",
  7616. initializers=None,
  7617. parameters=[
  7618. Function(
  7619. function="arrayReduce",
  7620. initializers=None,
  7621. parameters=[
  7622. "maxMerge",
  7623. [
  7624. Column(
  7625. name="max",
  7626. entity=None,
  7627. subscriptable=None,
  7628. key=None,
  7629. )
  7630. ],
  7631. ],
  7632. alias=None,
  7633. ),
  7634. 0,
  7635. ],
  7636. alias=None,
  7637. ),
  7638. Function(
  7639. function="lessOrEquals",
  7640. initializers=None,
  7641. parameters=[
  7642. Function(
  7643. function="arrayReduce",
  7644. initializers=None,
  7645. parameters=[
  7646. "minMerge",
  7647. [
  7648. Column(
  7649. name="min",
  7650. entity=None,
  7651. subscriptable=None,
  7652. key=None,
  7653. )
  7654. ],
  7655. ],
  7656. alias=None,
  7657. ),
  7658. 2,
  7659. ],
  7660. alias=None,
  7661. ),
  7662. ],
  7663. alias=None,
  7664. ),
  7665. Function(
  7666. function="equals",
  7667. initializers=None,
  7668. parameters=[
  7669. Column(
  7670. name="metric_id", entity=None, subscriptable=None, key=None
  7671. ),
  7672. 9223372036854775911,
  7673. ],
  7674. alias=None,
  7675. ),
  7676. ],
  7677. alias=None,
  7678. ),
  7679. ],
  7680. alias="histogram_measurements_lcp",
  7681. ),
  7682. ],
  7683. "groupby": [],
  7684. "array_join": None,
  7685. "where": [
  7686. Condition(
  7687. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7688. op=Op.GTE,
  7689. rhs=datetime.datetime(2022, 3, 24, 14, 52, 59, 880411),
  7690. ),
  7691. Condition(
  7692. lhs=Column(name="timestamp", entity=None, subscriptable=None, key=None),
  7693. op=Op.LT,
  7694. rhs=datetime.datetime(2022, 6, 22, 14, 52, 59, 880411),
  7695. ),
  7696. Condition(
  7697. lhs=Column(name="project_id", entity=None, subscriptable=None, key=None),
  7698. op=Op.IN,
  7699. rhs=[4],
  7700. ),
  7701. Condition(
  7702. lhs=Column(name="org_id", entity=None, subscriptable=None, key=None),
  7703. op=Op.EQ,
  7704. rhs=4,
  7705. ),
  7706. Condition(
  7707. lhs=Column(name="metric_id", entity=None, subscriptable=None, key=None),
  7708. op=Op.IN,
  7709. rhs=[9223372036854775910, 9223372036854775911],
  7710. ),
  7711. ],
  7712. "having": [],
  7713. "orderby": [],
  7714. "limitby": None,
  7715. "limit": Limit(limit=50),
  7716. "offset": Offset(offset=0),
  7717. "granularity": None,
  7718. "totals": None,
  7719. },
  7720. ]