A summary of data about the Ruby ecosystem.

https://github.com/copiousfreetime/hitimes

a fast, high resolution timer library for recording performance metrics
https://github.com/copiousfreetime/hitimes

Keywords

metrics ruby stats

Keywords from Contributors

rubygem multithreading rack libxml2 libxslt nokogiri ruby-gem sax xerces xslt

Last synced: about 23 hours ago
JSON representation

Repository metadata

a fast, high resolution timer library for recording performance metrics

README.md

Hitimes

Build Status

DESCRIPTION

A fast, high resolution timer library for recording performance metrics.

TABLE OF CONTENTS

REQUIREMENTS

Hitimes requires the following to run:

  • Ruby

USAGE

Hitimes easiest to use when installed with rubygems:

gem install hitimes

Or as part of your bundler Gemfile:

gem "hitimes"

You can load it with the standard ruby require statement.

require "hitimes"

Interval

Use Hitimes::Interval to calculate only the duration of a block of code.
Returns the time as seconds.

duration = Hitimes::Interval.measure do
  1_000_000.times do |x|
    2 + 2
  end
end

puts duration  # => 0.047414297 (seconds)

TimedMetric

Use a Hitimes::TimedMetric to calculate statistics about an iterative operation

timed_metric = Hitimes::TimedMetric.new("operation on items")

Explicitly use start and stop:

collection.each do |item|
  timed_metric.start
  # .. do something with item
  timed_metric.stop
end

Or use the block. In TimedMetric the return value of measure is the return
value of the block.

collection.each do |item|
  result_of_do_something = timed_metric.measure { do_something(item) }
  # do something with result_of_do_something
end

And then look at the stats

puts timed_metric.mean
puts timed_metric.max
puts timed_metric.min
puts timed_metric.stddev
puts timed_metric.rate

ValueMetric

Use a Hitimes::ValueMetric to calculate statistics about measured samples.

value_metric = Hitimes::ValueMetric.new("size of thing")
loop do
  # ... do stuff changing sizes of 'thing'
  value_metric.measure(thing.size)
  # ... do other stuff that may change size of thing
end

puts value_metric.mean
puts value_metric.max
puts value_metric.min
puts value_metric.stddev
puts value_metric.rate

TimedValueMetric

Use a Hitimes::TimedValueMetric to calculate statistics about batches of samples.

timed_value_metric = Hitimes::TimedValueMetric.new("batch times")
loop do
  batch = ... # get a batch of things
  timed_value_metric.start
  # .. do something with batch
  timed_value_metric.stop(batch.size)
end

puts timed_value_metric.rate

puts timed_value_metric.timed_stats.mean
puts timed_value_metric.timed_stats.max
puts timed_value_metric.timed_stats.min
puts timed_value_metric.timed_stats.stddev

puts timed_value_metric.value_stats.mean
puts timed_value_metric.value_stats.max
puts timed_value_metric.value_stats.min
puts timed_value_metric.value_stats.stddev

Implementation details

Hitimes uses the internal ruby Process::clock_gettime() to
get the highest granularity time increment possible. Generally this is
nanosecond resolution, or whatever the hardware in the CPU supports.

SUPPORT

Hitimes is supported on whatever versions of ruby are currently supported.
Hitimes also follows semantic versioning.

The current officially supported versions of Ruby are:

  • MRI Ruby (all platforms) 3.0 - current
  • JRuby 9.4.x.x
  • Truffleruby 24

Unofficially supported versions, any version of MRI from Ruby 2.1 and up. Since
the C Extension has been removed Hitimes should work with any ruby that is 2.1
or greater as that is when Process.clock_gettime() was implemented.

For versions of Ruby before 2.1 please use Hitimes 1.3, the extension code is
still in there and they should still work.

CONTRIBUTING

Please read CONTRIBUTING.md for instructions on development
and bug reporting.

Credits

License

Hitimes is licensed under the ISC
license.

Related Works


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 407
Total Committers: 10
Avg Commits per committer: 40.7
Development Distribution Score (DDS): 0.027

Commits in past year: 1
Committers in past year: 1
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Jeremy Hinegardner j****y@c****g 396
Olle Jonsson o****n@g****m 2
Karol Bucek k****s 2
Wojciech Piekutowski w****h@p****t 1
Joel Low j****l@j****g 1
Jesse Scott j****e@p****m 1
Jason Nochlin h****t 1
Corban Mailloux g****b@c****o 1
Benoit Daloze e****p@g****m 1
Julian Kulesh j****h@k****u 1

Committer domains:


Issue and Pull Request metadata

Last synced: 9 days ago

Total issues: 62
Total pull requests: 37
Average time to close issues: 7 months
Average time to close pull requests: 3 months
Total issue authors: 44
Total pull request authors: 15
Average comments per issue: 5.63
Average comments per pull request: 1.22
Merged pull request: 22
Bot issues: 0
Bot pull requests: 10

Past year issues: 0
Past year pull requests: 13
Past year average time to close issues: N/A
Past year average time to close pull requests: 14 days
Past year issue authors: 0
Past year pull request authors: 2
Past year average comments per issue: 0
Past year average comments per pull request: 0.23
Past year merged pull request: 7
Past year bot issues: 0
Past year bot pull requests: 6

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/copiousfreetime/hitimes

Top Issue Authors

  • copiousfreetime (17)
  • ghost (2)
  • rdp (2)
  • eric (1)
  • andreas-venturini (1)
  • Rajiv-Silva-ConnectedLab (1)
  • lfender6445 (1)
  • waldofe (1)
  • eregon (1)
  • wpiekutowski (1)
  • Startouf (1)
  • virtualfunction (1)
  • tyhawk (1)
  • trocolit2 (1)
  • ccoenen (1)

