2020-07-28 04:26:17 +00:00
|
|
|
import { computed } from '@ember/object';
|
2020-07-24 04:39:50 +00:00
|
|
|
import Fragment from 'ember-data-model-fragments/fragment';
|
|
|
|
import attr from 'ember-data/attr';
|
|
|
|
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
|
|
|
|
|
|
|
|
export default class ScaleEvent extends Fragment {
|
|
|
|
@fragmentOwner() taskGroupScale;
|
|
|
|
|
|
|
|
@attr('number') count;
|
|
|
|
@attr('number') previousCount;
|
|
|
|
@attr('boolean') error;
|
|
|
|
@attr('string') evalId;
|
|
|
|
|
2020-07-28 18:03:47 +00:00
|
|
|
@computed('count', function() {
|
|
|
|
return this.count != null;
|
|
|
|
})
|
|
|
|
hasCount;
|
|
|
|
|
2020-07-28 04:26:17 +00:00
|
|
|
@computed('count', 'previousCount', function() {
|
|
|
|
return this.count > this.previousCount;
|
|
|
|
})
|
|
|
|
increased;
|
|
|
|
|
2020-07-24 04:39:50 +00:00
|
|
|
@attr('date') time;
|
|
|
|
@attr('number') timeNanos;
|
|
|
|
|
|
|
|
@attr('string') message;
|
|
|
|
@attr() meta;
|
2020-07-28 04:26:17 +00:00
|
|
|
|
|
|
|
@computed('meta', function() {
|
|
|
|
return Object.keys(this.meta).length > 0;
|
|
|
|
})
|
|
|
|
hasMeta;
|
2020-08-05 18:55:17 +00:00
|
|
|
|
|
|
|
// Since scale events don't have proper IDs, this UID is a compromise
|
|
|
|
@computed('time', 'timeNanos', 'message', function() {
|
|
|
|
return `${+this.time}${this.timeNanos}_${this.message}`;
|
|
|
|
})
|
|
|
|
uid;
|
2020-07-24 04:39:50 +00:00
|
|
|
}
|