Modify #time to support a "count" option.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ruby
- Domain
- observability-sre
Research direction
Start by locating the time entry point and its time_since call, then inspect the existing timing tests if present. Done means time accepts a count option, preserves the default behavior, and reports the elapsed duration divided by the count for bulk operations.
Written by the indexing model from the issue text.
Description
I have to time some bulk operations and it's not viable to push to statsd every iteration of the loop. However, what would be nice is something like the following:
$statsd.time('accounts.activate', { count: accounts.length } ) { process_accounts(accounts) }
Internally this would change time to something similar to the following:
def time(stat, opts={})
count = [opts.fetch(:count, 1), 1].max
start = Time.now
return yield
ensure
time_since(stat / count, start, opts)
end
I can open a PR if this sounds like a good idea :)
- Dominant language
- Ruby
- Stars
- 208
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/dogstatsd-ruby
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DataDog/dogstatsd-ruby#326 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
DataDog/dogstatsd-ruby#321 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
DataDog/dogstatsd-ruby#331 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
DataDog/dogstatsd-ruby#325 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
DataDog/dogstatsd-ruby#324 · 2 reactions ·
All issues in DataDog/dogstatsd-ruby
Similar issues
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
grafana/pyroscope#5729 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rubygems/rubygems.org#6895 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
samvera/hyku#3359 · 1 comment ·
Maintainers usually reply within 1 day
-
Child factories do not inherit traits from their parentPossibly taken @alassek claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rom-rb/rom-factory#99 ·