This is an automated email from the ASF dual-hosted git repository.
akshayrai09 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 6fc48ce [TE] frontend - harleyjj/alert-details - limit number of
anomalies displayed in graph (#3890)
6fc48ce is described below
commit 6fc48ce5cf44fa4e2bec55a6848efd3e468676a4
Author: Harley Jackson <[email protected]>
AuthorDate: Wed Feb 27 14:04:44 2019 -0800
[TE] frontend - harleyjj/alert-details - limit number of anomalies
displayed in graph (#3890)
---
.../app/pods/components/alert-details/component.js | 67 +++++++++++-----------
.../app/pods/components/alert-details/template.hbs | 6 --
2 files changed, 33 insertions(+), 40 deletions(-)
diff --git
a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
index 9c38947..8e967f0 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
@@ -80,11 +80,10 @@ export default Component.extend({
{ name: 'max4w', isActive: false},
{ name: 'none', isActive: false}
],
- sortColumnStartUp: false,
+ sortColumnStartUp: true,
sortColumnChangeUp: false,
- sortColumnNumberUp: true,
sortColumnFeedbackUp: false,
- selectedSortMode: '',
+ selectedSortMode: 'start:down',
selectedBaseline: 'wo1w',
pageSize: 10,
currentPage: 1,
@@ -264,26 +263,26 @@ export default Component.extend({
),
series: computed(
- 'anomalies',
+ 'paginatedFilteredAnomalies',
'timeseries',
'baseline',
'analysisRange',
function () {
const {
- metricUrn, anomalies, timeseries, baseline
- } = getProperties(this, 'metricUrn', 'anomalies', 'timeseries',
+ metricUrn, paginatedFilteredAnomalies, timeseries, baseline
+ } = getProperties(this, 'metricUrn', 'paginatedFilteredAnomalies',
'timeseries',
'baseline');
const series = {};
- if (!_.isEmpty(anomalies)) {
+ if (!_.isEmpty(paginatedFilteredAnomalies)) {
- anomalies
+ paginatedFilteredAnomalies
.filter(anomaly => anomaly.metricUrn === metricUrn)
.forEach(anomaly => {
- const key = this._formatAnomaly(anomaly);
+ const key = anomaly.startDateStr;
series[key] = {
- timestamps: [anomaly.startTime, anomaly.endTime],
+ timestamps: [anomaly.start, anomaly.end],
values: [1, 1],
type: 'line',
color: 'teal',
@@ -329,29 +328,30 @@ export default Component.extend({
const anomalies = get(this, 'anomalies');
const labelResponse = get(this, 'labelResponse');
let tableData = [];
- let i = 1;
-
- anomalies.forEach(a => {
- const change = (a.avgBaselineVal !== 0) ?
(a.avgCurrentVal/a.avgBaselineVal - 1.0) * 100.0 : 0;
- let tableRow = {
- number: i,
- anomalyId: a.id,
- start: a.startTime,
- startDateStr: this._formatAnomaly(a),
- durationStr: getFormattedDuration(a.startTime, a.endTime),
- shownCurrent: humanizeFloat(a.avgCurrentVal),
- shownBaseline: humanizeFloat(a.avgBaselineVal),
- change: change,
- shownChangeRate: humanizeFloat(change),
- anomalyFeedback: a.feedback ? a.feedback.feedbackType :
a.statusClassification,
- dimensionList: Object.keys(a.dimensions),
- dimensions: a.dimensions,
- showResponseSaved: (labelResponse.anomalyId === a.id) ?
labelResponse.showResponseSaved : false,
- showResponseFailed: (labelResponse.anomalyId === a.id) ?
labelResponse.showResponseFailed: false
- };
- tableData.push(tableRow);
- i++;
- });
+
+ if (anomalies) {
+ anomalies.forEach(a => {
+ const change = (a.avgBaselineVal !== 0) ?
(a.avgCurrentVal/a.avgBaselineVal - 1.0) * 100.0 : 0;
+ let tableRow = {
+ anomalyId: a.id,
+ metricUrn: a.metricUrn,
+ start: a.startTime,
+ end: a.endTime,
+ startDateStr: this._formatAnomaly(a),
+ durationStr: getFormattedDuration(a.startTime, a.endTime),
+ shownCurrent: humanizeFloat(a.avgCurrentVal),
+ shownBaseline: humanizeFloat(a.avgBaselineVal),
+ change: change,
+ shownChangeRate: humanizeFloat(change),
+ anomalyFeedback: a.feedback ? a.feedback.feedbackType :
a.statusClassification,
+ dimensionList: Object.keys(a.dimensions),
+ dimensions: a.dimensions,
+ showResponseSaved: (labelResponse.anomalyId === a.id) ?
labelResponse.showResponseSaved : false,
+ showResponseFailed: (labelResponse.anomalyId === a.id) ?
labelResponse.showResponseFailed: false
+ };
+ tableData.push(tableRow);
+ });
+ }
return tableData;
}
),
@@ -628,7 +628,6 @@ export default Component.extend({
const anomalies = get(this, 'anomalies');
// Reset status icon
set(this, 'renderStatusIcon', false);
-
const responseObj = anomalyResponseObj.find(res => res.name ===
selectedResponse);
// get the response object from anomalyResponseObjNew
const newFeedbackValue = anomalyResponseObjNew.find(res => res.name ===
selectedResponse).value;
diff --git
a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/template.hbs
b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/template.hbs
index e244671..9f122b0 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/template.hbs
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/template.hbs
@@ -101,11 +101,6 @@
<thead>
<tr class="te-anomaly-table__row te-anomaly-table__head">
<th class="te-anomaly-table__cell-head
te-anomaly-table__cell-head--left">
- <a class="te-anomaly-table__cell-link" {{action
"toggleSortDirection" "number"}}>#
- <i class="te-anomaly-table__icon glyphicon {{if
sortColumnNumberUp "glyphicon-menu-down" "glyphicon-menu-up"}}"></i>
- </a>
- </th>
- <th class="te-anomaly-table__cell-head
te-anomaly-table__cell-head--left">
<a class="te-anomaly-table__cell-link" {{action
"toggleSortDirection" "start"}}>
Start/Duration (PDT)
<i class="te-anomaly-table__icon glyphicon {{if
sortColumnStartUp "glyphicon-menu-up" "glyphicon-menu-down"}}"></i>
@@ -135,7 +130,6 @@
<tbody>
{{#each paginatedFilteredAnomalies as |anomaly|}}
<tr class="te-anomaly-table__row">
- <td class="te-anomaly-table__cell
te-anomaly-table__cell--index">{{anomaly.number}}</td>
<td class="te-anomaly-table__cell">
<ul class="te-anomaly-table__list
te-anomaly-table__list--left">
<li class="te-anomaly-table__list-item
te-anomaly-table__list-item--stronger">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]