All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.4398.9502b64842b19391.js Maven / Gradle / Ivy

There is a newer version: 2.0-preview1
Show newest version
"use strict";(self.webpackChunkflink=self.webpackChunkflink||[]).push([[4398],{4398:(P,p,r)=>{r.r(p),r.d(p,{JobOverviewDrawerChartComponent:()=>L});var m=r(36895),c=r(24006),f=r(77579),v=r(71884),l=r(82722),M=r(39300),b=r(95577),t=r(94650),z=r(30170),O=r(7963),u=r(46470),y=r(82315);let J=(()=>{class n{transform(e,i){if((0,O.k)(e))return"-";let s="";return s=/bytes/i.test(i)&&/persecond/i.test(i)?`${(new u.E).transform(e)} / s`:/bytes/i.test(i)?(new u.E).transform(e):/persecond/i.test(i)?`${e} / s`:/time/i.test(i)||/latency/i.test(i)?(new y.w).transform(e,!0):`${e}`,s}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275pipe=t.Yjl({name:"humanizeChartNumeric",type:n,pure:!0,standalone:!0}),n})();var h=r(66616),g=r(21102),x=r(97526),T=r(47044),w=r(21811);const S=["chart"];let C=(()=>{class n{constructor(e,i){this.cdr=e,this.jobChartService=i,this.closed=new t.vpe,this.size="small",this.displayMode="chart",this.data=[],this.destroy$=new f.x}get isBig(){return"big"===this.size}refresh(e){this.latestValue=e.values[this.title],"numeric"===this.displayMode&&this.cdr.detectChanges(),this.data.push({time:e.timestamp,value:this.latestValue,type:this.title}),this.data.length>20&&this.data.shift(),this.chartInstance&&this.chartInstance.changeData(this.data)}setMode(e){this.displayMode=e,this.cdr.detectChanges()}resize(e){this.size=e,this.cdr.detectChanges(),setTimeout(()=>this.chartInstance.forceFit())}close(){this.closed.emit(this.title)}ngAfterViewInit(){this.cdr.detach(),this.chartInstance=new z.kL({container:this.chart.nativeElement,height:150,autoFit:!0,padding:"auto"}),this.chartInstance.legend(!1),this.chartInstance.data(this.data),this.chartInstance.scale({time:{alias:"Time",type:"time",mask:"HH:mm:ss",tickCount:3},type:{type:"cat"}}),this.chartInstance.line().position("time*value").shape("smooth").color("type").size(2).animate({update:{duration:0}}),this.chartInstance.render(),this.jobChartService.resize$.pipe((0,l.R)(this.destroy$)).subscribe(()=>{this.chartInstance&&setTimeout(()=>{this.chartInstance.forceFit()})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.chartInstance&&this.chartInstance.destroy()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.sBO),t.Y36(x.E))},n.\u0275cmp=t.Xpm({type:n,selectors:[["flink-job-chart"]],viewQuery:function(e,i){if(1&e&&t.Gf(S,7),2&e){let s;t.iGM(s=t.CRH())&&(i.chart=s.first)}},hostVars:2,hostBindings:function(e,i){2&e&&t.ekj("big",i.isBig)},inputs:{title:"title"},outputs:{closed:"closed"},standalone:!0,features:[t.jDz],decls:24,vars:15,consts:[[1,"chart"],[1,"title"],[1,"text"],[1,"operate"],[3,"nzSize"],["nz-button","",3,"nzType","click"],["nz-button","",1,"close",3,"nzSize","click"],["nz-icon","","nzType","close","nzTheme","outline"],[1,"content"],[3,"hidden"],["chart",""],[1,"numeric",3,"hidden"],[1,"type-switch"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.qZA(),t.TgZ(4,"div",3)(5,"nz-button-group",4)(6,"button",5),t.NdJ("click",function(){return i.resize("big")}),t._uU(7," Big "),t.qZA(),t.TgZ(8,"button",5),t.NdJ("click",function(){return i.resize("small")}),t._uU(9," Small "),t.qZA()(),t.TgZ(10,"button",6),t.NdJ("click",function(){return i.close()}),t._UZ(11,"i",7),t.qZA()()(),t.TgZ(12,"div",8),t._UZ(13,"div",9,10),t.TgZ(15,"div",11),t._uU(16),t.ALo(17,"humanizeChartNumeric"),t.qZA(),t.TgZ(18,"div",12)(19,"nz-button-group",4)(20,"button",5),t.NdJ("click",function(){return i.setMode("chart")}),t._uU(21," Chart "),t.qZA(),t.TgZ(22,"button",5),t.NdJ("click",function(){return i.setMode("numeric")}),t._uU(23," Numeric "),t.qZA()()()()()),2&e&&(t.xp6(2),t.uIk("title",i.title),t.xp6(1),t.Oqu(i.title),t.xp6(2),t.Q6J("nzSize","small"),t.xp6(1),t.Q6J("nzType","big"===i.size?"primary":"default"),t.xp6(2),t.Q6J("nzType","small"===i.size?"primary":"default"),t.xp6(2),t.Q6J("nzSize","small"),t.xp6(3),t.Q6J("hidden","numeric"===i.displayMode),t.xp6(2),t.Q6J("hidden","chart"===i.displayMode),t.xp6(1),t.hij(" ",t.xi3(17,12,i.latestValue,i.title)," "),t.xp6(3),t.Q6J("nzSize","small"),t.xp6(1),t.Q6J("nzType","chart"===i.displayMode?"primary":"default"),t.xp6(2),t.Q6J("nzType","numeric"===i.displayMode?"primary":"default"))},dependencies:[h.sL,h.ix,h.fY,T.w,w.dQ,g.PV,g.Ls,J],styles:["[_nghost-%COMP%]{float:left;width:33.33%;margin-bottom:12px;padding:12px}.big[_nghost-%COMP%]{width:100%}.close[_ngcontent-%COMP%]{margin-left:8px}.chart[_ngcontent-%COMP%]{position:relative;border:1px solid #f0f0f0}.title[_ngcontent-%COMP%]{position:relative;padding:12px;border-bottom:1px solid #f0f0f0}.text[_ngcontent-%COMP%]{overflow:hidden;max-width:calc(100% - 128px);font-size:12px;line-height:24px;text-overflow:ellipsis}.operate[_ngcontent-%COMP%]{position:absolute;top:12px;right:12px;display:flex;align-items:center}.content[_ngcontent-%COMP%]{padding:12px}.content[_ngcontent-%COMP%]   .numeric[_ngcontent-%COMP%]{font-size:32px;line-height:150px;text-align:center}button[_ngcontent-%COMP%]{transition:none}"],changeDetection:0}),n})();var d=r(38231),_=r(105),Z=r(47932);function j(n,o){1&n&&(t.TgZ(0,"span"),t._uU(1,"No Available Metric"),t.qZA())}function N(n,o){if(1&n&&(t.TgZ(0,"nz-option",7)(1,"span",8),t._uU(2),t.qZA()()),2&n){const e=o.$implicit;t.Q6J("nzLabel",e)("nzValue",e),t.xp6(1),t.Q6J("title",e),t.xp6(1),t.Oqu(e)}}function Q(n,o){if(1&n){const e=t.EpF();t._uU(0," Add Metric: "),t.TgZ(1,"nz-select",5),t.NdJ("ngModelChange",function(s){t.CHM(e);const a=t.oxw();return t.KtG(a.updateMetric(s))}),t.YNc(2,N,3,4,"nz-option",6),t.qZA()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",null)("nzPlaceHolder","Select Metric Name"),t.xp6(1),t.Q6J("ngForOf",e.listOfUnselectedMetric)}}function A(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"flink-job-chart",9),t.NdJ("closed",function(s){t.CHM(e);const a=t.oxw();return t.KtG(a.closeMetric(s))}),t.qZA()}2&n&&t.Q6J("title",o.$implicit)}let L=(()=>{class n{constructor(e,i,s){this.metricsService=e,this.jobLocalService=i,this.cdr=s,this.data=[],this.listOfMetricName=[],this.listOfSelectedMetric=[],this.listOfUnselectedMetric=[],this.destroy$=new f.x}ngOnInit(){this.jobLocalService.jobWithVertexChanges().pipe((0,v.x)((e,i)=>e.vertex.id===i.vertex.id),(0,l.R)(this.destroy$)).subscribe(e=>{this.loadMetricList(e.job.jid,e.vertex.id)}),this.jobLocalService.jobWithVertexChanges().pipe((0,M.h)(()=>this.listOfSelectedMetric.length>0),(0,b.z)(e=>this.metricsService.loadMetrics(e.job.jid,e.vertex.id,this.listOfSelectedMetric)),(0,l.R)(this.destroy$)).subscribe(e=>{this.listOfJobChartComponent&&this.listOfJobChartComponent.length&&this.listOfJobChartComponent.forEach(i=>{i.refresh(e)}),this.cdr.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadMetricList(e,i){this.cacheMetricKey=`${e}/${i}`,this.metricsService.loadAllAvailableMetrics(e,i).subscribe(s=>{this.listOfMetricName=s.map(a=>a.id),this.listOfSelectedMetric=this.jobLocalService.metricsCacheMap.get(this.cacheMetricKey)||[],this.updateUnselectedMetricList(),this.cdr.markForCheck()})}updateMetric(e){this.listOfSelectedMetric=[...this.listOfSelectedMetric,e],this.jobLocalService.metricsCacheMap.set(this.cacheMetricKey,this.listOfSelectedMetric),this.updateUnselectedMetricList()}closeMetric(e){this.listOfSelectedMetric=this.listOfSelectedMetric.filter(i=>i!==e),this.jobLocalService.metricsCacheMap.set(this.cacheMetricKey,this.listOfSelectedMetric),this.updateUnselectedMetricList()}updateUnselectedMetricList(){this.listOfUnselectedMetric=this.listOfMetricName.filter(e=>-1===this.listOfSelectedMetric.indexOf(e))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(_.K),t.Y36(Z.R),t.Y36(t.sBO))},n.\u0275cmp=t.Xpm({type:n,selectors:[["flink-job-overview-drawer-chart"]],viewQuery:function(e,i){if(1&e&&t.Gf(C,5),2&e){let s;t.iGM(s=t.CRH())&&(i.listOfJobChartComponent=s)}},standalone:!0,features:[t.jDz],decls:6,vars:3,consts:[[1,"metric-selector"],[4,"ngIf","ngIfElse"],["elseTemplate",""],[1,"metric-area"],[3,"title","closed",4,"ngFor","ngForOf"],["nzSize","small","nzShowSearch","",3,"ngModel","nzPlaceHolder","ngModelChange"],["nzCustomContent","",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzCustomContent","",3,"nzLabel","nzValue"],[3,"title"],[3,"title","closed"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0),t.YNc(1,j,2,0,"span",1),t.YNc(2,Q,3,3,"ng-template",null,2,t.W1O),t.qZA(),t.TgZ(4,"div",3),t.YNc(5,A,1,1,"flink-job-chart",4),t.qZA()),2&e){const s=t.MAs(3);t.xp6(1),t.Q6J("ngIf",0===i.listOfMetricName.length)("ngIfElse",s),t.xp6(4),t.Q6J("ngForOf",i.listOfSelectedMetric)}},dependencies:[m.O5,d.LV,d.Ip,d.Vq,c.u5,c.JJ,c.On,m.sg,C],styles:["nz-select[_ngcontent-%COMP%]{width:300px}.metric-selector[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%]{display:block;padding:16px}"],changeDetection:0}),n})()}}]);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy