
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
The super easy way to benchmark methods in a live application
class Person
def compute
# boom
end
benchmark :compute
end
Works with class methods, too
class Person
def self.compute
# yolo
end
class << self
benchmark :compute
end
end
Add this line to your application’s Gemfile:
gem "benchmeth"
By default, benchmark data is written to stdout
in the following format:
compute : 1000 ms
but you can easily do whatever you want with it.
Benchmeth.on_benchmark do |method_name, seconds|
puts "#{method_name} took #{seconds} seconds!"
end
To call a method without benchmarking, append _without_benchmark
to the name.
You can switch to Active Support notifications with:
Benchmeth.use_notifications = true
And subscribe with:
ActiveSupport::Notifications.monotonic_subscribe "benchmark.benchmeth" do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
puts "%s : %d ms" % [event.payload[:name], event.duration]
end
Everyone is encouraged to help improve this project. Here are a few ways you can help:
To get started with development:
git clone https://github.com/ankane/benchmeth.git
cd benchmeth
bundle install
bundle exec rake test
FAQs
Unknown package
We found that benchmeth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.