README.md in ddmemoize-1.0.0a1 vs README.md in ddmemoize-1.0.0a2

- old
+ new

@@ -28,10 +28,11 @@ Features: * Supports memoizing functions on frozen objects * Releases memoized values when needed in order to reduce memory pressure +* Optionally records telemetry ## Installation Add this line to your application's Gemfile: @@ -76,10 +77,32 @@ memoized def run(n) # … end ``` -Do not memoie functions that depend on mutable state. +Do not memoize functions that depend on mutable state. + +### Telemetry + +To activate telemetry for a given class, call `DDMemoize.activate` with a `telemetry` keyword argument, passing in a telemetry instance: + +```ruby +require 'ddmemoize' + +TELEMETRY = DDTelemetry.new + +class FibFast + DDMemoize.activate(self, telemetry: TELEMETRY) + + # … +end +``` + +To print the collected metrics, call `DDMemoize.print_telemetry`, passing in the telemetry instance: + +```ruby +DDMemoize.print_telemetry(TELEMETRY) +``` ## Development Install dependencies: