"use strict";(self.webpackChunk_mlflow_mlflow=self.webpackChunk_mlflow_mlflow||[]).push([[5679],{30618:function(t,e,o){o.d(e,{b:function(){return l}});var n=o(90970),a=o(15714),i=o(60719),r=o(49960),s=o(44941),l=(0,n.gu)({chartName:"LineChart",GraphicalChild:a.N,axisComponents:[{axisType:"xAxis",AxisComp:i.W},{axisType:"yAxis",AxisComp:r.h}],formatAxisMap:s.pr})},55679:function(t,e,o){o.d(e,{ToolLatencyChart:function(){return Y}});var n=o(68248),a=o(46709),i=o(27757),r=o(82716),s=o(40724),l=o(66774),d=o(30618),c=o(60719),m=o(49960),u=o(858),h=o(15714),p=o(6581),g=o(54313),v=o(23327),f=o(83110),y=o(69983);var A=o(3409),M=o(73408);const Y=()=>{const{theme:t}=(0,i.u)(),e=(0,A.zZ)(),o=(0,A.IT)(),Y=(0,A.gy)(),{getOpacity:T,handleLegendMouseEnter:L,handleLegendMouseLeave:N}=(0,f.pH)(),{getChartColor:C}=(0,f.yC)(),{chartData:w,toolNames:k,isLoading:x,error:D,hasData:_}=function(){const{experimentId:t,startTimeMs:e,endTimeMs:o,timeIntervalSeconds:n,timeBuckets:i}=(0,y.W)(),r=(0,a.useMemo)(()=>[(0,g.jm)(g.Mm.TYPE,g.du.TOOL)],[]),{data:s,isLoading:l,error:d}=(0,v.o4)({experimentId:t,startTimeMs:e,endTimeMs:o,viewType:g.mW.SPANS,metricName:g.Ub.LATENCY,aggregations:[{aggregation_type:g.DF.AVG}],filters:r,dimensions:[g.it.SPAN_NAME],timeIntervalSeconds:n}),{chartData:c,toolNames:m}=(0,a.useMemo)(()=>{var t;const e=null!==(t=null===s||void 0===s?void 0:s.data_points)&&void 0!==t?t:[],o=new Set,a=new Map;for(const n of e){var r,l,d;const t=null===(r=n.dimensions)||void 0===r?void 0:r[g.it.SPAN_NAME],e=null===(l=n.dimensions)||void 0===l?void 0:l[g.Ad],i=null===(d=n.values)||void 0===d?void 0:d[g.DF.AVG];if(!t||!e||void 0===i)continue;o.add(t);const s=new Date(e).getTime();let c=a.get(s);c||(c=new Map,a.set(s,c)),c.set(t,i)}const c=Array.from(o).sort();return{chartData:i.map(t=>{const e=a.get(t),o={timestamp:(0,f.fq)(t,n)};for(const n of c){var i;o[n]=null!==(i=null===e||void 0===e?void 0:e.get(n))&&void 0!==i?i:0}return o}),toolNames:c}},[null===s||void 0===s?void 0:s.data_points,i,n]);return{chartData:c,toolNames:m,isLoading:l,error:d,hasData:m.length>0}}(),b=(0,a.useCallback)((t,e)=>[(0,f.YL)(t),e],[]);return x?(0,M.Y)(A.lh,{}):D?(0,M.Y)(A.nN,{}):(0,M.FD)(A.h,{componentId:"mlflow.charts.tool_latency",children:[(0,M.Y)(A.XQ,{icon:(0,M.Y)(r.LightningIcon,{}),title:(0,M.Y)(s.A,{id:"L8czct",defaultMessage:"Latency Comparison"})}),(0,M.Y)("div",{css:(0,n.AH)({height:A.tz,marginTop:t.spacing.sm},""),children:_?(0,M.Y)(l.u,{width:"100%",height:"100%",children:(0,M.FD)(d.b,{data:w,margin:{top:10,right:10,left:10,bottom:0},children:[(0,M.Y)(c.W,{dataKey:"timestamp",...e}),(0,M.Y)(m.h,{...o}),(0,M.Y)(u.m,{content:(0,M.Y)(A.Vn,{formatter:b}),cursor:{stroke:t.colors.actionTertiaryBackgroundHover}}),k.map((t,e)=>(0,M.Y)(h.N,{type:"monotone",dataKey:t,stroke:C(e),strokeWidth:2,strokeOpacity:T(t),dot:!1},t)),(0,M.Y)(p.s,{verticalAlign:"bottom",iconType:"plainline",onMouseEnter:L,onMouseLeave:N,...Y})]})}):(0,M.Y)(A.iE,{})})]})}}}]);