Class: Ably::Models::ChannelMetrics

Inherits:
Object
  • Object
show all
Extended by:
Ably::Modules::Enum, Forwardable
Includes:
Ably::Modules::ModelCommon
Defined in:
lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb

Overview

ChannelMetrics is a type that contains the count of publishers and subscribers, connections and presenceConnections, presenceMembers and presenceSubscribers (CHM1)

Instance Attribute Summary collapse

Attributes included from Ably::Modules::ModelCommon

#hash

Instance Method Summary collapse

Methods included from Ably::Modules::ModelCommon

#==, #[], #as_json, included, #to_json, #to_s

Methods included from Ably::Modules::MessagePack

#to_msgpack

Constructor Details

#initialize(attrs) ⇒ ChannelMetrics

Initialize a new ChannelMetrics



32
33
34
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 32

def initialize(attrs)
  @attributes = IdiomaticRubyWrapper(attrs.clone)
end

Instance Attribute Details

#attributesObject (readonly) Also known as: to_h

The attributes of ChannelMetrics (CHM2)



26
27
28
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 26

def attributes
  @attributes
end

Instance Method Details

#connectionsInteger

The total number of connections to the channel (CHM2a)

Returns:

  • (Integer)


40
41
42
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 40

def connections
  attributes[:connections]
end

#presence_connectionsInteger

The total number of presence connections to the channel (CHM2b)

Returns:

  • (Integer)


48
49
50
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 48

def presence_connections
  attributes[:presence_connections]
end

#presence_membersInteger

The total number of presence members for the channel (CHM2c)

Returns:

  • (Integer)


56
57
58
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 56

def presence_members
  attributes[:presence_members]
end

#presence_subscribersInteger

The total number of presence subscribers for the channel (CHM2d)

Returns:

  • (Integer)


64
65
66
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 64

def presence_subscribers
  attributes[:presence_subscribers]
end

#publishersInteger

The total number of publishers to the channel (CHM2e)

Returns:

  • (Integer)


72
73
74
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 72

def publishers
  attributes[:publishers]
end

#subscribersInteger

The total number of subscribers to the channel (CHM2f)

Returns:

  • (Integer)


80
81
82
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_metrics.rb', line 80

def subscribers
  attributes[:subscribers]
end