Skip to content

Commit

Permalink
filter NoDiffs out before adding to counts
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetkhanduri committed Dec 8, 2022
1 parent 20c6eae commit 9c800cd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ai.diffy.analysis

import ai.diffy.compare.Difference
import ai.diffy.compare.{Difference, NoDifference}
import ai.diffy.metrics.MetricsReceiver
import io.micrometer.core.instrument.{Counter, Metrics}

Expand Down Expand Up @@ -69,7 +69,7 @@ class InMemoryEndpointMetadata(receiver: MetricsReceiver) extends EndpointMetada
def add(diffs: Map[String, Difference]): Unit = {
Try(totalCounter.increment())
totalAtomic.incrementAndGet()
if (diffs.nonEmpty) {
if (diffs.filterNot{case (_, diff) => diff.isInstanceOf[NoDifference]}.nonEmpty) {
differenceCounter.increment()
differenceAtomic.incrementAndGet()
}
Expand Down

0 comments on commit 9c800cd

Please sign in to comment.