protobuf.js 315 KB

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