Skip to content

Commit

Permalink
Reimplement "do not count specific commands" feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiy0 committed Feb 20, 2017
1 parent fc1c375 commit e832ff4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ class AdaptiveAllocationStrategy(
override def extractShardId(numberOfShards: Int): ShardRegion.ExtractShardId = {
case x: ClusterMsg =>
if (!x.isInstanceOf[PersistenceQuery]) {
if (!x.isInstanceOf[DoNotCount]) {
increment(typeName, x.id)
metricRegistry.meter(s"persistence.$typeName.sender.${ x.id }.$selfHost").mark()
x match {
case cc: CountControl if cc.doNotCount =>
case _ =>
increment(typeName, x.id)
metricRegistry.meter(s"persistence.$typeName.sender.${ x.id }.$selfHost").mark()
}
metricRegistry.meter(s"persistence.$typeName.command.${ x.id }.${x.getClass.getSimpleName}.$selfHost").mark()
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/scala/com/evolutiongaming/cluster/CountControl.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.evolutiongaming.cluster

trait CountControl {
def doNotCount: Boolean = false
}
3 changes: 0 additions & 3 deletions src/main/scala/com/evolutiongaming/cluster/DoNotCount.scala

This file was deleted.

0 comments on commit e832ff4

Please sign in to comment.