UNPKG

trakk-js

Version:

Automatic Documentation Generation - Real-Time Code Execution Flow - Testing / Debugging - Onboarding - for Front-End Applications

1 lines 11.9 kB
function _0x5d87(){const _0x200fa6=['userInteractions','Slowest\x20request\x20loop','duration','zEvUl','Requests','44bNIAeM','functionCalls','jeBeb','requests','Most\x20frequent\x20function\x20call','split','854135qhTFSf','total','filter','11647BGxTBj','Slowest\x20function\x20loop','Total\x20number\x20of\x20function\x20calls\x20-\x20without\x20uncaught\x20errors','142070eEzELM','Most\x20looped\x20request','User\x20Interactions','Uncaught\x20Errors','bPNrZ','push','946296xFVoPG','Most\x20frequent\x20request','YMsHT','request','Fastest\x20request\x20loop','ndAtA','event','bPNbJ','frequency','values','find','4|3|0|1|2','iKgry','18nqLwzW','uncaughtErrors','1876437AuZnMH','slowest','all','Fastest\x20function\x20loop','HniEt','functions','2117080KdpPRm','paGap','kURNr','182952CiPnaX','user','forEach','TxfnL','Most\x20frequent\x20uncaught\x20error','HiNRb','16xZLazr','Total\x20number\x20of\x20function\x20calls\x20-\x20with\x20uncaught\x20errors','fastest','function','keys','cuWSQ','uuid','Most\x20frequent\x20user\x20interaction','length','uncaught','timesCalled','reduce','Most\x20looped\x20function'];_0x5d87=function(){return _0x200fa6;};return _0x5d87();}(function(_0x24716a,_0x451f08){const _0x2314dd=_0x2c85,_0x372cec=_0x24716a();while(!![]){try{const _0x3ce1d8=-parseInt(_0x2314dd(0x1c8))/0x1*(parseInt(_0x2314dd(0x1ad))/0x2)+parseInt(_0x2314dd(0x1a7))/0x3*(-parseInt(_0x2314dd(0x1bf))/0x4)+-parseInt(_0x2314dd(0x1c5))/0x5*(-parseInt(_0x2314dd(0x19c))/0x6)+parseInt(_0x2314dd(0x1a4))/0x7+parseInt(_0x2314dd(0x18f))/0x8+parseInt(_0x2314dd(0x19e))/0x9+parseInt(_0x2314dd(0x1cb))/0xa;if(_0x3ce1d8===_0x451f08)break;else _0x372cec['push'](_0x372cec['shift']());}catch(_0x246b3d){_0x372cec['push'](_0x372cec['shift']());}}}(_0x5d87,0x5fae4));function getMostFrequent(_0xb2ff71={}){const _0x372835=_0x2c85,_0x34ebfc={'bPNrZ':function(_0x220d3d,_0x2b6fde){return _0x220d3d!==_0x2b6fde;}},_0x46c9bb=Object[_0x372835(0x1b1)](_0xb2ff71)[_0x372835(0x1b8)]((_0x2cc65a,_0x466f8e)=>{const _0x280879=_0x372835,_0x37f2a6=_0xb2ff71[_0x466f8e];if(_0x37f2a6>_0x2cc65a[_0x280879(0x197)])return{'id':_0x466f8e,'frequency':_0x37f2a6};return _0x2cc65a;},{'id':undefined,'frequency':0x0}),_0x419920=Object[_0x372835(0x198)](_0xb2ff71)[_0x372835(0x1c7)](_0x565671=>_0x565671===_0x46c9bb[_0x372835(0x197)])[_0x372835(0x1b5)];if(_0x34ebfc[_0x372835(0x1cf)](_0x419920,0x1))return{'id':undefined,'frequency':undefined};return _0x46c9bb;}function getMostLooped(_0x3d816f={}){const _0x2c11c6=_0x2c85,_0x59e88e={'iKgry':function(_0x3f08c7,_0x4da3e6){return _0x3f08c7>_0x4da3e6;},'HiNRb':function(_0x1e4148,_0x244e34){return _0x1e4148!==_0x244e34;}},_0x1bde66=Object[_0x2c11c6(0x1b1)](_0x3d816f)[_0x2c11c6(0x1b8)]((_0x4b991e,_0x315fc0)=>{const _0x366246=_0x2c11c6,_0x2647d0=_0x3d816f[_0x315fc0];if(_0x59e88e[_0x366246(0x19b)](_0x2647d0,_0x4b991e[_0x366246(0x1b7)]))return{'id':_0x315fc0,'timesCalled':_0x2647d0};return _0x4b991e;},{'id':undefined,'timesCalled':0x0}),_0x2f55c8=Object[_0x2c11c6(0x198)](_0x3d816f)[_0x2c11c6(0x1c7)](_0x247d43=>_0x247d43===_0x1bde66['timesCalled'])['length'];if(_0x59e88e[_0x2c11c6(0x1ac)](_0x2f55c8,0x1))return{'id':undefined,'timesCalled':undefined};return _0x1bde66;}function _0x2c85(_0x1a04d8,_0x520198){const _0x5d8711=_0x5d87();return _0x2c85=function(_0x2c8551,_0x16847d){_0x2c8551=_0x2c8551-0x18f;let _0x56c03e=_0x5d8711[_0x2c8551];return _0x56c03e;},_0x2c85(_0x1a04d8,_0x520198);}function getLogAndIndex({match:_0x11b979,logs:_0x5b3059,type:_0x13cb0d}){const _0x407f6e=_0x2c85,_0x322314={'dykHX':function(_0x2c9258,_0x629ba2){return _0x2c9258===_0x629ba2;}};let _0x3ffff3=undefined;const _0x377050=_0x11b979?.['id']?_0x5b3059[_0x407f6e(0x199)]((_0x6e6a7a,_0x510da5)=>{const _0xcdbd13=_0x407f6e;let _0x43afb8=_0x6e6a7a[_0xcdbd13(0x1b3)]&&_0x322314['dykHX'](_0x6e6a7a['uuid'],_0x11b979['id']);_0x322314['dykHX'](_0x13cb0d,_0xcdbd13(0x1b6))&&(_0x43afb8=_0x6e6a7a['error']&&_0x6e6a7a['uuid']&&_0x6e6a7a[_0xcdbd13(0x1b3)]===_0x11b979['id']);if(_0x43afb8)return _0x3ffff3=_0x510da5,!![];return![];}):undefined;return{'log':_0x377050,'index':_0x3ffff3,'stat':_0x11b979};}export default function ({logs,totalCount}){const _0x534a35=_0x2c85,TEpwYT={'cuWSQ':function(x,y){return x-y;},'cPTEw':function(x,y){return x===y;},'jeBeb':function(x,y){return x+y;},'zEvUl':_0x534a35(0x192),'HniEt':_0x534a35(0x19a),'TxfnL':function(x,y){return x<y;},'IDabI':function(x,y){return x>y;},'jJkIL':function(x,y){return x||y;},'ndAtA':_0x534a35(0x1b0),'bPNbJ':function(x,y){return x||y;},'YMsHT':function(x,y){return x+y;},'MrVTW':function(x,y){return x>=y;},'paGap':function(x,y){return x>y;},'kURNr':function(x,y){return x||y;}};let userInteractionsCount=0x0,requestsCount=0x0,functionCallsCount=0x0,uncaughtErrorsCount=0x0;const frequency={'requests':{},'functionCalls':{},'userInteractions':{},'uncaughtErrors':{}},loopDurations={'requests':{'slowest':{},'fastest':{},'all':[]},'functionCalls':{'slowest':{},'fastest':{},'all':[]}},looped={'requests':{},'functionCalls':{},'uncaughtErrors':{}},totalsMap={'requests':{},'functions':{},'userInteractions':{},'uncaughtErrors':{}};logs[_0x534a35(0x1a9)](log=>{const _0x26ce34=_0x534a35,{type:type,uuid:uuid,timesCalled:timesCalled,error:error,timestamp:timestamp,lastTimeCalled:lastTimeCalled}=log,loopDuration=lastTimeCalled?TEpwYT[_0x26ce34(0x1b2)](lastTimeCalled,timestamp):undefined;if(TEpwYT['cPTEw'](type,_0x26ce34(0x195)))userInteractionsCount++,frequency[_0x26ce34(0x1ba)][uuid]=TEpwYT[_0x26ce34(0x1c1)](frequency[_0x26ce34(0x1ba)][uuid]||0x0,0x1),totalsMap[_0x26ce34(0x1ba)][uuid]=totalsMap[_0x26ce34(0x1ba)][uuid]||{'total':0x0,'log':log},totalsMap['userInteractions'][uuid]['total']+=0x1;else{if(type===TEpwYT[_0x26ce34(0x1bd)]){const GCZxcg=TEpwYT[_0x26ce34(0x1a2)][_0x26ce34(0x1c4)]('|');let ioExWn=0x0;while(!![]){switch(GCZxcg[ioExWn++]){case'0':loopDuration>=0x0&&(loopDurations[_0x26ce34(0x1c2)][_0x26ce34(0x1a0)][_0x26ce34(0x1d0)](loopDuration),(!loopDurations['requests'][_0x26ce34(0x1af)]['id']||TEpwYT[_0x26ce34(0x1aa)](loopDuration,loopDurations[_0x26ce34(0x1c2)][_0x26ce34(0x1af)][_0x26ce34(0x1bc)]))&&(loopDurations[_0x26ce34(0x1c2)]['fastest']={'id':uuid,'duration':loopDuration}),(!loopDurations[_0x26ce34(0x1c2)][_0x26ce34(0x19f)]['id']||TEpwYT['IDabI'](loopDuration,loopDurations[_0x26ce34(0x1c2)][_0x26ce34(0x19f)][_0x26ce34(0x1bc)]))&&(loopDurations['requests'][_0x26ce34(0x19f)]={'id':uuid,'duration':loopDuration}),looped[_0x26ce34(0x1c2)][uuid]=(looped[_0x26ce34(0x1c2)][uuid]||0x0)+timesCalled);continue;case'1':totalsMap[_0x26ce34(0x1c2)][uuid]=totalsMap[_0x26ce34(0x1c2)][uuid]||{'total':0x0,'log':log};continue;case'2':totalsMap['requests'][uuid][_0x26ce34(0x1c6)]+=0x1;continue;case'3':frequency['requests'][uuid]=TEpwYT[_0x26ce34(0x1c1)](frequency[_0x26ce34(0x1c2)][uuid]||0x0,timesCalled||0x1);continue;case'4':requestsCount+=TEpwYT['jJkIL'](timesCalled,0x1);continue;}break;}}else type===TEpwYT[_0x26ce34(0x194)]&&(functionCallsCount+=TEpwYT[_0x26ce34(0x196)](timesCalled,0x1),frequency[_0x26ce34(0x1c0)][uuid]=TEpwYT[_0x26ce34(0x191)](frequency[_0x26ce34(0x1c0)][uuid]||0x0,timesCalled||0x1),TEpwYT['MrVTW'](loopDuration,0x0)&&(loopDurations[_0x26ce34(0x1c0)]['all'][_0x26ce34(0x1d0)](loopDuration),(!loopDurations['functionCalls'][_0x26ce34(0x1af)]['id']||TEpwYT[_0x26ce34(0x1aa)](loopDuration,loopDurations[_0x26ce34(0x1c0)]['fastest'][_0x26ce34(0x1bc)]))&&(loopDurations[_0x26ce34(0x1c0)][_0x26ce34(0x1af)]={'id':uuid,'duration':loopDuration}),(!loopDurations[_0x26ce34(0x1c0)]['slowest']['id']||TEpwYT[_0x26ce34(0x1a5)](loopDuration,loopDurations[_0x26ce34(0x1c0)][_0x26ce34(0x19f)][_0x26ce34(0x1bc)]))&&(loopDurations[_0x26ce34(0x1c0)][_0x26ce34(0x19f)]={'id':uuid,'duration':loopDuration}),looped['functionCalls'][uuid]=TEpwYT['jeBeb'](looped[_0x26ce34(0x1c0)][uuid]||0x0,timesCalled)),totalsMap[_0x26ce34(0x1a3)][uuid]=totalsMap[_0x26ce34(0x1a3)][uuid]||{'total':0x0,'log':log},totalsMap[_0x26ce34(0x1a3)][uuid]['total']+=0x1,error&&(uncaughtErrorsCount+=TEpwYT['kURNr'](timesCalled,0x1),frequency[_0x26ce34(0x19d)][uuid]=TEpwYT['YMsHT'](frequency[_0x26ce34(0x19d)][uuid]||0x0,TEpwYT[_0x26ce34(0x1a6)](timesCalled,0x1)),totalsMap[_0x26ce34(0x19d)][uuid]=totalsMap['uncaughtErrors'][uuid]||{'total':0x0,'log':log},totalsMap[_0x26ce34(0x19d)][uuid][_0x26ce34(0x1c6)]+=0x1));}});const slowestRequestLoopDuration=loopDurations['requests'][_0x534a35(0x19f)]['duration'],slowestRequestLoopDurationMatches=loopDurations[_0x534a35(0x1c2)]['all']['filter'](duration=>duration===slowestRequestLoopDuration)[_0x534a35(0x1b5)];slowestRequestLoopDurationMatches!==0x1&&(loopDurations[_0x534a35(0x1c2)][_0x534a35(0x19f)]={'id':undefined,'duration':undefined});const fastestRequestLoopDuration=loopDurations[_0x534a35(0x1c2)][_0x534a35(0x1af)][_0x534a35(0x1bc)],fastestRequestLoopDurationMatches=loopDurations['requests'][_0x534a35(0x1a0)]['filter'](duration=>duration===fastestRequestLoopDuration)[_0x534a35(0x1b5)];fastestRequestLoopDurationMatches!==0x1&&(loopDurations[_0x534a35(0x1c2)][_0x534a35(0x1af)]={'id':undefined,'duration':undefined});const slowestFunctionLoopDuration=loopDurations[_0x534a35(0x1c0)][_0x534a35(0x19f)]['duration'],slowestFunctionLoopDurationMatches=loopDurations['functionCalls'][_0x534a35(0x1a0)][_0x534a35(0x1c7)](duration=>duration===slowestFunctionLoopDuration)[_0x534a35(0x1b5)];slowestFunctionLoopDurationMatches!==0x1&&(loopDurations[_0x534a35(0x1c0)]['slowest']={'id':undefined,'duration':undefined});const fastestFunctionLoopDuration=loopDurations[_0x534a35(0x1c0)]['fastest'][_0x534a35(0x1bc)],fastestFunctionLoopDurationMatches=loopDurations['functionCalls'][_0x534a35(0x1a0)][_0x534a35(0x1c7)](duration=>duration===fastestFunctionLoopDuration)[_0x534a35(0x1b5)];fastestFunctionLoopDurationMatches!==0x1&&(loopDurations['functionCalls'][_0x534a35(0x1af)]={'id':undefined,'duration':undefined});const stats=[{'statLabel':_0x534a35(0x1b4),...getLogAndIndex({'match':getMostFrequent(frequency[_0x534a35(0x1ba)]),'type':_0x534a35(0x1a8),'logs':logs})},{'statLabel':_0x534a35(0x1c3),...getLogAndIndex({'match':getMostFrequent(frequency[_0x534a35(0x1c0)]),'type':_0x534a35(0x1b0),'logs':logs})},{'statLabel':_0x534a35(0x190),...getLogAndIndex({'match':getMostFrequent(frequency[_0x534a35(0x1c2)]),'type':'request','logs':logs})},{'statLabel':_0x534a35(0x1ab),...getLogAndIndex({'match':getMostFrequent(frequency[_0x534a35(0x19d)]),'type':_0x534a35(0x1b6),'logs':logs})},{'statLabel':_0x534a35(0x193),...getLogAndIndex({'match':loopDurations[_0x534a35(0x1c2)][_0x534a35(0x1af)],'type':'request','logs':logs})},{'statLabel':_0x534a35(0x1a1),...getLogAndIndex({'match':loopDurations[_0x534a35(0x1c0)][_0x534a35(0x1af)],'type':'function','logs':logs})},{'statLabel':_0x534a35(0x1bb),...getLogAndIndex({'match':loopDurations[_0x534a35(0x1c2)]['slowest'],'type':_0x534a35(0x192),'logs':logs})},{'statLabel':_0x534a35(0x1c9),...getLogAndIndex({'match':loopDurations[_0x534a35(0x1c0)]['slowest'],'type':'function','logs':logs})},{'statLabel':_0x534a35(0x1cc),...getLogAndIndex({'match':getMostLooped(looped[_0x534a35(0x1c2)]),'type':_0x534a35(0x192),'logs':logs})},{'statLabel':_0x534a35(0x1b9),...getLogAndIndex({'match':getMostLooped(looped[_0x534a35(0x1c0)]),'type':'function','logs':logs})},{'statLabel':'Function\x20Calls','repeats':Object['values'](totalsMap[_0x534a35(0x1a3)])},{'statLabel':_0x534a35(0x1be),'repeats':Object[_0x534a35(0x198)](totalsMap[_0x534a35(0x1c2)])},{'statLabel':_0x534a35(0x1cd),'repeats':Object[_0x534a35(0x198)](totalsMap['userInteractions'])},{'statLabel':_0x534a35(0x1ce),'repeats':Object[_0x534a35(0x198)](totalsMap[_0x534a35(0x19d)])}],totals=[{'label':_0x534a35(0x1ca),'count':functionCallsCount-uncaughtErrorsCount},{'label':_0x534a35(0x1ae),'count':uncaughtErrorsCount},{'label':'Total\x20number\x20of\x20user\x20interactions','count':userInteractionsCount},{'label':'Total\x20number\x20of\x20requests','count':requestsCount}];return{'stats':stats,'totals':totals,'totalCount':totalCount};}