UNPKG

tressi

Version:

Deterministic load testing for API performance validation.

2 lines (1 loc) 4.59 kB
import{a as D}from"./chunk-OVBUA5RI.js";import{c as E}from"./chunk-BEQIQLT5.js";import{$a as h,Db as C,Ka as m,Qb as b,Sb as F,W as i,bb as r,kc as a,lb as p,ma as o,mb as f,qa as s,rb as v,sb as y,tb as x,ub as g}from"./chunk-W6IDPYNF.js";function I(n,e){if(n&1&&g(0,"app-icon",1),n&2){let t=C();v("name",t.getStatusIcon())}}function $(n,e){n&1&&g(0,"span",2)}var _=class n{dataE2e=a(void 0);status=a.required();showIcon=a(!0);showPulse=a(!1);getStatusColor(){let e="text-info bg-info/25",t="text-success bg-success/25",l="text-error bg-error/25",c="text-neutral-content bg-neutral/25";switch(this.status()){case"running":return e;case"completed":return t;case"failed":return l;case"cancelled":return c;default:return c}}getStatusIcon(){switch(this.status()){case"running":return"dynamic_form";case"completed":return"check";case"failed":return"warning";case"cancelled":return"close";default:return"info"}}getDisplayText(){return(this.status()||"unknown").charAt(0).toUpperCase()+(this.status()||"unknown").slice(1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=h({type:n,selectors:[["app-status-badge"]],inputs:{dataE2e:[1,"dataE2e"],status:[1,"status"],showIcon:[1,"showIcon"],showPulse:[1,"showPulse"]},decls:4,vars:4,consts:[[1,"badge","border-base-content/10","mx-auto","gap-1","py-4","pr-4","pl-2",3,"ngClass"],[3,"name"],[1,"ml-1","inline-block","h-2","w-2","animate-pulse","rounded-full","bg-current"]],template:function(t,l){t&1&&(y(0,"span",0),p(1,I,1,1,"app-icon",1),b(2),p(3,$,1,0,"span",2),x()),t&2&&(v("ngClass",l.getStatusColor()),m(),f(l.showIcon()?1:-1),m(),F(" ",l.getDisplayText()," "),m(),f(l.showPulse()?3:-1))},dependencies:[D,E],encapsulation:2})};var w=class n{_el=i(s);value=a(void 0,{alias:"appFormatBytes"});constructor(){o(()=>{let e=this.value();if(e==null||e===0){this._el.nativeElement.textContent="0 B";return}let t=Math.abs(e);t<1024?this._el.nativeElement.textContent=`${Math.round(e)} B`:t<1024*1024?this._el.nativeElement.textContent=`${(e/1024).toFixed(1)} KB`:t<1024*1024*1024?this._el.nativeElement.textContent=`${(e/(1024*1024)).toFixed(1)} MB`:this._el.nativeElement.textContent=`${(e/(1024*1024*1024)).toFixed(2)} GB`})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=r({type:n,selectors:[["","appFormatBytes",""]],inputs:{value:[1,"appFormatBytes","value"]}})};var N=class n{_el=i(s);value=a(void 0,{alias:"appFormatDate"});constructor(){o(()=>{let e=this.value();if(!e){this._el.nativeElement.textContent="\u2014";return}try{let t=new Date(e);if(Number.isNaN(t.getTime())){this._el.nativeElement.textContent="\u2014";return}this._el.nativeElement.textContent=t.toLocaleString()}catch{this._el.nativeElement.textContent="\u2014"}})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=r({type:n,selectors:[["","appFormatDate",""]],inputs:{value:[1,"appFormatDate","value"]}})};var B=class n{_el=i(s);value=a(void 0,{alias:"appFormatLatency"});constructor(){o(()=>{let e=this.value();if(e==null){this._el.nativeElement.textContent="\u2014";return}e<1?this._el.nativeElement.textContent=`${(e*1e3).toFixed(0)}\u03BCs`:e<1e3?this._el.nativeElement.textContent=`${e.toFixed(0)}ms`:this._el.nativeElement.textContent=`${(e/1e3).toFixed(1)}s`})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=r({type:n,selectors:[["","appFormatLatency",""]],inputs:{value:[1,"appFormatLatency","value"]}})};var M=class n{_el=i(s);value=a(void 0,{alias:"appFormatNetwork"});constructor(){o(()=>{let e=this.value();if(e==null||e===0){this._el.nativeElement.textContent="0 B/s";return}let t=Math.abs(e);t<1024?this._el.nativeElement.textContent=`${Math.round(e)} B/s`:t<1024*1024?this._el.nativeElement.textContent=`${(e/1024).toFixed(1)} KB/s`:t<1024*1024*1024?this._el.nativeElement.textContent=`${(e/(1024*1024)).toFixed(1)} MB/s`:this._el.nativeElement.textContent=`${(e/(1024*1024*1024)).toFixed(2)} GB/s`})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=r({type:n,selectors:[["","appFormatNetwork",""]],inputs:{value:[1,"appFormatNetwork","value"]}})};var S=class n{_el=i(s);value=a(void 0,{alias:"appFormatPercentage"});constructor(){o(()=>{let e=this.value();if(e==null||e===0){this._el.nativeElement.textContent="0%";return}let t=e*100,l=Math.abs(t),c=l<100?1:0,d=t.toFixed(c);l>=10&&d.endsWith(".0")&&(d=d.slice(0,-2)),this._el.nativeElement.textContent=`${d}%`})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=r({type:n,selectors:[["","appFormatPercentage",""]],inputs:{value:[1,"appFormatPercentage","value"]}})};export{w as a,N as b,B as c,M as d,S as e,_ as f};