From f9f111ce9020c00b327563cb55312172b240b58c Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 6 Jan 2025 20:47:29 +0200 Subject: [PATCH 1/5] Create monitor.md --- commands/monitor.md | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 commands/monitor.md diff --git a/commands/monitor.md b/commands/monitor.md new file mode 100644 index 0000000..f6ee297 --- /dev/null +++ b/commands/monitor.md @@ -0,0 +1,50 @@ +--- +title: "MONITOR" +nav_order: 110 +description: > + Allows administrators to observe all requests processed by the database in real-time. +parent: "Commands" +--- + +# MONITOR + +Allows administrators to observe all requests processed by the database in real-time. +This feature is invaluable for debugging, performance analysis, and understanding the sequence of operations occurring in the database. + +Usage: `MONITOR` + +## Example + +``` +> MONITOR +``` + +## Output + +```sh +1673022405.123456 [0 127.0.0.1:6379] "GRAPH.QUERY" "MyGraph" "MATCH (n) return n" +1673022405.123789 [0 127.0.0.1:6379] "GRAPH.DELETE" "MyGraph" +``` + +Each line includes the following: + +1. **Timestamp:** The precise time when the command was received. +2. **Database Index:** The database number where the command was executed (e.g., `[0]`). +3. **Client Info:** The IP address and port of the client that issued the command. +4. **Command:** The exact command and its arguments. + +## Considerations + +- **Security:** Ensure `MONITOR` is used only by trusted users. It exposes all incoming commands, including potentially sensitive data. +- **Overhead:** `MONITOR` can slow down the database, especially under high load, due to the additional I/O required to stream the logs. +- **Connection Restriction:** Typically, `MONITOR` should be run from a dedicated connection. Mixing it with other commands can result in undefined behavior. + +## Terminating MONITOR + +To stop the `MONITOR` stream, simply close the client connection (e.g., terminate the session or disconnect the client tool). There is no specific `UNMONITOR` command. + +## Best Practices + +- Use `MONITOR` sparingly in production environments. +- Combine `MONITOR` with logging or analysis tools for deeper insights. +- Restrict access to users who require diagnostic capabilities. From e14528c37723bccb834711da3dee5d2454b6a016 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Thu, 16 Jan 2025 20:06:29 +0200 Subject: [PATCH 2/5] Update MONITOR command documentation for clarity --- commands/monitor.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commands/monitor.md b/commands/monitor.md index f6ee297..c25120d 100644 --- a/commands/monitor.md +++ b/commands/monitor.md @@ -2,14 +2,14 @@ title: "MONITOR" nav_order: 110 description: > - Allows administrators to observe all requests processed by the database in real-time. + Allows to observe all requests processed by the database in real-time. parent: "Commands" --- # MONITOR -Allows administrators to observe all requests processed by the database in real-time. -This feature is invaluable for debugging, performance analysis, and understanding the sequence of operations occurring in the database. +Allows to observe all requests processed by the database in real-time. +This feature is invaluable for debugging and understanding the sequence of operations occurring in the database. Usage: `MONITOR` @@ -41,10 +41,10 @@ Each line includes the following: ## Terminating MONITOR -To stop the `MONITOR` stream, simply close the client connection (e.g., terminate the session or disconnect the client tool). There is no specific `UNMONITOR` command. +To stop the `MONITOR` stream, simply close the client connection (e.g., terminate the session or disconnect the client tool). ## Best Practices - Use `MONITOR` sparingly in production environments. - Combine `MONITOR` with logging or analysis tools for deeper insights. -- Restrict access to users who require diagnostic capabilities. +- Restrict access to users who require diagnostic capabilities, see: [ACL](/commands/acl) for more details. From 1567fab44273ba4a08dc38ceed5f112ca800d1cb Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Wed, 5 Mar 2025 14:17:06 +0200 Subject: [PATCH 3/5] Update commands/monitor.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- commands/monitor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/monitor.md b/commands/monitor.md index c25120d..58e4cf1 100644 --- a/commands/monitor.md +++ b/commands/monitor.md @@ -36,7 +36,7 @@ Each line includes the following: ## Considerations - **Security:** Ensure `MONITOR` is used only by trusted users. It exposes all incoming commands, including potentially sensitive data. -- **Overhead:** `MONITOR` can slow down the database, especially under high load, due to the additional I/O required to stream the logs. +- **Overhead:** `MONITOR` can slow down the database, especially under high load, due to the additional I/O required for streaming the logs. - **Connection Restriction:** Typically, `MONITOR` should be run from a dedicated connection. Mixing it with other commands can result in undefined behavior. ## Terminating MONITOR From 3b0469ef7027ffdec0bbce4f68778f16f1350418 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Wed, 5 Mar 2025 14:17:24 +0200 Subject: [PATCH 4/5] Update commands/monitor.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- commands/monitor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/monitor.md b/commands/monitor.md index 58e4cf1..3a723c1 100644 --- a/commands/monitor.md +++ b/commands/monitor.md @@ -2,7 +2,7 @@ title: "MONITOR" nav_order: 110 description: > - Allows to observe all requests processed by the database in real-time. + Allows you to observe all requests processed by the database in real-time. parent: "Commands" --- From fd794bedeecee2e24521ed4115535fe10960cae7 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Wed, 16 Apr 2025 08:53:15 +0300 Subject: [PATCH 5/5] Add shell syntax highlighting to code block --- commands/monitor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/monitor.md b/commands/monitor.md index 3a723c1..d315096 100644 --- a/commands/monitor.md +++ b/commands/monitor.md @@ -15,7 +15,7 @@ Usage: `MONITOR` ## Example -``` +```sh > MONITOR ```