Skip to content

Commit

Permalink
[FLINK-13386][web]: Fix operators/tasks metrics sort
Browse files Browse the repository at this point in the history
  • Loading branch information
vthinkxie authored and dawidwys committed Sep 27, 2019
1 parent fe254a3 commit 0078e7a
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,23 @@ export class MetricsService {
* @param vertexId
*/
getAllAvailableMetrics(jobId: string, vertexId: string) {
return this.httpClient.get<Array<{ id: string; value: string }>>(
`${BASE_URL}/jobs/${jobId}/vertices/${vertexId}/metrics`
);
return this.httpClient
.get<Array<{ id: string; value: string }>>(`${BASE_URL}/jobs/${jobId}/vertices/${vertexId}/metrics`)
.pipe(
map(item =>
item.sort((pre, next) => {
const preId = pre.id.toLowerCase();
const nextId = next.id.toLowerCase();
if (preId < nextId) {
return -1;
} else if (preId > nextId) {
return 1;
} else {
return 0;
}
})
)
);
}

/**
Expand Down

0 comments on commit 0078e7a

Please sign in to comment.