Created
June 5, 2013 22:49
-
-
Save kineticac/5717936 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
belongs_to :athlete | |
# before we create this new bookmark, we did not need to query SQL for athlete, now we do because of this new mixpanel. | |
# Let's assume a query lookup on athlete is 100ms. So now we have 110ms, which is more than 10x the response time. | |
def before_create | |
Mixpanel.track('some_event', {distinct_id: athlete.r_email}) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# we didn't have to do any queries. Let's say this finishes in 10ms | |
def bookmark | |
AthleteCollegeBookmark.create({ | |
athlete_id: params[:athlete_id], | |
college_id: params[:college_id] | |
}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment