renderData()

in ui/angular/src/app/health/health.component.ts [180:231]


  renderData() {
    let url_dashboard = this.serviceService.config.uri.dashboard;
    this.http.get(url_dashboard).subscribe(data => {
      this.mesWithJob = JSON.parse(JSON.stringify(data));
      for (let i = 0; i < this.mesWithJob.length; i++) {
        if (this.mesWithJob[i].some(this.checkvalue)) {
          this.mesWithJob[i].splice(i, 1);
        }
      }
      for (let mesName in this.mesWithJob) {
        var jobs = this.mesWithJob[mesName];
        if (
          jobs.length > 0 && jobs[0].type == "ACCURACY"
        ) {
          var jobs = this.mesWithJob[mesName];
          var node = null;
          node = new Object();
          node.name = mesName;
          node.dq = 0;
          node.metrics = [];
          node.type = "ACCURACY";
          for (let i = 0; i < jobs.length; i++) {
            if (jobs[i].metricValues.length != 0) {
              var metricNode = {
                name: "",
                timestamp: "",
                dq: 0,
                details: []
              };
              metricNode.details = JSON.parse(
                JSON.stringify(jobs[i].metricValues)
              );
              metricNode.name = jobs[i].name;
              metricNode.timestamp = jobs[i].metricValues[0].tmst;
              metricNode.dq =
                jobs[i].metricValues[0].value.matched /
                jobs[i].metricValues[0].value.total *
                100;
              node.metrics.push(metricNode);
            }
          }
        } else {
          continue;
        }
        this.finalData.push(node);
      }
      var self = this;
      setTimeout(function function_name(argument) {
        self.renderTreeMap(self.finalData);
      }, 1000);
    });
  }