Skip to content

Commit

Permalink
AdaptiveAllocationStrategy: Add ability to count only specific comman…
Browse files Browse the repository at this point in the history
…ds, add traffic metrics by command types
  • Loading branch information
sergiy0 committed Feb 20, 2017
1 parent 41695d9 commit 596437c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ class AdaptiveAllocationStrategy(
override def extractShardId(numberOfShards: Int): ShardRegion.ExtractShardId = {
case x: ClusterMsg =>
if (!x.isInstanceOf[PersistenceQuery]) {
increment(typeName, x.id)
metricRegistry.meter(s"persistence.$typeName.sender.${x.id}.$selfHost").mark()
if (!x.isInstanceOf[DoNotCount]) {
increment(typeName, x.id)
metricRegistry.meter(s"persistence.$typeName.sender.${ x.id }.$selfHost").mark()
}
metricRegistry.meter(s"persistence.$typeName.command.${ x.id }.${x.getClass.getCanonicalName}.$selfHost").mark()
}
x.id
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/evolutiongaming/cluster/DoNotCount.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.evolutiongaming.cluster

trait DoNotCount

0 comments on commit 596437c

Please sign in to comment.