Skip to content

Commit f191ed5

Browse files
fix 🐞: Fixed small requested changes
1 parent 5242b7a commit f191ed5

File tree

5 files changed

+4
-7
lines changed

5 files changed

+4
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ To run the gateway in a prod environment with Docker Compose, follow these steps
100100
This script firstly generated the `telemetry/prometheus/prometheus-prod.yml` config file starting from the `telemetry/prometheus/prometheus-template.yml` (step required to perform the variable substitution) and then simply run the gateway with the following command:
101101

102102
```
103-
docker compose -f docker-compose.yml -f docker-compose-local.yml --env-file .env up -d --build
103+
docker compose -f docker-compose.yml -f docker-compose-prod.yml --env-file .env up -d --build
104104
```
105105

106106
5. To stop and clean all the local environment a bash script [stop_prod_docker_environment.sh](./scripts/stop_prod_docker_environment.sh) is provided. You can execute it with the command:

scripts/start_local_docker_environment.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ dfx start --clean --background
66
echo "Removing previous local websocket image"
77
docker rmi local/ic-websocket-gateway
88

9-
# https://docs.docker.com/compose/environment-variables/set-environment-variables/#:~:text=doesnotexist/.env.dev-,You%20can%20use%20multiple,them%20in%20order.%20Later%20files%20can%20override%20variables%20from%20earlier%20files.,-%24%20docker%20compose
109
echo "Starting docker environment"
1110
docker compose -f docker-compose.yml -f docker-compose-local.yml --env-file .env.local up -d --build

scripts/start_prod_docker_environment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set +a # Stop automatically exporting
88

99
# Run envsubst
1010
envsubst < ./telemetry/prometheus/prometheus-template.yml > ./telemetry/prometheus/prometheus-prod.yml
11+
echo "File telemetry/prometheus/prometheus-prod.yml successfully created"
1112

12-
# https://docs.docker.com/compose/environment-variables/set-environment-variables/#:~:text=doesnotexist/.env.dev-,You%20can%20use%20multiple,them%20in%20order.%20Later%20files%20can%20override%20variables%20from%20earlier%20files.,-%24%20docker%20compose
1313
echo "Starting docker environment"
1414
docker compose -f docker-compose.yml -f docker-compose-prod.yml --env-file .env up -d

src/ic-websocket-gateway/src/client_session_handler.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl ClientSessionHandler {
112112
mut client_channel_tx: Option<Sender<IcWsCanisterMessage>>,
113113
client_session_span: Span,
114114
) -> Result<(), String> {
115-
let mut client_start_session_time = Instant::now();
115+
let client_start_session_time = Instant::now();
116116

117117
// keeps trying to update the client session state
118118
// if a new state is returned, execute the corresponding logic
@@ -200,8 +200,6 @@ impl ClientSessionHandler {
200200
// Calculate the time it took to open the connection and record it using the timer started in ws_listener.rs
201201
let delta = self.start_connection_time.elapsed();
202202
histogram!("connection_opening_time", "client_key" => client_key.to_string()).record(delta);
203-
204-
client_start_session_time = Instant::now();
205203
});
206204
// do not return anything as the session is still alive
207205
},

src/ic-websocket-gateway/src/gateway_metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn init_metrics(port: Option<u16>) -> Result<(), Box<dyn Error>> {
1919
.expect("failed to install Prometheus recorder");
2020

2121
describe_gauge!("clients_connected", "The number of clients currently connected");
22-
describe_gauge!("active_pollers", "The number of pollers currently connected");
22+
describe_gauge!("active_pollers", "The number of pollers currently active");
2323
describe_histogram!(
2424
"connection_duration",
2525
"The duration of the client connection"

0 commit comments

Comments
 (0)