package Ġcom . mf helm . pod aut oscaler . test Ċ Ċ import Ġcom . mf helm . pod aut oscaler . scaler . config . rule set . Log arith mic Scale Rule Ċ import Ġcom . mf helm . pod aut oscaler . scaler . config . rule set . Log arith mic Scale Rule set Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġkotlin . test . assertEquals Ċ Ċ class ĠLog arith mic Scale Rule set Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Log arith mic Scale _ base _ 1 0 () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule set Ġ= ĠLog arith mic Scale Rule set ( Log arith mic Scale Rule ( 1 0 . 0 , Ġ 1 , Ġ 1 , Ġ 5 0 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġrule set . compute Pod Count ( 1 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġrule set . compute Pod Count ( 1 2 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set . compute Pod Count ( 9 9 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set . compute Pod Count ( 1 0 0 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set . compute Pod Count ( 2 0 4 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġrule set . compute Pod Count ( 0 , Ġ 9 9 9 9 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Log arith mic Scale _ base Clamp ed _ 1 () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule set Ġ= ĠLog arith mic Scale Rule set ( Log arith mic Scale Rule ( 1 0 . 0 , Ġ 1 , Ġ 1 , Ġ 3 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġrule set . compute Pod Count ( 1 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set . compute Pod Count ( 1 0 0 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġrule set . compute Pod Count ( 1 0 0 1 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġrule set . compute Pod Count ( 9 9 9 9 9 0 , Ġ 9 9 9 9 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Log arith mic Scale _ base Clamp ed _ 2 () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule set Ġ= ĠLog arith mic Scale Rule set ( Log arith mic Scale Rule ( 1 0 . 0 , Ġ 1 , Ġ 2 , Ġ 3 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set . compute Pod Count ( 1 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set . compute Pod Count ( 1 0 0 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġrule set . compute Pod Count ( 1 0 0 1 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġrule set . compute Pod Count ( 9 9 9 9 9 0 , Ġ 9 9 9 9 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Log arith mic Scale _ base Step _ 2 () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule set Ġ= ĠLog arith mic Scale Rule set ( Log arith mic Scale Rule ( 5 . 0 , Ġ 2 , Ġ 1 , Ġ 5 0 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġrule set . compute Pod Count ( 2 0 0 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 4 , Ġrule set . compute Pod Count ( 5 0 0 , Ġ 2 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Log arith mic Scale _ base Step Clamp ed _ 5 () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule set Ġ= ĠLog arith mic Scale Rule set ( Log arith mic Scale Rule ( 2 . 0 , Ġ 5 , Ġ 2 , Ġ 1 0 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set . compute Pod Count ( 1 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 7 , Ġrule set . compute Pod Count ( 1 0 0 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 7 , Ġrule set . compute Pod Count ( 1 0 0 , Ġ 2 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 0 , Ġrule set . compute Pod Count ( 4 0 0 0 , Ġ 9 9 9 9 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 0 , Ġrule set . compute Pod Count ( 4 0 0 0 , Ġ 5 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Log arith mic Scale _ no Change () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule set 1 Ġ= ĠLog arith mic Scale Rule set ( Log arith mic Scale Rule ( 1 0 . 0 , Ġ 1 , Ġ 1 , Ġ 5 0 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġrule set 1 . compute Pod Count ( 1 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġrule set 1 . compute Pod Count ( 1 2 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set 1 . compute Pod Count ( 1 0 1 , Ġ 2 )) ĊĊĠĠĠĠĠĠĠ Ġval Ġrule set 2 Ġ= ĠLog arith mic Scale Rule set ( Log arith mic Scale Rule ( 5 . 0 , Ġ 2 , Ġ 1 , Ġ 5 0 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġrule set 2 . compute Pod Count ( 5 0 0 , Ġ 3 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Log arith mic Scale _ offset () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule set 1 Ġ= ĠLog arith mic Scale Rule set ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLog arith mic Scale Rule ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 1 0 . 0 , Ġ 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 1 , Ġ 5 0 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 1 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġrule set 1 . compute Pod Count ( 1 , Ġ 1 0 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set 1 . compute Pod Count ( 1 2 , Ġ 1 0 )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġrule set 1 . compute Pod Count ( 1 0 1 , Ġ 1 0 )) ĊĊĠĠĠĠĠĠĠ Ġval Ġrule set 2 Ġ= ĠLog arith mic Scale Rule set ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLog arith mic Scale Rule ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 5 . 0 , Ġ 2 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 1 , Ġ 5 0 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ- 2 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġrule set 2 . compute Pod Count ( 5 0 0 , Ġ 1 0 )) ĊĠĠĠ Ġ} Ċ } Ċ