2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-12-24 23:02:18 +08:00

[ci skip] Add readme for asynqmon tool

This commit is contained in:
Ken Hibino 2020-01-18 20:31:22 -08:00
parent 207a6d2d1a
commit d37f2a09ab
3 changed files with 47 additions and 5 deletions

View File

@ -18,19 +18,23 @@ Simple and efficent asynchronous task processing library in Go.
## Overview
![Gif](/docs/assets/asynqmon_stats.gif)
Asynq provides a simple interface to asynchronous task processing.
Asynq also ships with a CLI to monitor the queues and take manual actions if needed.
It also ships with a tool to monitor the queues and take manual actions if needed.
Asynq provides:
- Clear separation of task producer and consumer
- Ability to schedule task processing in the future
- Automatic retry of failed tasks with exponential backoff
- Automatic failover using Redis sentinels
- Ability to configure max retry count per task
- Ability to configure max number of worker goroutines to process tasks
- Unix signal handling to safely shutdown background processing
- CLI to query and mutate queues state for mointoring and administrative purposes
- Support for priority queues
- Unix signal handling to gracefully shutdown background processing
- CLI tool to query and mutate queues state for mointoring and administrative purposes
## Requirements
@ -53,7 +57,8 @@ go get -u github.com/hibiken/asynq
import "github.com/hibiken/asynq"
```
2. Use one of `RedisConnOpt` types to specify how to connect to Redis.
2. Asynq uses redis as a message broker.
Use one of `RedisConnOpt` types to specify how to connect to Redis.
```go
var redis = &asynq.RedisClientOpt{
@ -154,7 +159,13 @@ func main() {
## Monitoring CLI
TODO(hibiken): Describe basic usage of `asynqmon` CLI
Asynq ships with a CLI tool to inspect the state of queues and tasks.
To install the CLI, run the following command:
go get github.com/hibiken/asynq/tools/asynqmon
For details on how to use the tool, see the [README](/tools/asynqmon/README.md) for the asynqmon CLI.
## Acknowledgements

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

31
tools/asynqmon/README.md Normal file
View File

@ -0,0 +1,31 @@
# Asynqmon
Asynqmon is a CLI tool to monitor the queues managed by `asynq` package.
In order to use the tool, compile it using the following command:
go get github.com/hibiken/asynq/tools/asynqmon
This will create the asynqmon executable under your `$GOPATH/bin` directory.
## Quick Start
Asynqmon tool has a few commands to inspect the state of tasks and queues.
Run `asynqmon help` to see all the available commands.
Asynqmon needs to connect to a redis-server to inspect the state of queues and tasks. Use flags to specify the options to connect to the redis-server used by your application.
By default, Asynqmon will try to connect to a redis server running at `localhost:6379`.
### Stats
Stats command gives the overview of the current state of tasks and queues. Run it in conjunction with `watch` command to repeatedly run `stats`.
Example:
watch -n 3 asynqmon stats
This will run `asynqmon stats` command every 3 seconds.
![Gif](/docs/assets/asynqmon_stats.gif)