Skip to content

Commit

Permalink
[ci skip] Add readme for asynqmon tool
Browse files Browse the repository at this point in the history
  • Loading branch information
hibiken committed Jan 19, 2020
1 parent 207a6d2 commit d37f2a0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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{
Expand Down Expand Up @@ -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

Expand Down
Binary file added docs/assets/asynqmon_stats.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions tools/asynqmon/README.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit d37f2a0

Please sign in to comment.