# Two stores at different nodes.

store store-id=1 node-id=1 attrs=green locality-tiers=region=us-west
----

store store-id=2 node-id=2 attrs=green locality-tiers=region=us-east
----

# -1 is parentCapacity.
store-load store-id=1 load=(10,100,1000) capacity=(-1,400,8000) secondary-load=80
----

store-load store-id=2 load=(20,200,4000) capacity=(-1,500,4000) secondary-load=100
----

node-load node-id=1 cpu-load=200 cpu-capacity=1000
----

node-load node-id=2 cpu-load=250 cpu-capacity=500
----

get-means
+=green
----
stores: 1, 2
store-means (load,cap,util): cpu: (15, parent, 0.00) write-bw: (150, 450, 0.33) bytes: (2500, 6000, 0.42)
   secondary-load: [90]
node-mean cpu (load,cap,util): (225, 750, 0.30)

# Store summary calls out to computeLoadSummary when the load-seq-num increases.

# Initial call.
get-store-summary store-id=1 load-seq-num=4
----
called computeLoadSummary: returning seqnum 4

# Uses cached value.
get-store-summary store-id=1 load-seq-num=4
----

# Calls again.
get-store-summary store-id=1 load-seq-num=6
----
called computeLoadSummary: returning seqnum 6

# Initial call for store 2.
get-store-summary store-id=2 load-seq-num=0
----
called computeLoadSummary: returning seqnum 0

# Add another store that is on the same node as store 1.
store store-id=3 node-id=1 attrs=green locality-tiers=region=us-west
----

store-load store-id=3 load=(100,200,400) capacity=(-1,800,1600) secondary-load=120
----

# Mean is unchanged since cached.
get-means
+=green
----
stores: 1, 2
store-means (load,cap,util): cpu: (15, parent, 0.00) write-bw: (150, 450, 0.33) bytes: (2500, 6000, 0.42)
   secondary-load: [90]
node-mean cpu (load,cap,util): (225, 750, 0.30)

clear
----

# Mean is recomputed. The node mean does not count the same node twice (hence
# is unchanged).
get-means
+=green
----
stores: 1, 2, 3
store-means (load,cap,util): cpu: (43, parent, 0.00) write-bw: (166, 566, 0.29) bytes: (1800, 4533, 0.40)
   secondary-load: [100]
node-mean cpu (load,cap,util): (225, 750, 0.30)
