MetricsHandler
class MetricsHandler
Traits
Properties
| protected PendingMetric> | $metrics | The metrics being gathered. |
Methods
Get meta / status information for the given channels.
Get meta / status information for the given channel.
Create an instance of the metrics handler.
Gather the metrics for the given type.
Gather metrics from all subscribers for the given type.
Merge the given metrics into a single result set.
Merge multiple channel instances into a single set.
Merge multiple sets of channel instances into a single result set.
Details
in
InteractsWithChannelInformation at line 18
protected array
infoForChannels(Application $application, array $channels, string $info)
Get meta / status information for the given channels.
in
InteractsWithChannelInformation at line 32
protected array
info(Application $application, string $channel, string $info)
Get meta / status information for the given channel.
in
InteractsWithChannelInformation at line 77
protected bool
isPresenceChannel(Channel $channel)
Determine if the given channel is a presence channel.
in
InteractsWithChannelInformation at line 85
protected bool
isCacheChannel(Channel $channel)
Determine if the given channel is a cache channel.
in
InteractsWithChannelInformation at line 93
protected int
userCount(Channel $channel)
Get the number of unique users subscribed to the presence channel.
at line 30
__construct(ServerProviderManager $serverProviderManager, ChannelManager $channels, PubSubProvider $pubSubProvider)
Create an instance of the metrics handler.
at line 40
array
gather(Application $application, string $type, array $options = [])
Gather the metrics for the given type.
at line 57
array
get(PendingMetric $metric)
Get the metrics for the given type.
at line 70
protected array
channel(PendingMetric $metric)
Get the channel for the given application.
at line 78
protected array
channels(PendingMetric $metric)
Get the channels for the given application.
at line 102
protected array
channelUsers(PendingMetric $metric)
Get the channel users for the given application.
at line 121
protected array
connections(PendingMetric $metric)
Get the connections for the given application.
at line 131
protected array
gatherMetricsFromSubscribers(PendingMetric $metric)
Gather metrics from all subscribers for the given type.
Uses a Swoole coroutine channel with timeout instead of ReactPHP promises.
at line 186
protected array
mergeSubscriberMetrics(array $metrics, MetricType $type)
Merge the given metrics into a single result set.
at line 199
protected array
mergeChannel(array $metrics)
Merge multiple channel instances into a single set.
at line 218
protected array
mergeChannels(array $metrics)
Merge multiple sets of channel instances into a single result set.
at line 239
void
publish(PendingMetric $metric)
Publish the metrics for the given type.
Called by the pub/sub message handler when this node receives a metrics request.
at line 250
protected void
stopListening(PendingMetric $metric)
Stop listening for the given metric.