Skip to content

Commit

Permalink
Update all reference to asynqmon to Asynq CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
hibiken committed Apr 19, 2020
1 parent aafd8a5 commit cf61911
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 74 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/examples

# Ignore command binary
/tools/asynqmon/asynqmon
/tools/asynq/asynq

# Ignore asynqmon config file
.asynqmon.*
# Ignore asynq config file
.asynq.*
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Here's an example of running the `stats` command.

![Gif](/docs/assets/demo.gif)

For details on how to use the tool, refer to the tool's [README](/tools/asynqmon/README.md).
For details on how to use the tool, refer to the tool's [README](/tools/asynq/README.md).

## Installation

Expand All @@ -226,7 +226,7 @@ go get -u github.com/hibiken/asynq
To install the CLI tool, run the following command:

```sh
go get -u github.com/hibiken/asynq/tools/asynqmon
go get -u github.com/hibiken/asynq/tools/asynq
```

## Requirements
Expand All @@ -245,7 +245,7 @@ Please see the [Contribution Guide](/CONTRIBUTING.md) before contributing.

- [Sidekiq](https://github.com/mperham/sidekiq) : Many of the design ideas are taken from sidekiq and its Web UI
- [RQ](https://github.com/rq/rq) : Client APIs are inspired by rq library.
- [Cobra](https://github.com/spf13/cobra) : Asynqmon CLI is built with cobra
- [Cobra](https://github.com/spf13/cobra) : Asynq CLI is built with cobra

## License

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
56 changes: 28 additions & 28 deletions tools/asynq/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Asynqmon
# Asynq CLI

Asynqmon is a command line tool to monitor the tasks managed by `asynq` package.
Asynq CLI is a command line tool to monitor the tasks managed by `asynq` package.

## Table of Contents

Expand All @@ -20,31 +20,31 @@ Asynqmon is a command line tool to monitor the tasks managed by `asynq` package.

In order to use the tool, compile it using the following command:

go get github.com/hibiken/asynq/tools/asynqmon
go get github.com/hibiken/asynq/tools/asynq

This will create the asynqmon executable under your `$GOPATH/bin` directory.
This will create the asynq executable under your `$GOPATH/bin` directory.

## Quickstart

The tool has a few commands to inspect the state of tasks and queues.

Run `asynqmon help` to see all the available commands.
Run `asynq 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.
Asynq CLI 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`.
By default, CLI 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. You can run it in conjunction with `watch` command to repeatedly run `stats`.

Example:

watch -n 3 asynqmon stats
watch -n 3 asynq stats

This will run `asynqmon stats` command every 3 seconds.
This will run `asynq stats` command every 3 seconds.

![Gif](/docs/assets/asynqmon_stats.gif)
![Gif](/docs/assets/asynq_stats.gif)

### History

Expand All @@ -54,31 +54,31 @@ By default, it shows the stats from the last 10 days. Use `--days` to specify th

Example:

asynqmon history --days=30
asynq history --days=30

![Gif](/docs/assets/asynqmon_history.gif)
![Gif](/docs/assets/asynq_history.gif)

### Process Status

PS (ProcessStatus) command shows the list of running worker processes.

Example:

asynqmon ps
asynq ps

![Gif](/docs/assets/asynqmon_ps.gif)
![Gif](/docs/assets/asynq_ps.gif)

### List

List command shows all tasks in the specified state in a table format

Example:

asynqmon ls retry
asynqmon ls scheduled
asynqmon ls dead
asynqmon ls enqueued:default
asynqmon ls inprogress
asynq ls retry
asynq ls scheduled
asynq ls dead
asynq ls enqueued:default
asynq ls inprogress

### Enqueue

Expand All @@ -88,13 +88,13 @@ Command `enq` takes a task ID and moves the task to **Enqueued** state. You can

Example:

asynqmon enq d:1575732274:bnogo8gt6toe23vhef0g
asynq enq d:1575732274:bnogo8gt6toe23vhef0g

Command `enqall` moves all tasks to **Enqueued** state from the specified state.

Example:

asynqmon enqall retry
asynq enqall retry

Running the above command will move all **Retry** tasks to **Enqueued** state.

Expand All @@ -106,13 +106,13 @@ Command `del` takes a task ID and deletes the task. You can obtain the task ID b

Example:

asynqmon del r:1575732274:bnogo8gt6toe23vhef0g
asynq del r:1575732274:bnogo8gt6toe23vhef0g

Command `delall` deletes all tasks which are in the specified state.

Example:

asynqmon delall retry
asynq delall retry

Running the above command will delete all **Retry** tasks.

Expand All @@ -124,13 +124,13 @@ Command `kill` takes a task ID and kills the task. You can obtain the task ID by

Example:

asynqmon kill r:1575732274:bnogo8gt6toe23vhef0g
asynq kill r:1575732274:bnogo8gt6toe23vhef0g

Command `killall` kills all tasks which are in the specified state.

Example:

asynqmon killall retry
asynq killall retry

Running the above command will move all **Retry** tasks to **Dead** state.

Expand All @@ -144,15 +144,15 @@ Handler implementation needs to be context aware in order to actually stop proce

Example:

asynqmon cancel bnogo8gt6toe23vhef0g
asynq cancel bnogo8gt6toe23vhef0g

## Config File

You can use a config file to set default values for the flags.
This is useful, for example when you have to connect to a remote redis server.

By default, `asynqmon` will try to read config file located in
`$HOME/.asynqmon.(yaml|json)`. You can specify the file location via `--config` flag.
By default, `asynq` will try to read config file located in
`$HOME/.asynq.(yaml|json)`. You can specify the file location via `--config` flag.

Config file example:

Expand Down
6 changes: 3 additions & 3 deletions tools/asynq/cmd/cancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ import (
var cancelCmd = &cobra.Command{
Use: "cancel [task id]",
Short: "Sends a cancelation signal to the goroutine processing the specified task",
Long: `Cancel (asynqmon cancel) will send a cancelation signal to the goroutine processing
Long: `Cancel (asynq cancel) will send a cancelation signal to the goroutine processing
the specified task.
The command takes one argument which specifies the task to cancel.
The task should be in in-progress state.
Identifier for a task should be obtained by running "asynqmon ls" command.
Identifier for a task should be obtained by running "asynq ls" command.
Handler implementation needs to be context aware for cancelation signal to
actually cancel the processing.
Example: asynqmon cancel bnogo8gt6toe23vhef0g`,
Example: asynq cancel bnogo8gt6toe23vhef0g`,
Args: cobra.ExactArgs(1),
Run: cancel,
}
Expand Down
6 changes: 3 additions & 3 deletions tools/asynq/cmd/del.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
var delCmd = &cobra.Command{
Use: "del [task id]",
Short: "Deletes a task given an identifier",
Long: `Del (asynqmon del) will delete a task given an identifier.
Long: `Del (asynq del) will delete a task given an identifier.
The command takes one argument which specifies the task to delete.
The task should be in either scheduled, retry or dead state.
Identifier for a task should be obtained by running "asynqmon ls" command.
Identifier for a task should be obtained by running "asynq ls" command.
Example: asynqmon enq d:1575732274:bnogo8gt6toe23vhef0g`,
Example: asynq enq d:1575732274:bnogo8gt6toe23vhef0g`,
Args: cobra.ExactArgs(1),
Run: del,
}
Expand Down
6 changes: 3 additions & 3 deletions tools/asynq/cmd/delall.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ var delallValidArgs = []string{"scheduled", "retry", "dead"}
var delallCmd = &cobra.Command{
Use: "delall [state]",
Short: "Deletes all tasks in the specified state",
Long: `Delall (asynqmon delall) will delete all tasks in the specified state.
Long: `Delall (asynq delall) will delete all tasks in the specified state.
The argument should be one of "scheduled", "retry", or "dead".
Example: asynqmon delall dead -> Deletes all dead tasks`,
Example: asynq delall dead -> Deletes all dead tasks`,
ValidArgs: delallValidArgs,
Args: cobra.ExactValidArgs(1),
Run: delall,
Expand Down Expand Up @@ -60,7 +60,7 @@ func delall(cmd *cobra.Command, args []string) {
case "dead":
err = r.DeleteAllDeadTasks()
default:
fmt.Printf("error: `asynqmon delall [state]` only accepts %v as the argument.\n", delallValidArgs)
fmt.Printf("error: `asynq delall [state]` only accepts %v as the argument.\n", delallValidArgs)
os.Exit(1)
}
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions tools/asynq/cmd/enq.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ import (
var enqCmd = &cobra.Command{
Use: "enq [task id]",
Short: "Enqueues a task given an identifier",
Long: `Enq (asynqmon enq) will enqueue a task given an identifier.
Long: `Enq (asynq enq) will enqueue a task given an identifier.
The command takes one argument which specifies the task to enqueue.
The task should be in either scheduled, retry or dead state.
Identifier for a task should be obtained by running "asynqmon ls" command.
Identifier for a task should be obtained by running "asynq ls" command.
The task enqueued by this command will be processed as soon as the task
gets dequeued by a processor.
Example: asynqmon enq d:1575732274:bnogo8gt6toe23vhef0g`,
Example: asynq enq d:1575732274:bnogo8gt6toe23vhef0g`,
Args: cobra.ExactArgs(1),
Run: enq,
}
Expand Down
6 changes: 3 additions & 3 deletions tools/asynq/cmd/enqall.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ var enqallValidArgs = []string{"scheduled", "retry", "dead"}
var enqallCmd = &cobra.Command{
Use: "enqall [state]",
Short: "Enqueues all tasks in the specified state",
Long: `Enqall (asynqmon enqall) will enqueue all tasks in the specified state.
Long: `Enqall (asynq enqall) will enqueue all tasks in the specified state.
The argument should be one of "scheduled", "retry", or "dead".
The tasks enqueued by this command will be processed as soon as it
gets dequeued by a processor.
Example: asynqmon enqall dead -> Enqueues all dead tasks`,
Example: asynq enqall dead -> Enqueues all dead tasks`,
ValidArgs: enqallValidArgs,
Args: cobra.ExactValidArgs(1),
Run: enqall,
Expand Down Expand Up @@ -64,7 +64,7 @@ func enqall(cmd *cobra.Command, args []string) {
case "dead":
n, err = r.EnqueueAllDeadTasks()
default:
fmt.Printf("error: `asynqmon enqall [state]` only accepts %v as the argument.\n", enqallValidArgs)
fmt.Printf("error: `asynq enqall [state]` only accepts %v as the argument.\n", enqallValidArgs)
os.Exit(1)
}
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions tools/asynq/cmd/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ var days int
var historyCmd = &cobra.Command{
Use: "history",
Short: "Shows historical aggregate data",
Long: `History (asynqmon history) will show the number of processed and failed tasks
Long: `History (asynq history) will show the number of processed and failed tasks
from the last x days.
By default, it will show the data from the last 10 days.
Example: asynqmon history -x=30 -> Shows stats from the last 30 days`,
Example: asynq history -x=30 -> Shows stats from the last 30 days`,
Args: cobra.NoArgs,
Run: history,
}
Expand Down
6 changes: 3 additions & 3 deletions tools/asynq/cmd/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
var killCmd = &cobra.Command{
Use: "kill [task id]",
Short: "Kills a task given an identifier",
Long: `Kill (asynqmon kill) will put a task in dead state given an identifier.
Long: `Kill (asynq kill) will put a task in dead state given an identifier.
The command takes one argument which specifies the task to kill.
The task should be in either scheduled or retry state.
Identifier for a task should be obtained by running "asynqmon ls" command.
Identifier for a task should be obtained by running "asynq ls" command.
Example: asynqmon kill r:1575732274:bnogo8gt6toe23vhef0g`,
Example: asynq kill r:1575732274:bnogo8gt6toe23vhef0g`,
Args: cobra.ExactArgs(1),
Run: kill,
}
Expand Down
6 changes: 3 additions & 3 deletions tools/asynq/cmd/killall.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ var killallValidArgs = []string{"scheduled", "retry"}
var killallCmd = &cobra.Command{
Use: "killall [state]",
Short: "Kills all tasks in the specified state",
Long: `Killall (asynqmon killall) will update all tasks from the specified state to dead state.
Long: `Killall (asynq killall) will update all tasks from the specified state to dead state.
The argument should be either "scheduled" or "retry".
Example: asynqmon killall retry -> Update all retry tasks to dead tasks`,
Example: asynq killall retry -> Update all retry tasks to dead tasks`,
ValidArgs: killallValidArgs,
Args: cobra.ExactValidArgs(1),
Run: killall,
Expand Down Expand Up @@ -59,7 +59,7 @@ func killall(cmd *cobra.Command, args []string) {
case "retry":
n, err = r.KillAllRetryTasks()
default:
fmt.Printf("error: `asynqmon killall [state]` only accepts %v as the argument.\n", killallValidArgs)
fmt.Printf("error: `asynq killall [state]` only accepts %v as the argument.\n", killallValidArgs)
os.Exit(1)
}
if err != nil {
Expand Down
Loading

0 comments on commit cf61911

Please sign in to comment.