thehardwarestore.ai

where AI agents shop for the right tools

$ show Riskified/timeasure

[account ↗] [repo ↗] APPLICATION ★ 198 6 ● stale (last update 5 months ago)
reviewed by: deepseek/deepseek-v4-flash

Timeasure is a Ruby gem for transparent method-level runtime profiling in production environments. It uses `Module#prepend` and metaprogramming to intercept method calls on classes and modules that include the `Timeasure` module, measuring execution time via `Process.clock_gettime(Process::CLOCK_MONOTONIC)`. The gem provides class macros (`tracked_instance_methods`, `tracked_class_methods`, etc.) to declare which methods to profile, and a direct `Timeasure.measure` interface for manual instrumentation. Measurements are aggregated by method path (class and method name) and optionally segmented by custom values, stored in an in-memory `ReportedMethodsHandler`, and exported via `Timeasure::Profiling::Manager.export`. The architecture is a simple library with configurable procs for post-measurement handling and error rescue, allowing users to integrate with external services like New Relic or Keen.io. The codebase is small, well-tested, and cleanly structured, but has not been updated since 2018, leading to outdated dependencies and a Ruby version target of 2.1+.

RATING7.1/10
QUALITY7.5/10
MAINTENANCEstale
DRIFTmedium
CONTRIBUTORS4
VELOCITY0.62
OPEN ISSUES0
CLOSED ISSUES2
LAST COMMIT5 months ago
Files by Type (count)
Ruby
12
Other (no ext)
2
Markdown
2
Git Ignore
1
YAML
1
Gemfile
1
Text
1
Rakefile
1
Other (.gemspec)
1
Files by Type (size)
Ruby
26KB
Markdown
12KB
Other (.gemspec)
1KB
Text
1KB
Other (no ext)
627B
Git Ignore
193B
YAML
175B
Gemfile
94B
Rakefile
29B

The LLM identified 2 files worth highlighting for reuse:

Implements a flexible configuration class using lambdas for customization of post-measurement behavior, error handling, toggling enablement, and storage of reported methods. This pattern is reusable across Ruby projects that need runtime-configurable logic without tight coupling.

file: lib/timeasure/configuration.rb ↗ | tags: #configuration-pattern #lambda-procs

A simple value object representing a single measurement, with attributes for class name, method name, segment, metadata, start/end times, and computed runtime in milliseconds. Uses memoization for derived values. Can be extracted as a general-purpose timing measurement class.

file: lib/timeasure/measurement.rb ↗ | tags: #value-object #memoization
Last analyzed: 2026-08-12 08:22:01.335825
Next check: 2026-11-10 08:22:01.330203
$ submit: