Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

Commit

Permalink
Prevent empty metric summary creation
Browse files Browse the repository at this point in the history
  • Loading branch information
gmlexx committed Apr 4, 2016
1 parent 499d3ef commit 604415f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions static/app/controllers/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ class MetricSummary {
list: Array<StateSummary> = [];

add(event: Event) {
if(event.state.name === event.old_state.name){
return;
}
var json = event.json;
var old_state_summary = this.states.getOrCreate(json.old_state, new StateSummary(event.old_state, json.timestamp));
var state_summary = this.states.getOrCreate(json.state, new StateSummary(event.state, json.timestamp));
Expand Down Expand Up @@ -124,6 +121,9 @@ export class EventsController extends GoTo {
if (!json.metric) {
return;
}
if(event.state.name === event.old_state.name){
return;
}
$scope.metrics_summary.getOrCreate(json.metric, new MetricSummary()).add(event);
var metricEvents = $scope.metrics_history.get(event.metric);
if (!metricEvents) {
Expand Down

0 comments on commit 604415f

Please sign in to comment.