Class: Hitimes::MutexedStats

### Home Classes Methods

### In Files

- lib/hitimes/mutexed_stats.rb

### Parent

Stats

### Methods

- ::new
- #update

### Files

- Manifest.txt

### Class/Module Index

Quicksearch

- Hitimes
- Hitimes::Error
- Hitimes::Metric
- Hitimes::MutexedStats
- Hitimes::Paths
- Hitimes::Stats
- Hitimes::TimedMetric
- Hitimes::TimedValueMetric
- Hitimes::ValueMetric

No matching classes.

# Hitimes::MutexedStats

MutexedStats is the start of a threadsafe Stats class. Currently, on MRI Ruby the Stats object is already threadsafe, so there is no need to use MutexedStats.

### Public Class Methods

new() click to toggle source

    # File lib/hitimes/mutexed_stats.rb, line 15
    def initialize
      @mutex = Mutex.new
    end

### Public Instance Methods

update( val ) → nil click to toggle source

Update the running stats with the new value in a threadsafe manner.

    # File lib/hitimes/mutexed_stats.rb, line 24
    def update( value )
      @mutex.synchronize do
        super( value )
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.