class Ably::Models::ChannelMetrics

Contains the metrics associated with a {Ably::Models::Rest::Channel} or {Ably::Models::Realtime::Channel}, such as the number of publishers, subscribers and connections it has.

@spec CHM1

Attributes

attributes[R]

The attributes of ChannelMetrics (CHM2)

to_h[R]

The attributes of ChannelMetrics (CHM2)

Public Class Methods

new(attrs) click to toggle source

Initialize a new ChannelMetrics

# File lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb, line 35
def initialize(attrs)
  @attributes = IdiomaticRubyWrapper(attrs.clone)
end

Public Instance Methods

connections() click to toggle source

The number of realtime connections attached to the channel.

@spec CHM2a

@return [Integer]

# File lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb, line 45
def connections
  attributes[:connections]
end
presence_connections() click to toggle source

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.

@spec CHM2b

@return [Integer]

# File lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb, line 57
def presence_connections
  attributes[:presence_connections]
end
presence_members() click to toggle source

The number of members in the presence set of the channel.

@spec CHM2c

@return [Integer]

# File lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb, line 67
def presence_members
  attributes[:presence_members]
end
presence_subscribers() click to toggle source

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.

@spec CHM2d

@return [Integer]

# File lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb, line 79
def presence_subscribers
  attributes[:presence_subscribers]
end
publishers() click to toggle source

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.

@spec CHM2e

@return [Integer]

# File lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb, line 91
def publishers
  attributes[:publishers]
end
subscribers() click to toggle source

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.

@spec CHM2f

@return [Integer]

# File lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb, line 103
def subscribers
  attributes[:subscribers]
end