Class: LogStash::Outputs::Application_insights::State

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/application_insights/state.rb

Constant Summary collapse

@@instance =
State.new

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeState

Returns a new instance of State.



27
28
29
30
31
# File 'lib/logstash/outputs/application_insights/state.rb', line 27

def initialize
  @bytes_in_memory = Concurrent::AtomicFixnum.new(0)
  @pending_commits = Concurrent::AtomicFixnum.new(0)
  @pending_notifications = Concurrent::AtomicFixnum.new(0)
end

Class Method Details

.instanceObject



82
83
84
# File 'lib/logstash/outputs/application_insights/state.rb', line 82

def self.instance
  @@instance
end

Instance Method Details

#bytes_in_memoryObject



34
35
36
# File 'lib/logstash/outputs/application_insights/state.rb', line 34

def bytes_in_memory
  @bytes_in_memory.value
end

#dec_pending_commitsObject



64
65
66
# File 'lib/logstash/outputs/application_insights/state.rb', line 64

def dec_pending_commits
  @pending_commits.decrement
end

#dec_pending_notificationsObject



74
75
76
# File 'lib/logstash/outputs/application_insights/state.rb', line 74

def dec_pending_notifications
  @pending_notifications.decrement
end

#dec_upload_bytesize(bytesize) ⇒ Object



54
55
56
# File 'lib/logstash/outputs/application_insights/state.rb', line 54

def dec_upload_bytesize ( bytesize )
  @bytes_in_memory.decrement( bytesize )
end

#inc_pending_commitsObject



59
60
61
# File 'lib/logstash/outputs/application_insights/state.rb', line 59

def inc_pending_commits
  @pending_commits.increment
end

#inc_pending_notificationsObject



69
70
71
# File 'lib/logstash/outputs/application_insights/state.rb', line 69

def inc_pending_notifications
  @pending_notifications.increment
end

#inc_upload_bytesize(bytesize) ⇒ Object



49
50
51
# File 'lib/logstash/outputs/application_insights/state.rb', line 49

def inc_upload_bytesize ( bytesize )
  @bytes_in_memory.increment( bytesize )
end

#pending_commitsObject



39
40
41
# File 'lib/logstash/outputs/application_insights/state.rb', line 39

def pending_commits
  @pending_commits.value
end

#pending_notificationsObject



44
45
46
# File 'lib/logstash/outputs/application_insights/state.rb', line 44

def pending_notifications
  @pending_notifications.value
end