You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by "rabbah (via GitHub)" <gi...@apache.org> on 2023/04/18 02:12:32 UTC

[GitHub] [openwhisk] rabbah commented on a diff in pull request #5396: fix bug in average ring buffer and add negative duration protection to scheduler decision maker

rabbah commented on code in PR #5396:
URL: https://github.com/apache/openwhisk/pull/5396#discussion_r1169417809


##########
common/scala/src/main/scala/org/apache/openwhisk/common/AverageRingBuffer.scala:
##########
@@ -32,18 +32,12 @@ object AverageRingBuffer {
 class AverageRingBuffer(private val maxSize: Int) {
   private var elements = Vector.empty[Double]
   private var sum = 0.0
-  private var max = 0.0
-  private var min = 0.0
 
   def nonEmpty: Boolean = elements.nonEmpty
 
   def average: Double = {
     val size = elements.size

Review Comment:
   any chance `size` is 0?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org