PageSourceSearch

https://aiven.io/remix-chunks/Graph-SYswws7h.js

js aiven.io collected 2026-10-01 09:22:49 UTC 3,550 bytes, 5 lines download raw bytes

1import{r as p,j as n}from"./typography-CGJEf-yY.js";import{f as _}from"./skeleton-DpJPOz63.js";import{R as g}from"./ResponsiveContainer-Cj1wrzmX.js";import{A as j,X as w,Y as C,a as v}from"./AreaChart-Bq_VimV9.js";import{T as E,R as T,a as H}from"./generateCategoricalChart-ybFIvlF1.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"c347d410ac36f54334105e4f6267ba208f688052"}}catch{}})();try{(function(){var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new s.Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="55878f8e-06bf-4b37-aa05-e9c6fcd0b2d4",s._sentryDebugIdIdentifier="sentry-dbid-55878f8e-06bf-4b37-aa05-e9c6fcd0b2d4")})()}catch{}const b=(s,o,r,f,i,t)=>{const a=o*.0009765625*3600*(1-i/100),m=r*o*(1/1024)*3600*(1-i/100),x=o*(1/1024)*3600*(i/100),h=o*r*(1/1024)*3600*(i/100),c=t[s],l=c.length,e=o>c[l-1].max_ingress_mb_s?c[l-1].hourly_rate:c.filter(y=>o>y.max_ingress_mb_s&&o<c[l-1].max_ingress_mb_s?!1:o<=y.max_ingress_mb_s)[0].hourly_rate,d=a*t.network.classic_ingress+m*t.network.classic_egress,u=x*t.network.diskless_ingress+h*t.network.diskless_egress,k=o*(1/1024)*3600*f*24*(Number(t.storage.rate_per_gb_month)/730);return(e+d+u+k)*730},R=({active:s,payload:o,costAt0Percent:r})=>{if(!s||!o||!o.length)return null;const{disklessPercent:f,cost:i}=o[0].payload,t=r>0?((1-i/r)*100).toFixed(0):0;return n.jsxs("div",{className:`
2				rounded border border-grey-70 bg-grey-90 px-3
3				py-2 text-sm
4			`,children:[n.jsxs("p",{className:"font-bold text-primary-green",children:[t,"% saved"]}),n.jsxs("p",{className:"font-bold text-white",children:[_(i)," per month"]}),n.jsxs("p",{className:"text-secondary",children:[f,"% diskless topics"]})]})},G=({cloud:s,selectedIngressValue:o,egressMultiplier:r,retentionValue:f,currentDisklessPercent:i,rateData:t})=>{const a=p.useMemo(()=>{if(!t)return[];const e=[];for(let d=0;d<=100;d+=5)e.push({disklessPercent:d,cost:b(s,o,r,f,d,t)});return e},[s,o,r,f,t]),m=p.useMemo(()=>t?b(s,o,r,f,i,t):0,[s,o,r,f,i,t]),x=p.useMemo(()=>t?b(s,o,r,f,0,t):0,[s,o,r,f,t]);if(!t||a.length===0)return null;const h=Math.min(...a.map(e=>e.cost)),c=Math.max(...a.map(e=>e.cost)),l=[Math.floor(h*.95),Math.ceil(c*1.05)];return n.jsx("div",{className:"h-[300px] w-full",children:n.jsx(g,{width:"100%",height:"100%",children:n.jsxs(j,{data:a,margin:{top:10,right:30,left:20,bottom:30},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"colorCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"#DF56F2",stopOpacity:1}),n.jsx("stop",{offset:"95%",stopColor:"#DF56F2",stopOpacity:.5})]})}),n.jsx(w,{dataKey:"disklessPercent",tickFormatter:e=>`${e}%`,stroke:"#666",tick:{fill:"#999",fontSize:12},axisLine:{stroke:"#444"},label:{value:"% Diskless",position:"bottom",offset:10,fill:"#999",fontSize:12}}),n.jsx(C,{domain:l,tickFormatter:e=>e.toLocaleString(),stroke:"#666",tick:{fill:"#999",fontSize:12},axisLine:{stroke:"#444"},label:{value:"Cost per month",angle:-90,position:"insideLeft",fill:"#999",fontSize:12}}),n.jsx(E,{content:n.jsx(R,{costAt0Percent:x}),cursor:{stroke:"#00e676",strokeWidth:1}}),n.jsx(v,{type:"linear",dataKey:"cost",stroke:"#9b59b6",fill:"url(#colorCost)",strokeWidth:2}),n.jsx(T,{x:i,stroke:"#00e676",strokeWidth:2}),n.jsx(H,{x:i,y:m,r:6,fill:"#00e676",stroke:"#00e676"})]})})})};export{G as InklessGraph,G as default};
5//# sourceMappingURL=Graph-SYswws7h.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.