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
Measure contact rollups job #29073
Measure contact rollups job #29073
Conversation
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.
Hooray for instrumentation!
require 'cdo/log_collector' | ||
|
||
class LogCollectorTest < Minitest::Test | ||
def test_time_a_function |
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.
Can we use TimeCop
to test that LogCollector correctly measures the amount of time it took the function to execute?
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.
Will keep this idea for future improvement.
I'm looking at examples of Timecop in our code base; 2 common functions areTimecop.freeze(time)
and Timecop.travel
and it is not obvious to me how to measure execution time?
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.
Makes sense. I think we could freeze time before invoking a method that is wrapped in the log collector, and inside the wrapped method we could travel forward. That might enable us to assert that the log collector correctly measured how much time elapsed during execution.
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.
Got it!
PLC-258
What
cron-daily
Slack channel (example).Why
How tested
bundle exec ruby lib/test/cdo/test_log_collector.rb
test
serverscreen
section so job will still run even connection to test server breaks.bin/cron/build_contact_rollups
.ctrl+a+d
, resume section =screen -r <sessions_name>
, list =screen -ls
)Note
I add all PLC to this PR since Contact Rollups is in PLC land now and anyone of us may have to work on it in the future.
TO DO