Class: LogStash::Outputs::Application_insights::State
- Inherits:
-
Object
- Object
- LogStash::Outputs::Application_insights::State
- Defined in:
- lib/logstash/outputs/application_insights/state.rb
Constant Summary collapse
- @@instance =
State.new
Class Method Summary collapse
Instance Method Summary collapse
- #bytes_in_memory ⇒ Object
- #dec_pending_commits ⇒ Object
- #dec_pending_notifications ⇒ Object
- #dec_upload_bytesize(bytesize) ⇒ Object
- #inc_pending_commits ⇒ Object
- #inc_pending_notifications ⇒ Object
- #inc_upload_bytesize(bytesize) ⇒ Object
-
#initialize ⇒ State
constructor
A new instance of State.
- #pending_commits ⇒ Object
- #pending_notifications ⇒ Object
Constructor Details
#initialize ⇒ State
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
.instance ⇒ Object
82 83 84 |
# File 'lib/logstash/outputs/application_insights/state.rb', line 82 def self.instance @@instance end |
Instance Method Details
#bytes_in_memory ⇒ Object
34 35 36 |
# File 'lib/logstash/outputs/application_insights/state.rb', line 34 def bytes_in_memory @bytes_in_memory.value end |
#dec_pending_commits ⇒ Object
64 65 66 |
# File 'lib/logstash/outputs/application_insights/state.rb', line 64 def dec_pending_commits @pending_commits.decrement end |
#dec_pending_notifications ⇒ Object
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_commits ⇒ Object
59 60 61 |
# File 'lib/logstash/outputs/application_insights/state.rb', line 59 def inc_pending_commits @pending_commits.increment end |
#inc_pending_notifications ⇒ Object
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_commits ⇒ Object
39 40 41 |
# File 'lib/logstash/outputs/application_insights/state.rb', line 39 def pending_commits @pending_commits.value end |
#pending_notifications ⇒ Object
44 45 46 |
# File 'lib/logstash/outputs/application_insights/state.rb', line 44 def pending_notifications @pending_notifications.value end |