1 import { HttpClient } from "@angular/common/http";
2 import { Component, OnInit } from "@angular/core";
3 import { ActivatedRoute } from '@angular/router';
4 import { NzMessageService } from "ng-zorro-antd";
5 import { intentBaseService } from "../../../../core/services/intentBase.service";
8 selector: "app-monitor-facps-service",
9 templateUrl: "./monitor-facps-service.component.html",
10 styleUrls: ["./monitor-facps-service.component.less"],
12 export class MonitorFacpsServiceComponent implements OnInit {
15 private nzMessage: NzMessageService,
16 private myHttp: intentBaseService,
17 private http: HttpClient,
18 private route: ActivatedRoute
21 selectedSubscriptionType: string = "";
22 selectedServiceInstance: string = "";
23 selectedTopology: string = "";
24 instanceId: string = "";
28 legend: { bottom: "0px", data: ["RATE", "MAXRATE"] },
34 itemStyle: { color: "#70ACEC" },
58 instanceLists: any[] = [];
59 progressSetTimeOut: any;
62 this.route.queryParams.subscribe(
64 this.instanceId= params['instanceId'];
65 if (this.instanceId) {
66 this.queryInstancePerformance(this.instanceId);
70 this.getFinishedInstanceInfo();
73 height: this.initData.height,
74 width: this.initData.width,
77 tooltip: this.initData.option.tooltip,
79 legend: this.initData.option.legend,
80 dataZoom: this.initData.option.dataZoom,
108 data: this.initData.option.xAxis.data,
126 series: this.initData.option.series,
131 this.chartIntance = chart;
134 getFinishedInstanceInfo() {
135 this.myHttp.getFinishedInstanceInfo().subscribe(
137 const { code, message, data } = response;
139 this.nzMessage.error(message);
142 this.instanceLists = [...data];
150 queryInstancePerformance(instanceId) {
151 const requery = () => {
152 this.myHttp.queryInstancePerformanceData({ instanceId}).subscribe(
154 const { code, message, data } = response;
156 this.nzMessage.error(message);
158 if(this.chartIntance) {
159 this.updateOption = data;
163 if (this.progressSetTimeOut) {
164 clearInterval(this.progressSetTimeOut);
167 this.progressSetTimeOut = setTimeout(() => {