Rename Inspector.CurrentStats to GetQueueInfo

This commit is contained in:
Ken Hibino
2021-05-22 12:13:19 -07:00
parent 8ee1825e67
commit b358de907e
2 changed files with 12 additions and 12 deletions

View File

@@ -44,8 +44,8 @@ func (i *Inspector) Queues() ([]string, error) {
return i.rdb.AllQueues()
}
// QueueStats represents a state of queues at a certain time.
type QueueStats struct {
// QueueInfo represents a state of queues at a certain time.
type QueueInfo struct {
// Name of the queue.
Queue string
// Total number of bytes that the queue and its tasks require to be stored in redis.
@@ -75,8 +75,8 @@ type QueueStats struct {
Timestamp time.Time
}
// CurrentStats returns a current stats of the given queue.
func (i *Inspector) CurrentStats(qname string) (*QueueStats, error) {
// GetQueueInfo returns current information of the given queue.
func (i *Inspector) GetQueueInfo(qname string) (*QueueInfo, error) {
if err := base.ValidateQueueName(qname); err != nil {
return nil, err
}
@@ -84,7 +84,7 @@ func (i *Inspector) CurrentStats(qname string) (*QueueStats, error) {
if err != nil {
return nil, err
}
return &QueueStats{
return &QueueInfo{
Queue: stats.Queue,
MemoryUsage: stats.MemoryUsage,
Size: stats.Size,