@perses-dev/flame-chart-plugin 0.6.0-rc.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{FlameChart.b52b15db.js → FlameChart.8940202b.js} +2 -2
- package/__mf/js/async/{367.92d3f30c.js → 367.8beb758e.js} +6 -6
- package/__mf/js/async/546.d47a49c6.js +24 -0
- package/__mf/js/async/{__federation_expose_FlameChart.bb8321d9.js → __federation_expose_FlameChart.7a8d049a.js} +2 -2
- package/__mf/js/{main.fcd457f0.js → main.08e04feb.js} +2 -2
- package/mf-manifest.json +9 -9
- package/mf-stats.json +9 -9
- package/package.json +4 -4
- package/__mf/js/async/558.02b3aee8.js +0 -24
- /package/__mf/js/async/{367.92d3f30c.js.LICENSE.txt → 367.8beb758e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{558.02b3aee8.js.LICENSE.txt → 546.d47a49c6.js.LICENSE.txt} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";(self.chunk_FlameChart=self.chunk_FlameChart||[]).push([["628"],{49529(e,t,a){a.r(t),a.d(t,{FlameChart:()=>ea});var l=a(62540),o=a(315),n=a(82665),r=a(11061),i=a(1355),s=a(7800),d=a(47601),h=a(77308),u=a(59238),c=a(
|
|
1
|
+
"use strict";(self.chunk_FlameChart=self.chunk_FlameChart||[]).push([["628"],{49529(e,t,a){a.r(t),a.d(t,{FlameChart:()=>ea});var l=a(62540),o=a(315),n=a(82665),r=a(11061),i=a(1355),s=a(7800),d=a(47601),h=a(77308),u=a(59238),c=a(57072);let p=(0,h.A)(d.A)(e=>{let{theme:t}=e,a="light"===t.palette.mode?t.palette.grey[100]:t.palette.grey[800];return{backgroundColor:a,height:t.spacing(3),color:t.palette.text.primary,fontWeight:t.typography.fontWeightRegular,"&:hover, &:focus":{backgroundColor:(0,u.tL)(a,.06)},"&:active":{boxShadow:t.shadows[1],backgroundColor:(0,u.tL)(a,.12)}}});function m(e){var t;let{totalValue:a,totalSample:d,otherItemSample:h,onSelectedIdChange:u}=e,m=a.split("("),g=null==(t=m[m.length-1])?void 0:t.slice(0,-1),f=(0,c.formatValue)(d,{unit:"decimal",decimalPlaces:2,shortValues:!0})+" samples";return(0,l.jsx)(o.A,{direction:"row",spacing:1,minHeight:40,alignItems:"center",children:(0,l.jsxs)(n.A,{separator:(0,l.jsx)(r.default,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{justifyContent:"center"},children:[(0,l.jsx)(p,{label:g+" | "+f}),void 0!==h&&(0,l.jsx)(p,{label:(h/d*100).toFixed(2)+"% of total",icon:(0,l.jsx)(i.default,{fontSize:"small",color:"secondary"}),deleteIcon:(0,l.jsx)(s.default,{fontSize:"small"}),onDelete:e=>{e.preventDefault(),u(0)}})]})})}var g=a(56599),f=a(30145),x=a(74628),v=a(6227),b=a(97653),w=a(70451),y=a(74987),j=a(50172),C=a(92959);let S=new C.A({hue:{min:20,max:360}}),k=new C.A({hue:{min:0,max:20}}),T={},A="#dee2e6",M=["#fff85b","#ffde4c","#ffc252","#ff8c00","#f08c00","#e67762","#ff8c00","#ff6f00","#ff7070","#ff3300","#ff004c"];var F=a(40625);function I(e,t){let a="";switch(e){case"count":case"samples":case"objects":a=(0,c.formatValue)(t,{unit:"decimal",decimalPlaces:2,shortValues:!0});break;case"bytes":a=(0,c.formatValue)(t,{unit:"bytes"});break;case"nanoseconds":a=t<1e3?(0,c.formatValue)(t,{unit:"decimal",decimalPlaces:2,shortValues:!0})+"ns":t<1e6?(0,c.formatValue)(t/1e3,{unit:"decimal",decimalPlaces:2,shortValues:!0})+"μs":(0,F.formatDuration)((0,F.convertTimeToDuration)(t/1e6));break;default:a=`${t} ${e}`}return a}function $(e,t){if(void 0===t)return e;let a=(e,t)=>{if(e.id===t)return e;for(let l of e.children??[]){let o=a(l,t);if(o)return(e={...e}).children=[o],e.start=o.start,e.end=o.end,e}};return a(e,t)??e}function z(e,t){if(""===t)return!0;let a=t.trim().toLocaleLowerCase().split(/[^a-zA-Z0-9']+/).filter(e=>""!==e);return 0!==a.length&&a.every(t=>e.toLowerCase().includes(t.trim()))}var D=a(7376);function O(e){var t,a;let{width:n,height:r,data:s,palette:d,selectedId:h,searchValue:u,onSelectedIdChange:p}=e,C=(0,g.A)(),F=(0,c.useChartsTheme)(),[O,P]=(0,w.useState)(null),[V,E]=(0,w.useState)({id:0,name:""}),[G,L]=(0,w.useState)(!1),R=(0,w.useMemo)(()=>{var e,t;let a,l,o,n,r;return e=s.metadata,t=s.profile.stackTrace,a=[],o=(l=$(t,h)).total,n=function(e,t){if(void 0===t)return 0;let a=e=>{if(e.id===t)return e.total;for(let t of e.children||[]){let e=a(t);if(void 0!==e)return e}return 0};return a(e)}(l,h),r=t=>{var l,i,s,h,c;let p={name:t.id,value:[t.level,t.start,t.end,(l=n||o,i=null==e?void 0:e.units,t.total/l*100<1?"":t.name+` (${I(i,t.total)})`),t.total/o*100,t.self/o*100,t.name,t.self,t.total],itemStyle:{color:z(t.name,u)?(s=t.name,h=t.total/(n||o)*100,"package-name"===d?function(e,t){var a;let l,o,n=(null==(a=e.split("/").pop())?void 0:a.split(".")[0])||e;return t<1?A:((o=T[l=`${n}_____false`])||(o=function(e,t){let[a,l,o]=t?k.hsl(e):S.hsl(e),n=`${(100*l).toFixed(0)}%`,r=`${(100*o).toFixed(0)}%`;return`hsla(${a.toFixed(2)},${n},${r},0.9)`}(n,!1),T[l]=o),o)}(s,h):(c=h)<1?A:c>100?"#ffbdbd":M[Math.floor(c/(M.length-1))]||"#393d47"):"#dee2e6"}};for(let e of(a.push(p),t.children||[]))r(e)},l.id&&r(l),a},[d,s.metadata,s.profile.stackTrace,h,u]),B=e=>{let t=e.data,a=t.value[6];if(E({id:t.name,name:a}),"event"in e){let t=e.event;P({mouseX:t.event.clientX-2,mouseY:t.event.clientY-4})}},N=()=>{P(null),G&&L(!1)},H=(e,t)=>{let a=t.value(0),l=t.coord([t.value(1),a]),o=t.coord([t.value(2),a]),n=(t.size&&t.size([0,1])||[0,20])[1],r=((null==o?void 0:o[0])??0)-((null==l?void 0:l[0])??0);return{type:"rect",transition:["shape"],shape:{x:null==l?void 0:l[0],y:((null==l?void 0:l[1])??0)-(n??0)/2,width:r,height:(n??2)-2,r:0},style:{fill:t.visual("color")},emphasis:{style:{stroke:"#000"}},textConfig:{position:"insideLeft"},textContent:{style:{text:t.value(3),fill:"#000",width:r-4,overflow:"truncate",ellipsis:"..",truncateMinChar:1},emphasis:{style:{stroke:"#000",lineWidth:.5}}}}},_=(0,w.useMemo)(()=>{var e,t;if(void 0===s.profile.stackTrace)return F.noDataOption;let a=Math.max(r>600?20:6,Math.max(...R.map(e=>e.value[0]))),l=null==(e=R[0])?void 0:e.value[1],o=null==(t=R[0])?void 0:t.value[2],i=(r/(a-1)-2)/2+1;return{tooltip:{appendToBody:!0,confine:!0,formatter:e=>{var t,a;let l,o,n,r,i;return a=null==(t=s.metadata)?void 0:t.units,l=Number(e.value[4]),o=Number(e.value[5]),n=e.value[6],r=Number(e.value[8]),i=Number(e.value[7]),`${n}<br/><br/>
|
|
2
2
|
Total: ${I(a,r)} (${l.toFixed(2)}%)<br/>
|
|
3
3
|
Self: ${I(a,i)} (${o.toFixed(2)}%)<br/>
|
|
4
|
-
Samples: ${D.format.addCommas(r)}`},backgroundColor:C.palette.background.paper,borderColor:C.palette.background.paper,textStyle:{color:C.palette.text.primary}},xAxis:{show:!1,min:l,max:o,axisLabel:{show:!1}},yAxis:{show:!1,max:a,inverse:!0,axisLabel:{show:!1}},axisLabel:{overflow:"truncate",width:n/3},grid:{left:5,right:5,top:i+5,bottom:i},series:[{type:"custom",renderItem:H,encode:{x:[0,1,2],y:0},data:R}]}},[s,F,C,n,R,r]),W=(0,w.useMemo)(()=>(0,l.jsx)(c.EChart,{style:{width:n,height:r-20-50},option:_,theme:F.echartsTheme,onEvents:{click:B}}),[F.echartsTheme,r,_,n]);return(0,l.jsxs)(o.A,{style:{width:n,height:r},alignItems:"center",children:[(0,l.jsx)(m,{totalValue:(null==(t=R[0])?void 0:t.value[3])||"",totalSample:(null==(a=R[0])?void 0:a.value[8])||0,otherItemSample:function(e,t){if(void 0===t||0===t)return;let a=e.find(e=>e.name===t);return Number(null==a?void 0:a.value[8])}(R,h),onSelectedIdChange:p}),W,(0,l.jsxs)(f.A,{sx:{"& .MuiPaper-root":{backgroundColor:C.palette.background.paper,color:C.palette.text.primary,padding:"5px",paddingBottom:"0px"},"& .MuiMenuItem-root":{"&:hover":{backgroundColor:C.palette.action.hover}}},open:null!==O,onClose:N,anchorReference:"anchorPosition",anchorPosition:null!==O?{top:O.mouseY,left:O.mouseX}:void 0,children:[(0,l.jsx)(x.A,{sx:{paddingLeft:"16px",paddingBottom:"8px"},children:V.name}),(0,l.jsx)(v.A,{sx:{backgroundColor:C.palette.divider}}),(0,l.jsxs)(b.A,{onClick:()=>{p(V.id),N()},children:[(0,l.jsx)(i.default,{fontSize:"small",color:"secondary",sx:{marginRight:"10px"}}),"Focus block"]}),(0,l.jsxs)(b.A,{onClick:()=>{(h||0===h)&&V.name&&navigator.clipboard.writeText(V.name),L(!0)},disabled:G,children:[(0,l.jsx)(j.default,{fontSize:"small",color:"secondary",sx:{marginRight:"10px"}}),G?"Copied":"Copy function name"]}),(0,l.jsxs)(b.A,{onClick:()=>{h&&p(0),N()},children:[(0,l.jsx)(y.default,{fontSize:"small",color:"secondary",sx:{marginRight:"10px"}}),"Reset graph"]})]})]})}var P=a(93648),V=a(7013),E=a(38662);let G=[{id:"package-name",label:"By Package Name"},{id:"value",label:"By Value"}];function L(e){let{onChange:t,value:a="package-name"}=e;return(0,l.jsx)(c.OptionsEditorControl,{label:"Palette",control:(0,l.jsx)(c.SettingsAutocomplete,{value:G.find(e=>e.id===a),options:G,getOptionLabel:e=>e.label,onChange:(e,a)=>{let{id:l}=a;t(l)},disableClearable:!0})})}var R=a(68003);function B(e){let{onChange:t,value:a,label:o}=e;return(0,l.jsx)(c.OptionsEditorControl,{label:o,control:(0,l.jsx)(R.A,{checked:a,onChange:(e,a)=>{t(a)}})})}var N=a(8072),H=a(88091),_=a(13087),W=a(96313);let Y="Reset graph",Z="Change color sheme";function K(e){let{value:t,selectedId:a,onSelectedIdChange:n,onChangePalette:r,onDisplayChange:i}=e,s=(0,g.A)(),[d,h]=(0,w.useState)(null),u=!!d,p={fontSize:"12px",padding:"2px 6px",minWidth:"auto"},m=()=>{h(null)},x=(0,w.useMemo)(()=>t.showTable||t.showFlameGraph?t.showTable&&t.showFlameGraph?"both":t.showTable?"table":"flame-graph":"none",[t.showTable,t.showFlameGraph]);return(0,l.jsxs)(o.A,{spacing:"10px",direction:"row",justifyContent:"center",alignItems:"center",children:[0!==a&&(0,l.jsx)(c.InfoTooltip,{description:Y,children:(0,l.jsx)(c.ToolbarIconButton,{"aria-label":Y,onClick:()=>n(0),color:"primary",children:(0,l.jsx)(y.default,{fontSize:"small"})})}),(0,l.jsxs)(o.A,{children:[(0,l.jsx)(c.InfoTooltip,{description:Z,children:(0,l.jsx)(c.ToolbarIconButton,{id:"change-color-sheme-button","aria-label":Z,"aria-controls":u?"change-color-sheme-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:e=>{h(e.currentTarget)},color:"primary",children:(0,l.jsx)(_.default,{fontSize:"small"})})}),(0,l.jsxs)(f.A,{id:"change-color-sheme-menu",slotProps:{list:{"aria-labelledby":"change-color-sheme-button"}},anchorEl:d,open:u,onClose:m,slots:{transition:W.A},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},sx:{mt:1,"& .MuiPaper-root":{backgroundColor:s.palette.background.paper,padding:"0 5px"},"& .MuiMenuItem-root:hover":{backgroundColor:s.palette.action.hover}},children:[(0,l.jsx)(b.A,{onClick:()=>{r("package-name"),m()},selected:"package-name"===t.palette,children:"By package name"}),(0,l.jsx)(b.A,{onClick:()=>{r("value"),m()},selected:"value"===t.palette,children:"By value"})]})]}),(0,l.jsxs)(o.A,{direction:"row",sx:{border:`1px solid ${s.palette.primary.main}`,borderRadius:`${s.shape.borderRadius}px`,padding:"2px"},children:[(0,l.jsx)(c.InfoTooltip,{description:"Only show table",children:(0,l.jsx)(V.A,{variant:"table"===x?"contained":"text",color:"primary",size:"small",onClick:()=>i("table"),sx:p,children:"Table"})}),(0,l.jsx)(c.InfoTooltip,{description:"Only show flame graph",children:(0,l.jsx)(V.A,{variant:"flame-graph"===x?"contained":"text",color:"primary",size:"small",onClick:()=>i("flame-graph"),sx:p,children:"Flame Graph"})}),(0,l.jsx)(c.InfoTooltip,{description:"Show both the table and flame graph",children:(0,l.jsx)(V.A,{variant:"both"===x?"contained":"text",color:"primary",size:"small",onClick:()=>i("both"),sx:p,children:"Both"})})]})]})}var X=a(57438),q=a(2582),Q=a(98599);function U(e){let{searchValue:t,onSearchValueChange:a}=e;return(0,l.jsx)(P.A,{size:"small",variant:"outlined",placeholder:"Search...",fullWidth:!0,value:t,onChange:e=>a(e.target.value),slotProps:{input:{startAdornment:(0,l.jsx)(q.A,{position:"start",children:(0,l.jsx)(Q.default,{fontSize:"small"})}),endAdornment:""!==t&&(0,l.jsx)(q.A,{position:"end",children:(0,l.jsx)(d.A,{label:"Clear",size:"small",onClick:()=>a("")})})}}})}function J(e){var t;let{width:a,height:n,data:r,searchValue:i,onSearchValueChange:s,onSelectedIdChange:d}=e,h=(0,g.A)(),u=a-10,p=(0,w.useMemo)(()=>{var e;let t,a,l;return e=r.profile.stackTrace,t=[],a=structuredClone(e),l=e=>{let a={id:e.id,name:e.name,self:e.self,total:e.total};for(let o of(z(a.name,i)&&t.push(a),e.children||[]))l(o)},a.id&&l(a),t},[r,i]),m=(0,w.useMemo)(()=>{var e;let t=(null==(e=r.metadata)?void 0:e.units)||"";return[{accessorKey:"name",header:"Name",headerDescription:"Function name",align:"left",enableSorting:!0,width:.5*u,cell:e=>{let t=e.getValue();return(0,l.jsx)(X.A,{href:"#",underline:"hover",onClick:t=>{t.preventDefault();let a=e.row.original;d(a.id),s(a.name)},children:t})},cellDescription:()=>""},{accessorKey:"self",header:"Self",headerDescription:"Function self samples",align:"right",enableSorting:!0,width:.25*u-15,cell:e=>I(t,e.getValue())},{accessorKey:"total",header:"Total",headerDescription:"Function total samples",align:"right",enableSorting:!0,width:.25*u,cell:e=>I(t,e.getValue())}]},[null==(t=r.metadata)?void 0:t.units,u,s,d]),[f,x]=(0,w.useState)([{id:"total",desc:!0}]);return(0,l.jsxs)(o.A,{width:u,height:n,gap:1,sx:{"& .MuiTable-root":{borderCollapse:"collapse"},"& .MuiTableCell-root":{borderBottom:`1px solid ${h.palette.divider}`,borderRight:`1px solid ${h.palette.divider}`,"&:last-child":{borderRight:"none"}}},children:[(0,l.jsx)(U,{searchValue:i,onSearchValueChange:s}),(0,l.jsx)(c.Table,{data:p,columns:m,height:n-8-50,width:u,density:n<600?"compact":"standard",defaultColumnWidth:"auto",defaultColumnHeight:"auto",sorting:f,onSortingChange:x})]})}var ee=a(
|
|
4
|
+
Samples: ${D.format.addCommas(r)}`},backgroundColor:C.palette.background.paper,borderColor:C.palette.background.paper,textStyle:{color:C.palette.text.primary}},xAxis:{show:!1,min:l,max:o,axisLabel:{show:!1}},yAxis:{show:!1,max:a,inverse:!0,axisLabel:{show:!1}},axisLabel:{overflow:"truncate",width:n/3},grid:{left:5,right:5,top:i+5,bottom:i},series:[{type:"custom",renderItem:H,encode:{x:[0,1,2],y:0},data:R}]}},[s,F,C,n,R,r]),W=(0,w.useMemo)(()=>(0,l.jsx)(c.EChart,{style:{width:n,height:r-20-50},option:_,theme:F.echartsTheme,onEvents:{click:B}}),[F.echartsTheme,r,_,n]);return(0,l.jsxs)(o.A,{style:{width:n,height:r},alignItems:"center",children:[(0,l.jsx)(m,{totalValue:(null==(t=R[0])?void 0:t.value[3])||"",totalSample:(null==(a=R[0])?void 0:a.value[8])||0,otherItemSample:function(e,t){if(void 0===t||0===t)return;let a=e.find(e=>e.name===t);return Number(null==a?void 0:a.value[8])}(R,h),onSelectedIdChange:p}),W,(0,l.jsxs)(f.A,{sx:{"& .MuiPaper-root":{backgroundColor:C.palette.background.paper,color:C.palette.text.primary,padding:"5px",paddingBottom:"0px"},"& .MuiMenuItem-root":{"&:hover":{backgroundColor:C.palette.action.hover}}},open:null!==O,onClose:N,anchorReference:"anchorPosition",anchorPosition:null!==O?{top:O.mouseY,left:O.mouseX}:void 0,children:[(0,l.jsx)(x.A,{sx:{paddingLeft:"16px",paddingBottom:"8px"},children:V.name}),(0,l.jsx)(v.A,{sx:{backgroundColor:C.palette.divider}}),(0,l.jsxs)(b.A,{onClick:()=>{p(V.id),N()},children:[(0,l.jsx)(i.default,{fontSize:"small",color:"secondary",sx:{marginRight:"10px"}}),"Focus block"]}),(0,l.jsxs)(b.A,{onClick:()=>{(h||0===h)&&V.name&&navigator.clipboard.writeText(V.name),L(!0)},disabled:G,children:[(0,l.jsx)(j.default,{fontSize:"small",color:"secondary",sx:{marginRight:"10px"}}),G?"Copied":"Copy function name"]}),(0,l.jsxs)(b.A,{onClick:()=>{h&&p(0),N()},children:[(0,l.jsx)(y.default,{fontSize:"small",color:"secondary",sx:{marginRight:"10px"}}),"Reset graph"]})]})]})}var P=a(93648),V=a(7013),E=a(38662);let G=[{id:"package-name",label:"By Package Name"},{id:"value",label:"By Value"}];function L(e){let{onChange:t,value:a="package-name"}=e;return(0,l.jsx)(c.OptionsEditorControl,{label:"Palette",control:(0,l.jsx)(c.SettingsAutocomplete,{value:G.find(e=>e.id===a),options:G,getOptionLabel:e=>e.label,onChange:(e,a)=>{let{id:l}=a;t(l)},disableClearable:!0})})}var R=a(68003);function B(e){let{onChange:t,value:a,label:o}=e;return(0,l.jsx)(c.OptionsEditorControl,{label:o,control:(0,l.jsx)(R.A,{checked:a,onChange:(e,a)=>{t(a)}})})}var N=a(8072),H=a(88091),_=a(13087),W=a(96313);let Y="Reset graph",Z="Change color sheme";function K(e){let{value:t,selectedId:a,onSelectedIdChange:n,onChangePalette:r,onDisplayChange:i}=e,s=(0,g.A)(),[d,h]=(0,w.useState)(null),u=!!d,p={fontSize:"12px",padding:"2px 6px",minWidth:"auto"},m=()=>{h(null)},x=(0,w.useMemo)(()=>t.showTable||t.showFlameGraph?t.showTable&&t.showFlameGraph?"both":t.showTable?"table":"flame-graph":"none",[t.showTable,t.showFlameGraph]);return(0,l.jsxs)(o.A,{spacing:"10px",direction:"row",justifyContent:"center",alignItems:"center",children:[0!==a&&(0,l.jsx)(c.InfoTooltip,{description:Y,children:(0,l.jsx)(c.ToolbarIconButton,{"aria-label":Y,onClick:()=>n(0),color:"primary",children:(0,l.jsx)(y.default,{fontSize:"small"})})}),(0,l.jsxs)(o.A,{children:[(0,l.jsx)(c.InfoTooltip,{description:Z,children:(0,l.jsx)(c.ToolbarIconButton,{id:"change-color-sheme-button","aria-label":Z,"aria-controls":u?"change-color-sheme-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:e=>{h(e.currentTarget)},color:"primary",children:(0,l.jsx)(_.default,{fontSize:"small"})})}),(0,l.jsxs)(f.A,{id:"change-color-sheme-menu",slotProps:{list:{"aria-labelledby":"change-color-sheme-button"}},anchorEl:d,open:u,onClose:m,slots:{transition:W.A},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},sx:{mt:1,"& .MuiPaper-root":{backgroundColor:s.palette.background.paper,padding:"0 5px"},"& .MuiMenuItem-root:hover":{backgroundColor:s.palette.action.hover}},children:[(0,l.jsx)(b.A,{onClick:()=>{r("package-name"),m()},selected:"package-name"===t.palette,children:"By package name"}),(0,l.jsx)(b.A,{onClick:()=>{r("value"),m()},selected:"value"===t.palette,children:"By value"})]})]}),(0,l.jsxs)(o.A,{direction:"row",sx:{border:`1px solid ${s.palette.primary.main}`,borderRadius:`${s.shape.borderRadius}px`,padding:"2px"},children:[(0,l.jsx)(c.InfoTooltip,{description:"Only show table",children:(0,l.jsx)(V.A,{variant:"table"===x?"contained":"text",color:"primary",size:"small",onClick:()=>i("table"),sx:p,children:"Table"})}),(0,l.jsx)(c.InfoTooltip,{description:"Only show flame graph",children:(0,l.jsx)(V.A,{variant:"flame-graph"===x?"contained":"text",color:"primary",size:"small",onClick:()=>i("flame-graph"),sx:p,children:"Flame Graph"})}),(0,l.jsx)(c.InfoTooltip,{description:"Show both the table and flame graph",children:(0,l.jsx)(V.A,{variant:"both"===x?"contained":"text",color:"primary",size:"small",onClick:()=>i("both"),sx:p,children:"Both"})})]})]})}var X=a(57438),q=a(2582),Q=a(98599);function U(e){let{searchValue:t,onSearchValueChange:a}=e;return(0,l.jsx)(P.A,{size:"small",variant:"outlined",placeholder:"Search...",fullWidth:!0,value:t,onChange:e=>a(e.target.value),slotProps:{input:{startAdornment:(0,l.jsx)(q.A,{position:"start",children:(0,l.jsx)(Q.default,{fontSize:"small"})}),endAdornment:""!==t&&(0,l.jsx)(q.A,{position:"end",children:(0,l.jsx)(d.A,{label:"Clear",size:"small",onClick:()=>a("")})})}}})}function J(e){var t;let{width:a,height:n,data:r,searchValue:i,onSearchValueChange:s,onSelectedIdChange:d}=e,h=(0,g.A)(),u=a-10,p=(0,w.useMemo)(()=>{var e;let t,a,l;return e=r.profile.stackTrace,t=[],a=structuredClone(e),l=e=>{let a={id:e.id,name:e.name,self:e.self,total:e.total};for(let o of(z(a.name,i)&&t.push(a),e.children||[]))l(o)},a.id&&l(a),t},[r,i]),m=(0,w.useMemo)(()=>{var e;let t=(null==(e=r.metadata)?void 0:e.units)||"";return[{accessorKey:"name",header:"Name",headerDescription:"Function name",align:"left",enableSorting:!0,width:.5*u,cell:e=>{let t=e.getValue();return(0,l.jsx)(X.A,{href:"#",underline:"hover",onClick:t=>{t.preventDefault();let a=e.row.original;d(a.id),s(a.name)},children:t})},cellDescription:()=>""},{accessorKey:"self",header:"Self",headerDescription:"Function self samples",align:"right",enableSorting:!0,width:.25*u-15,cell:e=>I(t,e.getValue())},{accessorKey:"total",header:"Total",headerDescription:"Function total samples",align:"right",enableSorting:!0,width:.25*u,cell:e=>I(t,e.getValue())}]},[null==(t=r.metadata)?void 0:t.units,u,s,d]),[f,x]=(0,w.useState)([{id:"total",desc:!0}]);return(0,l.jsxs)(o.A,{width:u,height:n,gap:1,sx:{"& .MuiTable-root":{borderCollapse:"collapse"},"& .MuiTableCell-root":{borderBottom:`1px solid ${h.palette.divider}`,borderRight:`1px solid ${h.palette.divider}`,"&:last-child":{borderRight:"none"}}},children:[(0,l.jsx)(U,{searchValue:i,onSearchValueChange:s}),(0,l.jsx)(c.Table,{data:p,columns:m,height:n-8-50,width:u,density:n<600?"compact":"standard",defaultColumnWidth:"auto",defaultColumnHeight:"auto",sorting:f,onSortingChange:x})]})}var ee=a(19848);function et(e){let{width:t,height:a,data:n}=e,r=(0,c.useChartsTheme)(),i=(0,g.A)(),{setTimeRange:s}=(0,ee.useTimeRange)(),d=(0,w.useRef)(),h=(0,w.useMemo)(()=>({datazoom:e=>{var t,a,l,o;if(void 0===e.batch[0])return;let n=null==(a=e.batch)||null==(t=a[0])?void 0:t.startValue,r=null==(o=e.batch)||null==(l=o[0])?void 0:l.endValue;void 0!==n&&void 0!==r&&s({start:new Date(n),end:new Date(r)})},finished:()=>{void 0!==d.current&&(0,c.enableDataZoom)(d.current)}}),[s]),u=(0,w.useMemo)(()=>{let e=n.timeline||{},t=e.startTime,a=e.durationDelta;return e.samples.map((e,l)=>({id:l,value:[(t+l*a)*1e3,Number(e)]}))},[n.timeline]),p=(0,w.useMemo)(()=>{let e={type:"line",color:i.palette.primary.main,sampling:"lttb",showSymbol:!0,showAllSymbol:!0,symbolSize:3.25,lineStyle:{width:1.25,opacity:.95},areaStyle:{opacity:0},data:u},t=n.timeline||{};return{series:e,xAxis:{type:"time",min:1e3*t.startTime,max:(t.startTime+t.samples.length*t.durationDelta)*1e3,axisLabel:{hideOverlap:!0},axisPointer:{snap:!1}},yAxis:{type:"value",axisLabel:{formatter:e=>{var t;return I(null==(t=n.metadata)?void 0:t.units,e)}}},animation:!1,tooltip:{show:!0,showContent:!0,trigger:"axis",appendToBody:!0,confine:!0,backgroundColor:i.palette.background.paper,borderColor:i.palette.background.paper,textStyle:{color:i.palette.text.primary},formatter:e=>{var t,a,l,o,r,s,d,h;let u,c,p;return o=(null==(t=e[0])?void 0:t.data)||{},r=(null==(a=n.metadata)?void 0:a.units)||"",s=(null==(l=n.metadata)?void 0:l.name)||"",d=i.palette.primary.main,h=i.palette.divider,c=(u=new Date(o.value[0])).toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),p=u.toLocaleString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),`
|
|
5
5
|
<div>
|
|
6
6
|
<div>
|
|
7
7
|
${c} - <b>${p}</b>
|