petabridge / akka-monitoring

Monitoring system instrumentation for Akka.NET actor systems
Apache License 2.0
114 stars 38 forks source link

Time spent in mailbox #2

Open stefansedich opened 10 years ago

stefansedich commented 10 years ago

Hello,

Do you have any ideas on how we would measure time spent in the mailbox before processing? I easily am measuring the time to process the messages (I have a PR coming with some nice additions to make this easier).

Also other things I wanted were things like a guage of the number of messages in the mailbox, I wish we could have something like http://kamon.io but that would rely on .NET having some useful instrumentation support like Java does here's hoping one day this can be a reality withing diving into the Profiler API.

Cheers Stefan

Aaronontheweb commented 10 years ago

Hi @stefansedich - looking forward to your PR!

Right now we don't have a good way to instrument the mailbox because a lot of the internals needed to do that are protected.

One thing I might be able to do is create a mailbox subclass that wraps a layer of instrumentation around an underlying mailbox implementation and make that something you can configure via Props. Ideally, I'd like to add some monitoring hooks inside the core Akka.NET project itself (since we don't have anything like AspectJ to allow third-party developers to simply inject monitoring hooks into the byte code) but that'll take me longer to sell to the other Akka.NET contributors.

Aaronontheweb commented 10 years ago

The changes that are being introduced in https://github.com/akkadotnet/akka.net/pull/374 will make it easier to do this type of mailbox configuration.

stefansedich commented 10 years ago

Ah ok, is there a way to at least get the mailbox size for now? I cannot find an easy way at the moment.

If you have ideas I am happy to put my hand in and help out so that we can make this experience great for everyone!

Cheers Stefan

Aaronontheweb commented 10 years ago

@stefansedich no, unfortunately - the members inside the Mailbox that expose that data are currently marked as internal or protected:

protected abstract int GetNumberOfMessages();

        internal bool HasMessages
        {
            get
            {
                return NumberOfMessages > 0;
            }
        }
        internal int NumberOfMessages
        {
            get
            {
                return GetNumberOfMessages();
            }
        }

I'd like access to this data also, so I'd like to find a way to work with the other Akka.NET contributors to get it!

stefansedich commented 10 years ago

Yeah cool that was what I found too, you started any communication with them on this? if not I am happy to do that!

Cheers Stefan

Aaronontheweb commented 10 years ago

I'm one of the organizers for Akka.NET so that helps, but it'd be useful to hear it from another end-user. Would you mind posting an issue to the Akka.NET discussion group or the Github issues list? https://github.com/akkadotnet/akka.net/issues

stefansedich commented 10 years ago

Haha sorry my bad I missed this key fact :) I will post something up tonight.

Cheers

On Tue, Sep 9, 2014 at 11:30 AM, Aaron Stannard notifications@github.com wrote:

I'm one of the organizers for Akka.NET so that helps, but it'd be useful to hear it from another end-user. Would you mind posting an issue to the Akka.NET discussion group https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!forum/akkadotnet-user-list or the Github issues list? https://github.com/akkadotnet/akka.net/issues

— Reply to this email directly or view it on GitHub https://github.com/Aaronontheweb/akka-monitoring/issues/2#issuecomment-54912323 .

Cheers Stefan