Merge pull request #124 from rjnagal/cpumask
Fix cpu limit to report cpu shares.
This commit is contained in:
commit
02b06eab65
@ -36,6 +36,7 @@ var funcMap = template.FuncMap{
|
||||
"containerLink": containerLink,
|
||||
"printMask": printMask,
|
||||
"printCores": printCores,
|
||||
"printShares": printShares,
|
||||
"printMegabytes": printMegabytes,
|
||||
"getMemoryUsage": getMemoryUsage,
|
||||
"getMemoryUsagePercent": getMemoryUsagePercent,
|
||||
@ -138,6 +139,10 @@ func printCores(millicores *uint64) string {
|
||||
return strconv.FormatFloat(cores, 'f', 3, 64)
|
||||
}
|
||||
|
||||
func printShares(shares *uint64) string {
|
||||
return fmt.Sprintf("%d", *shares)
|
||||
}
|
||||
|
||||
func toMegabytes(bytes uint64) float64 {
|
||||
return float64(bytes) / (1 << 20)
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ const containersHtmlTemplate = `
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item active isolation-title panel-title">CPU</li>
|
||||
{{if .Spec.Cpu.Limit}}
|
||||
<li class="list-group-item"><span class="stat-label">Limit</span> {{printCores .Spec.Cpu.Limit}} <span class="unit-label">cores</span></li>
|
||||
<li class="list-group-item"><span class="stat-label">Shares</span> {{printShares .Spec.Cpu.Limit}} <span class="unit-label">shares</span></li>
|
||||
{{end}}
|
||||
{{if .Spec.Cpu.MaxLimit}}
|
||||
<li class="list-group-item"><span class="stat-label">Max Limit</span> {{printCores .Spec.Cpu.MaxLimit}} <span class="unit-label">cores</span></li>
|
||||
|
Loading…
Reference in New Issue
Block a user