c3vis icon indicating copy to clipboard operation
c3vis copied to clipboard

Graph not rendering if instance is running a container with no memory reserve set

Open kwilsonO opened this issue 9 years ago • 2 comments

https://github.com/ExpediaDotCom/c3vis/blob/da7d0244d36c3b44d40389b05688a46e9c73cdfc/public/javascripts/graph.js#L64

Not sure if this is specific to our use case, but we have a handful of containers that do not have a memory reserve set, for those the line referenced above returns NaN causing any bar that contains a container without a mem reserve set not to render.

I'm not a js developer but I was able to fix this by changing the above line to the following:

var resourceAllocation = task.taskDefinition.containerDefinitions.reduce(function (sum, b) { return sum + (resourceType == ResourceEnum.MEMORY ? ( isNaN(b.memory) || (b.memory == null) ? 0 : b.memory ) : b.cpu); }, 0);

kwilsonO avatar Nov 08 '17 21:11 kwilsonO

Thanks @kwilsonO. Feel free to put together a Pull Request for this.

mattcallanan avatar Nov 09 '17 12:11 mattcallanan

@kwilsonO this should be fixed by release 0.5.0.

I'll close this issue for now, but let us know if not fixed and we can address.

mattcallanan avatar May 29 '18 14:05 mattcallanan