class RedisMetricsRepository implements MetricsRepository

Methods

__construct(Factory $redis)

Create a new repository instance.

array
measuredJobs()

Get all of the class names that have metrics measurements.

array
measuredQueues()

Get all of the queues that have metrics measurements.

float
jobsProcessedPerMinute()

Get the jobs processed per minute since the last snapshot.

int
throughput()

Get the application's total throughput since the last snapshot.

int
throughputForJob(string $job)

Get the throughput for a given job.

int
throughputForQueue(string $queue)

Get the throughput for a given queue.

int
throughputFor(string $key)

Get the throughput for a given key.

float
runtimeForJob(string $job)

Get the average runtime for a given job in milliseconds.

float
runtimeForQueue(string $queue)

Get the average runtime for a given queue in milliseconds.

float
runtimeFor(string $key)

Get the average runtime for a given key in milliseconds.

string|null
queueWithMaximumRuntime()

Get the queue that has the longest runtime.

string|null
queueWithMaximumThroughput()

Get the queue that has the most throughput.

void
incrementJob(string $job, float|null $runtime)

Increment the metrics information for a job.

void
incrementQueue(string $queue, float|null $runtime)

Increment the metrics information for a queue.

array
snapshotsForJob(string $job)

Get all of the snapshots for the given job.

array
snapshotsForQueue(string $queue)

Get all of the snapshots for the given queue.

array
snapshotsFor(string $key)

Get all of the snapshots for the given key.

void
snapshot()

Store a snapshot of the metrics information.

void
storeSnapshotForJob(string $job)

Store a snapshot for the given job.

void
storeSnapshotForQueue(string $queue)

Store a snapshot for the given queue.

array
baseSnapshotData(string $key)

Get the base snapshot data for a given key.

float
minutesSinceLastSnapshot()

Get the number of minutes passed since the last snapshot.

int
storeSnapshotTimestamp()

Store the current timestamp as the "last snapshot timestamp".

bool
acquireWaitTimeMonitorLock()

Attempt to acquire a lock to monitor the queue wait times.

void
forget(string $key)

Clear the metrics for a key.

void
clear()

Delete all stored metrics information.

connection()

Get the Redis connection instance.

Details

at line 21
__construct(Factory $redis)

Create a new repository instance.

Parameters

Factory $redis

at line 29
array measuredJobs()

Get all of the class names that have metrics measurements.

Return Value

array

at line 41
array measuredQueues()

Get all of the queues that have metrics measurements.

Return Value

array

at line 53
float jobsProcessedPerMinute()

Get the jobs processed per minute since the last snapshot.

Return Value

float

at line 61
int throughput()

Get the application's total throughput since the last snapshot.

Return Value

int

at line 71
int throughputForJob(string $job)

Get the throughput for a given job.

Parameters

string $job

Return Value

int

at line 79
int throughputForQueue(string $queue)

Get the throughput for a given queue.

Parameters

string $queue

Return Value

int

at line 87
protected int throughputFor(string $key)

Get the throughput for a given key.

Parameters

string $key

Return Value

int

at line 95
float runtimeForJob(string $job)

Get the average runtime for a given job in milliseconds.

Parameters

string $job

Return Value

float

at line 103
float runtimeForQueue(string $queue)

Get the average runtime for a given queue in milliseconds.

Parameters

string $queue

Return Value

float

at line 111
protected float runtimeFor(string $key)

Get the average runtime for a given key in milliseconds.

Parameters

string $key

Return Value

float

at line 119
string|null queueWithMaximumRuntime()

Get the queue that has the longest runtime.

Return Value

string|null

at line 131
string|null queueWithMaximumThroughput()

Get the queue that has the most throughput.

Return Value

string|null

at line 143
void incrementJob(string $job, float|null $runtime)

Increment the metrics information for a job.

Parameters

string $job
float|null $runtime

Return Value

void

at line 157
void incrementQueue(string $queue, float|null $runtime)

Increment the metrics information for a queue.

Parameters

string $queue
float|null $runtime

Return Value

void

at line 171
array snapshotsForJob(string $job)

Get all of the snapshots for the given job.

Parameters

string $job

Return Value

array

at line 179
array snapshotsForQueue(string $queue)

Get all of the snapshots for the given queue.

Parameters

string $queue

Return Value

array

at line 187
protected array snapshotsFor(string $key)

Get all of the snapshots for the given key.

Parameters

string $key

Return Value

array

at line 198
void snapshot()

Store a snapshot of the metrics information.

Return Value

void

at line 214
protected void storeSnapshotForJob(string $job)

Store a snapshot for the given job.

Parameters

string $job

Return Value

void

at line 238
protected void storeSnapshotForQueue(string $queue)

Store a snapshot for the given queue.

Parameters

string $queue

Return Value

void

at line 265
protected array baseSnapshotData(string $key)

Get the base snapshot data for a given key.

Parameters

string $key

Return Value

array

at line 281
protected float minutesSinceLastSnapshot()

Get the number of minutes passed since the last snapshot.

Return Value

float

at line 295
protected int storeSnapshotTimestamp()

Store the current timestamp as the "last snapshot timestamp".

Return Value

int

at line 305
bool acquireWaitTimeMonitorLock()

Attempt to acquire a lock to monitor the queue wait times.

Return Value

bool

at line 313
void forget(string $key)

Clear the metrics for a key.

Parameters

string $key

Return Value

void

at line 321
void clear()

Delete all stored metrics information.

Return Value

void

at line 343
protected RedisProxy connection()

Get the Redis connection instance.

Return Value

RedisProxy