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

Instrument the generation of Action Mailer messages #12556

Merged
merged 1 commit into from Oct 20, 2013

Conversation

Projects
None yet
4 participants
@dasch
Contributor

dasch commented Oct 16, 2013

Currently, only the time spent sending a mail is instrumented in Action Mailer. The time it takes to render the views and building the mail object itself is not instrumented at all.

This PR adds very basic instrumentation. More data, such as view rendering time, database time, and really anything, can be added later.

@josevalim

View changes

Show outdated Hide outdated actionmailer/lib/action_mailer/base.rb Outdated
@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 16, 2013

Contributor

Just a few questions:

  • Is "generate" the right word to use here?
  • Do you want the log to be in a different format?
Contributor

dasch commented Oct 16, 2013

Just a few questions:

  • Is "generate" the right word to use here?
  • Do you want the log to be in a different format?
@josevalim

View changes

Show outdated Hide outdated actionmailer/lib/action_mailer/base.rb Outdated
@josevalim

View changes

Show outdated Hide outdated actionmailer/lib/action_mailer/log_subscriber.rb Outdated
@josevalim

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Oct 16, 2013

Contributor

The logged message is fine, we can always adjust it later. :)

Contributor

josevalim commented Oct 16, 2013

The logged message is fine, we can always adjust it later. :)

@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 16, 2013

Contributor

@josevalim should I include the mailer method in the instrumentation? Right now only the name of the mailer itself is included.

Contributor

dasch commented Oct 16, 2013

@josevalim should I include the mailer method in the instrumentation? Right now only the name of the mailer itself is included.

@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 16, 2013

Contributor

Okay, I've included the action - seems to be prudent. Do you want me to rebase?

Contributor

dasch commented Oct 16, 2013

Okay, I've included the action - seems to be prudent. Do you want me to rebase?

@josevalim

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Oct 16, 2013

Contributor

Yes, please rebase. I have also added a message about the event name. IMO it should be called process instead of generate. Any reason why not to?

Contributor

josevalim commented Oct 16, 2013

Yes, please rebase. I have also added a message about the event name. IMO it should be called process instead of generate. Any reason why not to?

@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 16, 2013

Contributor

Nah, I'll change it to "process".

Contributor

dasch commented Oct 16, 2013

Nah, I'll change it to "process".

@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 16, 2013

Contributor

Actually, "process" makes it sound like we handle an incoming mail, "an email was processed".

Contributor

dasch commented Oct 16, 2013

Actually, "process" makes it sound like we handle an incoming mail, "an email was processed".

@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 16, 2013

Contributor

Naming is hard... what about "render"? Although actual rendering happens multiple times :-/

Contributor

dasch commented Oct 16, 2013

Naming is hard... what about "render"? Although actual rendering happens multiple times :-/

@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 16, 2013

Contributor

Okay, I've renamed it to "process" and squashed. I guess we'll find out if the name is confusing or not. If you merge this I'll start work on refactoring and adding support for view rendering time and db time.

Contributor

dasch commented Oct 16, 2013

Okay, I've renamed it to "process" and squashed. I guess we'll find out if the name is confusing or not. If you merge this I'll start work on refactoring and adding support for view rendering time and db time.

@pftg

View changes

Show outdated Hide outdated actionmailer/lib/action_mailer/base.rb Outdated
@pftg

View changes

Show outdated Hide outdated actionmailer/lib/action_mailer/base.rb Outdated
@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 17, 2013

Contributor

The build is failing due to some other thing :-/

Contributor

dasch commented Oct 17, 2013

The build is failing due to some other thing :-/

Instrument the generation of Action Mailer messages
The processing of outbound mail is instrumented with the key
`process.action_mailer`. The payload includes the mailer name as well as
the mailer method.
@robin850

This comment has been minimized.

Show comment
Hide comment
@robin850

robin850 Oct 20, 2013

Member

@dasch : Yes, this is not your fault ; this failure is present in lots of pull requests.

@josevalim : Could you please review and merge this one if everything is ok ? :-)

Member

robin850 commented Oct 20, 2013

@dasch : Yes, this is not your fault ; this failure is present in lots of pull requests.

@josevalim : Could you please review and merge this one if everything is ok ? :-)

josevalim added a commit that referenced this pull request Oct 20, 2013

Merge pull request #12556 from dasch/dasch/nstrument-am-processing
Instrument the generation of Action Mailer messages

@josevalim josevalim merged commit fdfc967 into rails:master Oct 20, 2013

1 check failed

default The Travis CI build failed
Details
@dasch

This comment has been minimized.

Show comment
Hide comment
@dasch

dasch Oct 21, 2013

Contributor

Thanks! I'll get started on more granular metrics as soon as I have the time.

Contributor

dasch commented Oct 21, 2013

Thanks! I'll get started on more granular metrics as soon as I have the time.

@robin850

This comment has been minimized.

Show comment
Hide comment
@robin850

robin850 Oct 21, 2013

Member

Thank you guys!

Member

robin850 commented Oct 21, 2013

Thank you guys!

@dasch dasch deleted the dasch:dasch/nstrument-am-processing branch Apr 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment