change CPU and Memory to lowercase because resoure name is case-sensitive

This commit is contained in:
Li Bo
2021-08-20 14:46:58 +08:00
parent cdefcc3a8b
commit 34d7331e4e
@@ -92,9 +92,9 @@ shape:
``` yaml ``` yaml
resources: resources:
- name: CPU - name: cpu
weight: 1 weight: 1
- name: Memory - name: memory
weight: 1 weight: 1
``` ```
@@ -104,9 +104,9 @@ It can be used to add extended resources as follows:
resources: resources:
- name: intel.com/foo - name: intel.com/foo
weight: 5 weight: 5
- name: CPU - name: cpu
weight: 3 weight: 3
- name: Memory - name: memory
weight: 1 weight: 1
``` ```
@@ -123,16 +123,16 @@ Requested resources:
``` ```
intel.com/foo : 2 intel.com/foo : 2
Memory: 256MB memory: 256MB
CPU: 2 cpu: 2
``` ```
Resource weights: Resource weights:
``` ```
intel.com/foo : 5 intel.com/foo : 5
Memory: 1 memory: 1
CPU: 3 cpu: 3
``` ```
FunctionShapePoint {{0, 0}, {100, 10}} FunctionShapePoint {{0, 0}, {100, 10}}
@@ -142,13 +142,13 @@ Node 1 spec:
``` ```
Available: Available:
intel.com/foo: 4 intel.com/foo: 4
Memory: 1 GB memory: 1 GB
CPU: 8 cpu: 8
Used: Used:
intel.com/foo: 1 intel.com/foo: 1
Memory: 256MB memory: 256MB
CPU: 1 cpu: 1
``` ```
Node score: Node score:
@@ -161,13 +161,13 @@ intel.com/foo = resourceScoringFunction((2+1),4)
= rawScoringFunction(75) = rawScoringFunction(75)
= 7 # floor(75/10) = 7 # floor(75/10)
Memory = resourceScoringFunction((256+256),1024) memory = resourceScoringFunction((256+256),1024)
= (100 -((1024-512)*100/1024)) = (100 -((1024-512)*100/1024))
= 50 # requested + used = 50% * available = 50 # requested + used = 50% * available
= rawScoringFunction(50) = rawScoringFunction(50)
= 5 # floor(50/10) = 5 # floor(50/10)
CPU = resourceScoringFunction((2+1),8) cpu = resourceScoringFunction((2+1),8)
= (100 -((8-3)*100/8)) = (100 -((8-3)*100/8))
= 37.5 # requested + used = 37.5% * available = 37.5 # requested + used = 37.5% * available
= rawScoringFunction(37.5) = rawScoringFunction(37.5)
@@ -182,12 +182,12 @@ Node 2 spec:
``` ```
Available: Available:
intel.com/foo: 8 intel.com/foo: 8
Memory: 1GB memory: 1GB
CPU: 8 cpu: 8
Used: Used:
intel.com/foo: 2 intel.com/foo: 2
Memory: 512MB memory: 512MB
CPU: 6 cpu: 6
``` ```
Node score: Node score:
@@ -200,13 +200,13 @@ intel.com/foo = resourceScoringFunction((2+2),8)
= rawScoringFunction(50) = rawScoringFunction(50)
= 5 = 5
Memory = resourceScoringFunction((256+512),1024) memory = resourceScoringFunction((256+512),1024)
= (100 -((1024-768)*100/1024)) = (100 -((1024-768)*100/1024))
= 75 = 75
= rawScoringFunction(75) = rawScoringFunction(75)
= 7 = 7
CPU = resourceScoringFunction((2+6),8) cpu = resourceScoringFunction((2+6),8)
= (100 -((8-8)*100/8)) = (100 -((8-8)*100/8))
= 100 = 100
= rawScoringFunction(100) = rawScoringFunction(100)