Class: Ably::Models::ChannelMetrics
- Inherits:
-
Object
- Object
- Ably::Models::ChannelMetrics
- Extended by:
- Ably::Modules::Enum, Forwardable
- Includes:
- Ably::Modules::ModelCommon
- Defined in:
- lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb
Overview
Contains the metrics associated with a Rest::Channel or Realtime::Channel, such as the number of publishers, subscribers and connections it has.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
(also: #to_h)
readonly
The attributes of ChannelMetrics (CHM2).
Attributes included from Ably::Modules::ModelCommon
Instance Method Summary collapse
-
#connections ⇒ Integer
The number of realtime connections attached to the channel.
-
#initialize(attrs) ⇒ ChannelMetrics
constructor
Initialize a new ChannelMetrics.
-
#presence_connections ⇒ Integer
The number of realtime connections attached to the channel with permission to enter the presence set, regardless of whether or not they have entered it.
-
#presence_members ⇒ Integer
The number of members in the presence set of the channel.
-
#presence_subscribers ⇒ Integer
The number of realtime attachments receiving presence messages on the channel.
-
#publishers ⇒ Integer
The number of realtime attachments permitted to publish messages to the channel.
-
#subscribers ⇒ Integer
The number of realtime attachments receiving messages on the channel.
Methods included from Ably::Modules::ModelCommon
#==, #[], #as_json, included, #to_json, #to_s
Methods included from Ably::Modules::MessagePack
Constructor Details
#initialize(attrs) ⇒ ChannelMetrics
Initialize a new ChannelMetrics
35 36 37 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 35 def initialize(attrs) @attributes = IdiomaticRubyWrapper(attrs.clone) end |
Instance Attribute Details
#attributes ⇒ Object (readonly) Also known as: to_h
The attributes of ChannelMetrics (CHM2)
29 30 31 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 29 def attributes @attributes end |
Instance Method Details
#connections ⇒ Integer
The number of realtime connections attached to the channel.
45 46 47 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 45 def connections attributes[:connections] end |
#presence_connections ⇒ Integer
The number of realtime connections attached to the channel with permission to enter the presence set, regardless of whether or not they have entered it. This requires the presence capability and for a client to not have specified a Ably::Models::ChannelOptions::MODES flag that excludes Ably::Models::ChannelOptions::MODES#PRESENCE.
57 58 59 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 57 def presence_connections attributes[:presence_connections] end |
#presence_members ⇒ Integer
The number of members in the presence set of the channel.
67 68 69 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 67 def presence_members attributes[:presence_members] end |
#presence_subscribers ⇒ Integer
The number of realtime attachments receiving presence messages on the channel. This requires the subscribe capability and for a client to not have specified a Ably::Models::ChannelOptions::MODES flag that excludes Ably::Models::ChannelOptions::MODES#PRESENCE_SUBSCRIBE.
79 80 81 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 79 def presence_subscribers attributes[:presence_subscribers] end |
#publishers ⇒ Integer
The number of realtime attachments permitted to publish messages to the channel. This requires the publish capability and for a client to not have specified a Ably::Models::ChannelOptions::MODES flag that excludes Ably::Models::ChannelOptions::MODES#PUBLISH.
91 92 93 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 91 def publishers attributes[:publishers] end |
#subscribers ⇒ Integer
The number of realtime attachments receiving messages on the channel. This requires the subscribe capability and for a client to not have specified a Ably::Models::ChannelOptions::MODES flag that excludes Ably::Models::ChannelOptions::MODES#SUBSCRIBE.
103 104 105 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 103 def subscribers attributes[:subscribers] end |