|
@@ -20,42 +20,43 @@ import Converter from 'yarn-ui/utils/converter';
|
|
import DS from 'ember-data';
|
|
import DS from 'ember-data';
|
|
|
|
|
|
export default DS.Model.extend({
|
|
export default DS.Model.extend({
|
|
- appName: DS.attr('string'),
|
|
|
|
- user: DS.attr('string'),
|
|
|
|
- queue: DS.attr('string'),
|
|
|
|
- state: DS.attr('string'),
|
|
|
|
- startTime: DS.attr('string'),
|
|
|
|
- elapsedTime: DS.attr('string'),
|
|
|
|
- finalStatus: DS.attr('string'),
|
|
|
|
- finishedTime: DS.attr('finishedTime'),
|
|
|
|
- progress: DS.attr('number'),
|
|
|
|
- diagnostics: DS.attr('string'),
|
|
|
|
- amContainerLogs: DS.attr('string'),
|
|
|
|
- amHostHttpAddress: DS.attr('string'),
|
|
|
|
- logAggregationStatus: DS.attr('string'),
|
|
|
|
- unmanagedApplication: DS.attr('boolean'),
|
|
|
|
- amNodeLabelExpression: DS.attr('string'),
|
|
|
|
- applicationTags: DS.attr('string'),
|
|
|
|
- applicationType: DS.attr('string'),
|
|
|
|
- priority: DS.attr('string'),
|
|
|
|
- allocatedMB: DS.attr('number'),
|
|
|
|
- allocatedVCores: DS.attr('number'),
|
|
|
|
- runningContainers: DS.attr('number'),
|
|
|
|
- memorySeconds: DS.attr('number'),
|
|
|
|
- vcoreSeconds: DS.attr('number'),
|
|
|
|
- preemptedResourceMB: DS.attr('number'),
|
|
|
|
- preemptedResourceVCores: DS.attr('number'),
|
|
|
|
- numNonAMContainerPreempted: DS.attr('number'),
|
|
|
|
- numAMContainerPreempted: DS.attr('number'),
|
|
|
|
- clusterUsagePercentage: DS.attr('number'),
|
|
|
|
- queueUsagePercentage: DS.attr('number'),
|
|
|
|
- currentAppAttemptId: DS.attr('string'),
|
|
|
|
- remainingTimeoutInSeconds: DS.attr('number'),
|
|
|
|
- applicationExpiryTime: DS.attr('string'),
|
|
|
|
- resourceRequests: DS.attr('array'),
|
|
|
|
|
|
+ appName: DS.attr("string"),
|
|
|
|
+ user: DS.attr("string"),
|
|
|
|
+ queue: DS.attr("string"),
|
|
|
|
+ state: DS.attr("string"),
|
|
|
|
+ startTime: DS.attr("string"),
|
|
|
|
+ elapsedTime: DS.attr("string"),
|
|
|
|
+ finalStatus: DS.attr("string"),
|
|
|
|
+ finishedTime: DS.attr("finishedTime"),
|
|
|
|
+ progress: DS.attr("number"),
|
|
|
|
+ diagnostics: DS.attr("string"),
|
|
|
|
+ amContainerLogs: DS.attr("string"),
|
|
|
|
+ amHostHttpAddress: DS.attr("string"),
|
|
|
|
+ masterNodeId: DS.attr("string"),
|
|
|
|
+ logAggregationStatus: DS.attr("string"),
|
|
|
|
+ unmanagedApplication: DS.attr("boolean"),
|
|
|
|
+ amNodeLabelExpression: DS.attr("string"),
|
|
|
|
+ applicationTags: DS.attr("string"),
|
|
|
|
+ applicationType: DS.attr("string"),
|
|
|
|
+ priority: DS.attr("string"),
|
|
|
|
+ allocatedMB: DS.attr("number"),
|
|
|
|
+ allocatedVCores: DS.attr("number"),
|
|
|
|
+ runningContainers: DS.attr("number"),
|
|
|
|
+ memorySeconds: DS.attr("number"),
|
|
|
|
+ vcoreSeconds: DS.attr("number"),
|
|
|
|
+ preemptedResourceMB: DS.attr("number"),
|
|
|
|
+ preemptedResourceVCores: DS.attr("number"),
|
|
|
|
+ numNonAMContainerPreempted: DS.attr("number"),
|
|
|
|
+ numAMContainerPreempted: DS.attr("number"),
|
|
|
|
+ clusterUsagePercentage: DS.attr("number"),
|
|
|
|
+ queueUsagePercentage: DS.attr("number"),
|
|
|
|
+ currentAppAttemptId: DS.attr("string"),
|
|
|
|
+ remainingTimeoutInSeconds: DS.attr("number"),
|
|
|
|
+ applicationExpiryTime: DS.attr("string"),
|
|
|
|
+ resourceRequests: DS.attr("array"),
|
|
|
|
|
|
isFailed: function() {
|
|
isFailed: function() {
|
|
- return this.get('finalStatus') === "FAILED";
|
|
|
|
|
|
+ return this.get("finalStatus") === "FAILED";
|
|
}.property("finalStatus"),
|
|
}.property("finalStatus"),
|
|
|
|
|
|
validatedFinishedTs: function() {
|
|
validatedFinishedTs: function() {
|
|
@@ -70,27 +71,42 @@ export default DS.Model.extend({
|
|
}.property("hasFinishedTime"),
|
|
}.property("hasFinishedTime"),
|
|
|
|
|
|
formattedElapsedTime: function() {
|
|
formattedElapsedTime: function() {
|
|
- return Converter.msToElapsedTimeUnit(this.get('elapsedTime'));
|
|
|
|
- }.property('elapsedTime'),
|
|
|
|
|
|
+ return Converter.msToElapsedTimeUnit(this.get("elapsedTime"));
|
|
|
|
+ }.property("elapsedTime"),
|
|
|
|
|
|
allocatedResource: function() {
|
|
allocatedResource: function() {
|
|
- return Converter.resourceToString(this.get("allocatedMB"), this.get("allocatedVCores"));
|
|
|
|
|
|
+ return Converter.resourceToString(
|
|
|
|
+ this.get("allocatedMB"),
|
|
|
|
+ this.get("allocatedVCores")
|
|
|
|
+ );
|
|
}.property("allocatedMB", "allocatedVCores"),
|
|
}.property("allocatedMB", "allocatedVCores"),
|
|
|
|
|
|
preemptedResource: function() {
|
|
preemptedResource: function() {
|
|
- return Converter.resourceToString(this.get("preemptedResourceMB"), this.get("preemptedResourceVCores"));
|
|
|
|
|
|
+ return Converter.resourceToString(
|
|
|
|
+ this.get("preemptedResourceMB"),
|
|
|
|
+ this.get("preemptedResourceVCores")
|
|
|
|
+ );
|
|
}.property("preemptedResourceMB", "preemptedResourceVCores"),
|
|
}.property("preemptedResourceMB", "preemptedResourceVCores"),
|
|
|
|
|
|
aggregatedResourceUsage: function() {
|
|
aggregatedResourceUsage: function() {
|
|
- return Converter.resourceToString(this.get("memorySeconds"), this.get("vcoreSeconds")) + " (× Secs)";
|
|
|
|
|
|
+ return (
|
|
|
|
+ Converter.resourceToString(
|
|
|
|
+ this.get("memorySeconds"),
|
|
|
|
+ this.get("vcoreSeconds")
|
|
|
|
+ ) + " (× Secs)"
|
|
|
|
+ );
|
|
}.property("memorySeconds", "vcoreSeconds"),
|
|
}.property("memorySeconds", "vcoreSeconds"),
|
|
|
|
|
|
|
|
+ masterNodeURL: function() {
|
|
|
|
+ return `#/yarn-node/${this.get("masterNodeId")}/${this.get("amHostHttpAddress")}/info/`;
|
|
|
|
+ }.property("masterNodeId", "amHostHttpAddress"),
|
|
|
|
+
|
|
progressStyle: function() {
|
|
progressStyle: function() {
|
|
return "width: " + this.get("progress") + "%";
|
|
return "width: " + this.get("progress") + "%";
|
|
}.property("progress"),
|
|
}.property("progress"),
|
|
|
|
|
|
runningContainersNumber: function() {
|
|
runningContainersNumber: function() {
|
|
- if(this.get("runningContainers") < 0) {
|
|
|
|
|
|
+ if (this.get("runningContainers") < 0) {
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
return this.get("runningContainers");
|
|
return this.get("runningContainers");
|