RedisMetricsRepository
class RedisMetricsRepository implements MetricsRepository
Methods
Get all of the class names that have metrics measurements.
Get all of the queues that have metrics measurements.
Get the jobs processed per minute since the last snapshot.
Get the application's total throughput since the last snapshot.
Get the throughput for a given job.
Get the throughput for a given queue.
Get the throughput for a given key.
Get the average runtime for a given job in milliseconds.
Get the average runtime for a given queue in milliseconds.
Get the average runtime for a given key in milliseconds.
Get the queue that has the longest runtime.
Get the queue that has the most throughput.
Increment the metrics information for a job.
Increment the metrics information for a queue.
Get all of the snapshots for the given job.
Get all of the snapshots for the given queue.
Get all of the snapshots for the given key.
Store a snapshot of the metrics information.
Store a snapshot for the given job.
Store a snapshot for the given queue.
Get the base snapshot data for a given key.
Get the number of minutes passed since the last snapshot.
Store the current timestamp as the "last snapshot timestamp".
Attempt to acquire a lock to monitor the queue wait times.
Clear the metrics for a key.
Delete all stored metrics information.
Get the Redis connection instance.
Details
at line 21
__construct(Factory $redis)
Create a new repository instance.
at line 29
array
measuredJobs()
Get all of the class names that have metrics measurements.
at line 41
array
measuredQueues()
Get all of the queues that have metrics measurements.
at line 53
float
jobsProcessedPerMinute()
Get the jobs processed per minute since the last snapshot.
at line 61
int
throughput()
Get the application's total throughput since the last snapshot.
at line 71
int
throughputForJob(string $job)
Get the throughput for a given job.
at line 79
int
throughputForQueue(string $queue)
Get the throughput for a given queue.
at line 87
protected int
throughputFor(string $key)
Get the throughput for a given key.
at line 95
float
runtimeForJob(string $job)
Get the average runtime for a given job in milliseconds.
at line 103
float
runtimeForQueue(string $queue)
Get the average runtime for a given queue in milliseconds.
at line 111
protected float
runtimeFor(string $key)
Get the average runtime for a given key in milliseconds.
at line 119
string|null
queueWithMaximumRuntime()
Get the queue that has the longest runtime.
at line 131
string|null
queueWithMaximumThroughput()
Get the queue that has the most throughput.
at line 143
void
incrementJob(string $job, float|null $runtime)
Increment the metrics information for a job.
at line 157
void
incrementQueue(string $queue, float|null $runtime)
Increment the metrics information for a queue.
at line 171
array
snapshotsForJob(string $job)
Get all of the snapshots for the given job.
at line 179
array
snapshotsForQueue(string $queue)
Get all of the snapshots for the given queue.
at line 187
protected array
snapshotsFor(string $key)
Get all of the snapshots for the given key.
at line 198
void
snapshot()
Store a snapshot of the metrics information.
at line 214
protected void
storeSnapshotForJob(string $job)
Store a snapshot for the given job.
at line 238
protected void
storeSnapshotForQueue(string $queue)
Store a snapshot for the given queue.
at line 265
protected array
baseSnapshotData(string $key)
Get the base snapshot data for a given key.
at line 281
protected float
minutesSinceLastSnapshot()
Get the number of minutes passed since the last snapshot.
at line 295
protected int
storeSnapshotTimestamp()
Store the current timestamp as the "last snapshot timestamp".
at line 305
bool
acquireWaitTimeMonitorLock()
Attempt to acquire a lock to monitor the queue wait times.
at line 313
void
forget(string $key)
Clear the metrics for a key.
at line 321
void
clear()
Delete all stored metrics information.
at line 343
protected RedisProxy
connection()
Get the Redis connection instance.