Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
include spot requests which are internally tracked only into the pend…
Browse files Browse the repository at this point in the history
…ingCapcity info
  • Loading branch information
jhford committed Aug 23, 2016
1 parent 82ede01 commit 384837e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/api-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ function workerTypeSummary(workerType, workerState) {
} // note that other states are ignored
});

workerState.requests.forEach(request => {
summary.requestedCapacity += capacities[request.type] || 0;
});

return summary;
}

Expand Down
6 changes: 3 additions & 3 deletions src/aws-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,6 @@ class AwsManager {
stateForStorage(workerName) {
let instances = [];
let requests = [];
let internalTrackedRequests = [];

for (let instance of this.__apiState.instances) {
if (instance.WorkerType === workerName) {
Expand All @@ -1514,20 +1513,22 @@ class AwsManager {
region: request.Region,
zone: request.LaunchSpecification.Placement.AvailabilityZone,
time: request.CreateTime,
visibleToEC2Api: true,
status: request.Status.Code,
});
}
}

for (let request of this.__internalState) {
if (request.WorkerType === workerName) {
internalTrackedRequests.push({
requests.push({
id: request.SpotInstanceRequestId,
ami: request.LaunchSpecification.ImageId,
type: request.LaunchSpecification.InstanceType,
region: request.Region,
zone: request.LaunchSpecification.Placement.AvailabilityZone,
time: request.CreateTime,
visibleToEC2Api: false,
status: request.Status.Code,
});
}
Expand All @@ -1537,7 +1538,6 @@ class AwsManager {
workerType: workerName,
instances,
requests,
internalTrackedRequests,
};
}
}
Expand Down

0 comments on commit 384837e

Please sign in to comment.