Skip to content

Commit

Permalink
feat(server): support for monitor command. message to dispatch async …
Browse files Browse the repository at this point in the history
…now support monitor type as well. (dragonflydb#344)

feat(server): monitor command, add command filters

feat(server): support for monitor command. spport for auth not showing sensitive data (dragonflydb#344)

feat(server): monitor command output format support none pritable char as well

feat(server): monitor command - move monitor handling after verify and run other command, add cleanup when connection closed (dragonflydb#344)

feat(server): monitor command - disable by default (dragonflydb#344)

Signed-off-by: Boaz Sade <[email protected]>
  • Loading branch information
boazsade committed Oct 21, 2022
1 parent 805f8c5 commit 0e7e837
Show file tree
Hide file tree
Showing 12 changed files with 509 additions and 97 deletions.
2 changes: 1 addition & 1 deletion docs/api_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ with respect to Memcached and Redis APIs.
- [X] ZSCORE
- [ ] Other
- [ ] BGREWRITEAOF
- [ ] MONITOR
- [x] MONITOR
- [ ] RANDOMKEY

### API 2
Expand Down
22 changes: 15 additions & 7 deletions src/facade/conn_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ConnectionContext {

// We won't have any virtual methods, probably. However, since we allocate a derived class,
// we need to declare a virtual d-tor, so we could properly delete it from Connection code.
virtual ~ConnectionContext() {}
virtual ~ConnectionContext() {
}

Connection* owner() {
return owner_;
Expand All @@ -44,12 +45,19 @@ class ConnectionContext {
}

// connection state / properties.
bool async_dispatch: 1; // whether this connection is currently handled by dispatch fiber.
bool conn_closing: 1;
bool req_auth: 1;
bool replica_conn: 1;
bool authenticated: 1;
bool force_dispatch: 1; // whether we should route all requests to the dispatch fiber.
bool async_dispatch : 1; // whether this connection is currently handled by dispatch fiber.
bool conn_closing : 1;
bool req_auth : 1;
bool replica_conn : 1;
bool authenticated : 1;
bool force_dispatch : 1; // whether we should route all requests to the dispatch fiber.
bool monitor : 1; // when the connection is monitor do not support most commands other
// than quit and reset
protected:
void EnableMonitoring(bool enable) {
force_dispatch = enable; // required to support the monitoring
monitor = enable;
}

private:
Connection* owner_;
Expand Down
Loading

0 comments on commit 0e7e837

Please sign in to comment.