Class: Jiggler::Stats::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/jiggler/stats/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid, identity) ⇒ Collection

Returns a new instance of Collection.



8
9
10
11
12
13
14
15
16
# File 'lib/jiggler/stats/collection.rb', line 8

def initialize(uuid, identity)
  @uuid = uuid
  @identity = identity
  @data = {
    processed: 0,
    failures: 0,
    current_jobs: {}
  }
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



6
7
8
# File 'lib/jiggler/stats/collection.rb', line 6

def data
  @data
end

#identityObject (readonly)

Returns the value of attribute identity.



6
7
8
# File 'lib/jiggler/stats/collection.rb', line 6

def identity
  @identity
end

#uuidObject (readonly)

Returns the value of attribute uuid.



6
7
8
# File 'lib/jiggler/stats/collection.rb', line 6

def uuid
  @uuid
end

Instance Method Details

#incr_failuresObject



22
23
24
# File 'lib/jiggler/stats/collection.rb', line 22

def incr_failures
  @data[:failures] += 1
end

#incr_processedObject



18
19
20
# File 'lib/jiggler/stats/collection.rb', line 18

def incr_processed
  @data[:processed] += 1
end