"use strict";(self.webpackChunk_mlflow_mlflow=self.webpackChunk_mlflow_mlflow||[]).push([[1078],{30618:function(e,t,o){o.d(t,{b:function(){return s}});var a=o(90970),i=o(15714),n=o(60719),r=o(49960),l=o(44941),s=(0,a.gu)({chartName:"LineChart",GraphicalChild:i.N,axisComponents:[{axisType:"xAxis",AxisComp:n.W},{axisType:"yAxis",AxisComp:r.h}],formatAxisMap:l.pr})},81078:function(e,t,o){o.d(t,{TraceLatencyChart:function(){return k}});var a=o(68248),i=o(46709),n=o(27757),r=o(66916),l=o(40724),s=o(66774),d=o(30618),p=o(60719),c=o(49960),u=o(858),v=o(15714),m=o(97245),g=o(6581),h=o(54313),y=o(23327),T=o(83110),Y=o(69983);var C=o(3409),L=o(73408);const k=()=>{const{theme:e}=(0,n.u)(),t=(0,C.zZ)(),o=(0,C.IT)(),k=(0,C.gy)(),{getOpacity:f,handleLegendMouseEnter:E,handleLegendMouseLeave:A}=(0,T.pH)(),{chartData:M,avgLatency:_,isLoading:x,error:N,hasData:D}=function(){var e,t,o;const{experimentId:a,startTimeMs:n,endTimeMs:r,timeIntervalSeconds:l,timeBuckets:s}=(0,Y.W)(),{data:d,isLoading:p,error:c}=(0,y.o4)({experimentId:a,startTimeMs:n,endTimeMs:r,viewType:h.mW.TRACES,metricName:h.po.LATENCY,aggregations:[{aggregation_type:h.DF.PERCENTILE,percentile_value:h.a9},{aggregation_type:h.DF.PERCENTILE,percentile_value:h.CX},{aggregation_type:h.DF.PERCENTILE,percentile_value:h.Jq}],timeIntervalSeconds:l}),{data:u,isLoading:v,error:m}=(0,y.o4)({experimentId:a,startTimeMs:n,endTimeMs:r,viewType:h.mW.TRACES,metricName:h.po.LATENCY,aggregations:[{aggregation_type:h.DF.AVG}]}),g=(0,i.useMemo)(()=>(null===d||void 0===d?void 0:d.data_points)||[],[null===d||void 0===d?void 0:d.data_points]),C=p||v,L=c||m,k=null===u||void 0===u||null===(e=u.data_points)||void 0===e||null===(t=e[0])||void 0===t||null===(o=t.values)||void 0===o?void 0:o[h.DF.AVG],f=(0,i.useCallback)(e=>{var t,o,a;return{p50:(null===(t=e.values)||void 0===t?void 0:t[(0,h.re)(h.a9)])||0,p90:(null===(o=e.values)||void 0===o?void 0:o[(0,h.re)(h.CX)])||0,p99:(null===(a=e.values)||void 0===a?void 0:a[(0,h.re)(h.Jq)])||0}},[]),E=(0,T.NM)(g,f);return{chartData:(0,i.useMemo)(()=>s.map(e=>{const t=E.get(e);return{name:(0,T.fq)(e,l),p50:(null===t||void 0===t?void 0:t.p50)||0,p90:(null===t||void 0===t?void 0:t.p90)||0,p99:(null===t||void 0===t?void 0:t.p99)||0}}),[s,E,l]),avgLatency:k,isLoading:C,error:L,hasData:g.length>0}}(),b=(0,i.useCallback)((e,t)=>[(0,T.YL)(e),t],[]),w={p50:e.colors.blue300,p90:e.colors.blue500,p99:e.colors.yellow500};return x?(0,L.Y)(C.lh,{}):N?(0,L.Y)(C.nN,{}):(0,L.FD)(C.h,{componentId:"mlflow.charts.trace_latency",children:[(0,L.Y)(C.XQ,{icon:(0,L.Y)(r.C,{}),title:(0,L.Y)(l.A,{id:"C83vFj",defaultMessage:"Latency"}),value:void 0!==_?(0,T.YL)(_):void 0}),(0,L.Y)("div",{css:(0,a.AH)({height:C.tz,marginTop:e.spacing.sm},""),children:D?(0,L.Y)(s.u,{width:"100%",height:"100%",children:(0,L.FD)(d.b,{data:M,margin:{top:10,right:30,left:10,bottom:0},children:[(0,L.Y)(p.W,{dataKey:"name",...t}),(0,L.Y)(c.h,{...o}),(0,L.Y)(u.m,{content:(0,L.Y)(C.Vn,{formatter:b}),cursor:{stroke:e.colors.actionTertiaryBackgroundHover}}),(0,L.Y)(v.N,{type:"monotone",dataKey:"p50",stroke:w.p50,strokeWidth:2,dot:!1,name:"p50",strokeOpacity:f("p50")}),(0,L.Y)(v.N,{type:"monotone",dataKey:"p90",stroke:w.p90,strokeWidth:2,dot:!1,name:"p90",strokeOpacity:f("p90")}),(0,L.Y)(v.N,{type:"monotone",dataKey:"p99",stroke:w.p99,strokeWidth:2,dot:!1,name:"p99",strokeOpacity:f("p99")}),void 0!==_&&(0,L.Y)(m.e,{y:_,stroke:e.colors.textSecondary,strokeDasharray:"4 4",label:{value:`AVG (${(0,T.YL)(_)})`,position:"insideTopRight",fill:e.colors.textSecondary,fontSize:10}}),(0,L.Y)(g.s,{verticalAlign:"bottom",iconType:"plainline",onMouseEnter:E,onMouseLeave:A,...k})]})}):(0,L.Y)(C.iE,{})})]})}}}]);