"use strict";(self.webpackChunk_mlflow_mlflow=self.webpackChunk_mlflow_mlflow||[]).push([[8472],{30618:function(e,t,o){o.d(t,{b:function(){return l}});var r=o(90970),a=o(15714),n=o(60719),i=o(49960),s=o(44941),l=(0,r.gu)({chartName:"LineChart",GraphicalChild:a.N,axisComponents:[{axisType:"xAxis",AxisComp:n.W},{axisType:"yAxis",AxisComp:i.h}],formatAxisMap:s.pr})},38472:function(e,t,o){o.d(t,{ToolErrorRateChart:function(){return N}});var r=o(68248),a=o(46709),n=o(27757),i=o(82716),s=o(40724),l=o(66774),c=o(30618),d=o(60719),m=o(49960),h=o(858),u=o(6581),p=o(15714),f=o(54313),v=o(23327),g=o(83110),T=o(69983);var A=o(3409),Y=o(73408);const N=({toolName:e,lineColor:t,overallErrorRate:o})=>{const{theme:N}=(0,n.u)(),M=(0,A.zZ)(),_=(0,A.IT)(),w=(0,A.gy)(),x=t||N.colors.red500,{chartData:C,isLoading:S,error:k,hasData:y}=function({toolName:e}){const{experimentId:t,startTimeMs:o,endTimeMs:r,timeIntervalSeconds:n,timeBuckets:i}=(0,T.W)(),s=(0,a.useMemo)(()=>[(0,f.jm)(f.Mm.TYPE,f.du.TOOL),(0,f.jm)(f.Mm.NAME,e)],[e]),{data:l,isLoading:c,error:d}=(0,v.o4)({experimentId:t,startTimeMs:o,endTimeMs:r,viewType:f.mW.SPANS,metricName:f.Ub.SPAN_COUNT,aggregations:[{aggregation_type:f.DF.COUNT}],filters:s,dimensions:[f.it.SPAN_STATUS],timeIntervalSeconds:n}),m=(0,a.useMemo)(()=>(null===l||void 0===l?void 0:l.data_points)||[],[null===l||void 0===l?void 0:l.data_points]),h=(0,a.useMemo)(()=>{const e=new Map;for(const n of m){var t,o,r;const a=null===(t=n.dimensions)||void 0===t?void 0:t[f.Ad];if(!a)continue;const i=new Date(a).getTime(),s=(null===(o=n.values)||void 0===o?void 0:o[f.DF.COUNT])||0,l=null===(r=n.dimensions)||void 0===r?void 0:r[f.it.SPAN_STATUS];e.has(i)||e.set(i,{error:0,total:0});const c=e.get(i);c.total+=s,l===f.Fp.ERROR&&(c.error+=s)}const a=new Map;for(const[n,{error:i,total:s}]of e)a.set(n,s>0?i/s*100:0);return a},[m]);return{chartData:(0,a.useMemo)(()=>i.map(e=>({name:(0,g.fq)(e,n),errorRate:h.get(e)||0})),[i,h,n]),isLoading:c,error:d,hasData:m.length>0}}({toolName:e}),D=(0,a.useCallback)(e=>[`${e.toFixed(2)}%`,"Error Rate"],[]);return S?(0,Y.Y)(A.lh,{}):k?(0,Y.Y)(A.nN,{}):y?(0,Y.FD)(A.h,{componentId:"mlflow.charts.tool_error_rate","data-testid":`tool-chart-${e}`,children:[(0,Y.Y)(A.XQ,{icon:(0,Y.Y)(i.WrenchIcon,{css:(0,r.AH)({color:x},"")}),title:e,value:`${o.toFixed(2)}%`,subtitle:(0,Y.Y)(s.A,{id:"D2svqS",defaultMessage:"overall error rate"})}),(0,Y.Y)("div",{css:(0,r.AH)({height:A.tz},""),children:(0,Y.Y)(l.u,{width:"100%",height:"100%",children:(0,Y.FD)(c.b,{data:C,margin:{top:10,right:10,left:10,bottom:0},children:[(0,Y.Y)(d.W,{dataKey:"name",...M}),(0,Y.Y)(m.h,{domain:[0,100],tickFormatter:e=>`${e}%`,..._}),(0,Y.Y)(h.m,{content:(0,Y.Y)(A.Vn,{formatter:D}),cursor:{stroke:N.colors.actionTertiaryBackgroundHover}}),(0,Y.Y)(u.s,{iconType:"plainline",...w}),(0,Y.Y)(p.N,{type:"monotone",dataKey:"errorRate",name:"Error Rate",stroke:x,strokeWidth:2,dot:!1})]})})})]}):(0,Y.FD)(A.h,{componentId:"mlflow.charts.tool_error_rate","data-testid":`tool-chart-${e}`,children:[(0,Y.Y)(A.XQ,{icon:(0,Y.Y)(i.WrenchIcon,{css:(0,r.AH)({color:x},"")}),title:e}),(0,Y.Y)(A.iE,{})]})}}}]);