-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify sampling rate for actors #56
Specify sampling rate for actors #56
Conversation
|
||
"Sample every 'n' messages (where 'n' is defined in conf file)" in { | ||
TestCounterInterface.clear() | ||
(0 until 1000) map {_ => a ! 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably use foreach
. The effect will be the same, but the name map is a bit loaded.
I think it's time to refactor the Let's tidy that up. |
@@ -39,4 +42,14 @@ abstract aspect AbstractMonitoringAspect { | |||
protected final <A> AgentConfiguration<A> getAgentConfiguration(String agentName, Function1<Config, A> agent) { | |||
return AgentConfigurationFactory.getAgentCofiguration(agentName, agent); | |||
} | |||
|
|||
protected final HashMap<ActorFilter, AtomicLong> getCounterKeys(AgentConfiguration<AkkaAgentConfiguration> configuration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be in the subclass. I'm beginning to think that the abstract aspect might not be needed at all.
… the second assertion)
This is looking much better. The only thing is that the sampling rate skews the actual number of messages. You send the actor 1000 messages with sampling rate 5, but the counter value is only 200. It should read 1000, but with 5 increments. There's a whole bunch of missing ScalaDoc, unused imports, and the naming of the tests does not really match the existing tests. Finally, the |
…sampling; Changed spec comments'
private def parseSampling(samplingObject: ConfigObject): Iterable[SamplingRate] = { | ||
import scala.collection.JavaConversions._ | ||
(samplingObject.get("rate").unwrapped(), samplingObject.get("for").unwrapped()) match { | ||
case (rate: Number, filters: java.util.List[String @unchecked]) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I didn't know about that @unchcked
annotation.
Looking good. Just a few last bits to tidy up and we're good to merge. |
I pulled the latest code. Sbt builds properly, scalastyle reports no errors. That is actually a problem, because The code in the if (!this.agentConfiguration.incuded().accept(pathAndClass)) return false;
if (this.agentConfiguration.excluded().accept(pathAndClass)) return false;
if (this.agentConfiguration.includeSystemAgents()) return true; Your code misses out Looking further, remember our rule to leave the place in a better state than it was when you found it. So, the documentation on the advices is poor. It repeats the documentation of the pointcut, but doesn't really explain what the advice does. |
Specify sampling rate for actors
No description provided.