Top Pull Request Authors

  • copiousfreetime (13)
  • dependabot[bot] (10)
  • olleolleolle (2)
  • taylskid (1)
  • raventid (1)
  • kares (1)
  • corbanmailloux (1)
  • hundredwatt (1)
  • eregon (1)
  • wpiekutowski (1)
  • scotje (1)
  • fossabot (1)
  • lelutin (1)
  • lowjoel (1)
  • mbautin (1)

Top Issue Labels

  • bug (10)
  • feature (8)
  • release 1.3.0 (2)

Top Pull Request Labels

  • dependencies (10)
  • ruby (4)
  • bug (1)

Package metadata

gem.coop: hitimes

A fast, high resolution timer library for recording performance metrics.

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Documentation: http://www.rubydoc.info/gems/hitimes/
  • Licenses: ISC
  • Latest release: 3.1.0 (published about 1 year ago)
  • Last Synced: 2026-03-01T07:33:52.693Z (3 days ago)
  • Versions: 63
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 61,043,108 Total
  • Docker Downloads: 259,127,147
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.214%
    • Docker downloads count: 0.41%
    • Downloads: 0.446%
  • Maintainers (1)
debian-13: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Documentation: https://packages.debian.org/trixie/ruby-hitimes
  • Licenses: isc
  • Latest release: 1.3.1-1 (published 19 days ago)
  • Last Synced: 2026-02-13T13:16:18.935Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.569%
    • Stargazers count: 1.026%
    • Forks count: 1.251%
rubygems.org: hitimes

A fast, high resolution timer library for recording performance metrics.

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Documentation: http://www.rubydoc.info/gems/hitimes/
  • Licenses: ISC
  • Latest release: 3.1.0 (published about 1 year ago)
  • Last Synced: 2026-02-28T20:00:39.071Z (3 days ago)
  • Versions: 63
  • Dependent Packages: 33
  • Dependent Repositories: 34,821
  • Downloads: 61,040,286 Total
  • Docker Downloads: 259,127,147
  • Rankings:
    • Dependent repos count: 0.178%
    • Downloads: 0.371%
    • Docker downloads count: 0.503%
    • Dependent packages count: 0.728%
    • Average: 2.138%
    • Stargazers count: 4.64%
    • Forks count: 6.405%
  • Maintainers (1)
proxy.golang.org: github.com/copiousfreetime/hitimes

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/copiousfreetime/hitimes#section-documentation
  • Licenses: isc
  • Latest release: v3.1.0+incompatible (published about 1 year ago)
  • Last Synced: 2026-02-28T20:00:40.283Z (3 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 3.995%
    • Forks count: 5.068%
    • Average: 7.36%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
debian-10: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Documentation: https://packages.debian.org/buster/ruby-hitimes
  • Licenses:
  • Latest release: 1.2.1-3 (published 20 days ago)
  • Last Synced: 2026-02-13T04:22:10.944Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.04: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Licenses:
  • Latest release: 1.3.1-1build5 (published 25 days ago)
  • Last Synced: 2026-02-06T15:21:38.443Z (25 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
debian-11: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Documentation: https://packages.debian.org/bullseye/ruby-hitimes
  • Licenses:
  • Latest release: 1.2.1-4 (published 21 days ago)
  • Last Synced: 2026-02-13T08:21:16.249Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.10: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Licenses:
  • Latest release: 1.3.1-1build3 (published 18 days ago)
  • Last Synced: 2026-02-13T18:22:37.117Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.04: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Licenses:
  • Latest release: 1.3.1-1build3 (published 21 days ago)
  • Last Synced: 2026-02-11T06:40:53.313Z (21 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.10: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Licenses:
  • Latest release: 1.3.1-1build6 (published 22 days ago)
  • Last Synced: 2026-02-09T16:41:13.023Z (22 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
ubuntu-20.04: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Licenses:
  • Latest release: 1.2.1-3build6 (published 19 days ago)
  • Last Synced: 2026-02-13T07:14:59.939Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-22.04: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Licenses:
  • Latest release: 1.3.1-1build1 (published 18 days ago)
  • Last Synced: 2026-02-13T13:18:26.465Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-hitimes

  • Homepage: https://github.com/copiousfreetime/hitimes
  • Documentation: https://packages.debian.org/bookworm/ruby-hitimes
  • Licenses:
  • Latest release: 1.3.1-1 (published 19 days ago)
  • Last Synced: 2026-02-12T23:32:08.393Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:

Dependencies

Gemfile.lock rubygems
  • docile 1.4.0
  • hitimes 2.0.0
  • json 2.6.1
  • minitest 5.15.0
  • minitest-focus 1.3.1
  • psych 4.0.3
  • rake 12.3.3
  • rdoc 6.4.0
  • simplecov 0.21.2
  • simplecov-html 0.12.3
  • simplecov_json_formatter 0.1.4
  • stringio 3.0.1
Gemfile rubygems
  • heel >= 0
  • minitest ~> 5.11
  • minitest-focus ~> 1.2
  • minitest-junit ~> 1.0
  • rake >= 0
  • rdoc ~> 6.3
  • reek >= 0
  • rubocop ~> 1.63
  • rubocop-md ~> 1.2
  • rubocop-minitest ~> 0.35
  • rubocop-packaging ~> 0.5
  • rubocop-performance ~> 1.21
  • rubocop-rake ~> 0.6
  • rubocop-thread_safety ~> 0.5
  • simplecov ~> 0.22
hitimes.gemspec rubygems

Score: 27.59742674566438