From ecaefc15c061b6d623db53eaac6ee665f26e5f90 Mon Sep 17 00:00:00 2001 From: b1ron Date: Mon, 21 Aug 2023 13:40:23 +0200 Subject: [PATCH 1/4] wip --- CONTRIBUTING.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 46efce9fa5ec..3dfd4f924cbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,6 +107,36 @@ While running, it logs a difference between both returned responses, but sends the one from FerretDB to the client. If you want to get the MongoDB response, you can run `task run-proxy` to start FerretDB in `diff-proxy` mode. +#### Diff-proxy mode in use + +As well as collecting metrics for telemetry, `diff-proxy` mode will also write command metrics to stdout upon an interrupt signal. This is a useful way to quickly determine what commands are unimplemented for the client requests sent by your application. + +```sh +# we ran task run-proxy and then sent an interrupt ctrl+c after some time +^Ctask: Signal received: "interrupt" +# HELP ferretdb_client_requests_total Total number of requests. +# TYPE ferretdb_client_requests_total counter +ferretdb_client_requests_total{command="aggregate",opcode="OP_MSG"} 105 +ferretdb_client_requests_total{command="find",opcode="OP_MSG"} 398 +ferretdb_client_requests_total{command="findAndModify",opcode="OP_MSG"} 6 +ferretdb_client_requests_total{command="hello",opcode="OP_MSG"} 4 +ferretdb_client_requests_total{command="insert",opcode="OP_MSG"} 10 +ferretdb_client_requests_total{command="ismaster",opcode="OP_MSG"} 17 +ferretdb_client_requests_total{command="unknown",opcode="OP_QUERY"} 28 +ferretdb_client_requests_total{command="update",opcode="OP_MSG"} 59 +# HELP ferretdb_client_responses_total Total number of responses. +# TYPE ferretdb_client_responses_total counter +ferretdb_client_responses_total{argument="$first (accumulator)",command="aggregate",opcode="OP_MSG",result="NotImplemented"} 18 +ferretdb_client_responses_total{argument="fields",command="findAndModify",opcode="OP_MSG",result="NotImplemented"} 6 +ferretdb_client_responses_total{argument="unknown",command="aggregate",opcode="OP_MSG",result="ok"} 87 +ferretdb_client_responses_total{argument="unknown",command="find",opcode="OP_MSG",result="ok"} 398 +ferretdb_client_responses_total{argument="unknown",command="hello",opcode="OP_MSG",result="ok"} 4 +ferretdb_client_responses_total{argument="unknown",command="insert",opcode="OP_MSG",result="ok"} 10 +ferretdb_client_responses_total{argument="unknown",command="ismaster",opcode="OP_MSG",result="ok"} 17 +ferretdb_client_responses_total{argument="unknown",command="unknown",opcode="OP_REPLY",result="ok"} 28 +ferretdb_client_responses_total{argument="unknown",command="update",opcode="OP_MSG",result="ok"} 59 +``` + ### Code overview The directory `cmd` provides commands implementation. From 77d7c06e93833a097134c9d2787bec2d863717ad Mon Sep 17 00:00:00 2001 From: b1ron Date: Mon, 21 Aug 2023 15:28:39 +0200 Subject: [PATCH 2/4] lint and heading --- CONTRIBUTING.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3dfd4f924cbe..174eaa3201b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,9 +107,10 @@ While running, it logs a difference between both returned responses, but sends the one from FerretDB to the client. If you want to get the MongoDB response, you can run `task run-proxy` to start FerretDB in `diff-proxy` mode. -#### Diff-proxy mode in use +#### Diff-proxy mode in action -As well as collecting metrics for telemetry, `diff-proxy` mode will also write command metrics to stdout upon an interrupt signal. This is a useful way to quickly determine what commands are unimplemented for the client requests sent by your application. +As well as collecting metrics for telemetry, `diff-proxy` mode will also write command metrics to stdout upon an interrupt signal. +This is a useful way to quickly determine what commands are unimplemented for the client requests sent by your application. ```sh # we ran task run-proxy and then sent an interrupt ctrl+c after some time From bf0f64b19feed579eb90ff6d7294b22e18dd739e Mon Sep 17 00:00:00 2001 From: b1ron Date: Mon, 21 Aug 2023 15:31:28 +0200 Subject: [PATCH 3/4] wording --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 174eaa3201b1..40fd64209b8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,7 +109,7 @@ If you want to get the MongoDB response, you can run `task run-proxy` to start F #### Diff-proxy mode in action -As well as collecting metrics for telemetry, `diff-proxy` mode will also write command metrics to stdout upon an interrupt signal. +As well as collecting metrics for telemetry, `diff-proxy` mode will also write command metrics to stdout upon receiving an interrupt signal. This is a useful way to quickly determine what commands are unimplemented for the client requests sent by your application. ```sh From ce39d91e06c985e0ddf38877ce4329a19dbf7ab5 Mon Sep 17 00:00:00 2001 From: b1ron Date: Wed, 23 Aug 2023 10:30:36 +0200 Subject: [PATCH 4/4] wording --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 40fd64209b8d..d57483b5e8ef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,7 @@ If you want to get the MongoDB response, you can run `task run-proxy` to start F #### Diff-proxy mode in action As well as collecting metrics for telemetry, `diff-proxy` mode will also write command metrics to stdout upon receiving an interrupt signal. -This is a useful way to quickly determine what commands are unimplemented for the client requests sent by your application. +This is a useful way to quickly determine what commands are not implemented for the client requests sent by your application. ```sh # we ran task run-proxy and then sent an interrupt ctrl+c after some time