Skip to content

Commit a79040c

Browse files
committed
Fix clippy and documentation
- Update CLI flags in docs and clippy/lint errors
1 parent 7a8efaf commit a79040c

File tree

7 files changed

+45
-29
lines changed

7 files changed

+45
-29
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/user/data/mz-debug/emulator_options.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,16 @@ columns:
22
- column: "Option"
33
- column: "Description"
44
rows:
5-
- Option: "`--dump-docker <boolean>`"
6-
Description: |
7-
8-
<a name="dump-docker"></a> If `true`, dump debug information from the Docker container.
9-
10-
Defaults to `true`.
11-
125
- Option: "`--docker-container-id <ID>`"
136
Description: |
147
158
<a name="docker-container-id"></a> The Docker container to dump.
169
17-
Required if [`--dump-docker`](#dump-docker) is true.
10+
Required.
1811
19-
- Option: "`--mz-connection-url <URL>`"
12+
- Option: "`--dump-docker <boolean>`"
2013
Description: |
2114
22-
<a name="mz-connection-url"></a>The URL of the Materialize's SQL
23-
connection.
15+
<a name="dump-docker"></a> If `true`, dump debug information from the Docker container.
2416
25-
Defaults to `postgres://127.0.0.1:6875/materialize?sslmode=prefer`.
17+
Defaults to `true`.

doc/user/data/mz-debug/mz_debug_option.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,36 @@ columns:
22
- column: "Option"
33
- column: "Description"
44
rows:
5+
- Option: "`--dump-heap-profiles <boolean>`"
6+
Description: |
7+
8+
<a name="dump-heap-profiles"></a> If `true`, dump heap profiles (.pprof) from
9+
your Materialize instance.
10+
11+
Defaults to `true`.
12+
- Option: "`--dump-prometheus-metrics <boolean>`"
13+
Description: |
14+
15+
<a name="dump-prometheus-metrics"></a> If `true`, dump prometheus metrics from
16+
your Materialize instance.
17+
18+
Defaults to `true`.
19+
20+
521
- Option: "`--dump-system-catalog <boolean>`"
622
Description: |
723
824
<a name="dump-system-catalog"></a> If `true`, dump the system catalog from
925
your Materialize instance.
1026
1127
Defaults to `true`.
28+
29+
30+
- Option: "`--mz-connection-url <URL>`"
31+
Description: |
32+
33+
<a name="mz-connection-url"></a>The Materialize instance's [PostgreSQL
34+
connection
35+
URL](https://www.postgresql.org/docs/14/libpq-connect.html#LIBPQ-CONNSTRING).
36+
37+
Defaults to `postgres://127.0.0.1:6875/materialize?sslmode=prefer`.

doc/user/data/mz-debug/self_managed_options.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ rows:
5757
5858
Defaults to `6875`.
5959
60-
- Option: "`--mz-connection-url <URL>`"
61-
Description: |
62-
63-
<a name="mz-connection-url"></a>The Materialize instance's [PostgreSQL
64-
connection
65-
URL](https://www.postgresql.org/docs/14/libpq-connect.html#LIBPQ-CONNSTRING).
66-
67-
Defaults to a connection URL constructed from:
68-
69-
[`--port-forward-local-address`](#port-forward-local-address) and
70-
[`--port-forward-local-port`](#port-forward-local-port) values.
71-
7260
- Option: "`-h`, `--help`"
7361
Description: |
7462

src/mz-debug/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "mz-debug"
33
description = "Debug tool for self-managed Materialize."
4-
version = "0.1.0"
4+
version = "0.2.0"
55
edition.workspace = true
66
rust-version.workspace = true
77
publish = false

src/mz-debug/src/internal_http_dumper.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright Materialize, Inc. and contributors. All rights reserved.
2+
//
3+
// Use of this software is governed by the Business Source License
4+
// included in the LICENSE file.
5+
//
6+
// As of the Change Date specified in that file, in accordance with
7+
// the Business Source License, use of this software will be governed
8+
// by the Apache License, Version 2.0.
9+
10+
//! Dumps internal http debug information to files.
111
use anyhow::{Context as AnyhowContext, Result};
212
use futures::StreamExt;
313
use k8s_openapi::api::core::v1::ServicePort;
@@ -95,7 +105,7 @@ impl<'n> InternalHttpDumpClient<'n> {
95105
let output_path = output_dir.join(format!("{}.memprof.pprof", service_name));
96106

97107
self.dump_request_to_file(
98-
&relative_url,
108+
relative_url,
99109
{
100110
let mut headers = HeaderMap::new();
101111
headers.insert(
@@ -127,7 +137,7 @@ impl<'n> InternalHttpDumpClient<'n> {
127137

128138
let output_path = output_dir.join(format!("{}.metrics.txt", service_name));
129139
self.dump_request_to_file(
130-
&relative_url,
140+
relative_url,
131141
{
132142
let mut headers = HeaderMap::new();
133143
headers.insert("Accept", HeaderValue::from_static("text/plain"));

src/mz-debug/src/kubectl_port_forwarder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub async fn create_pg_wire_port_forwarder(
202202
) -> Result<KubectlPortForwarder> {
203203
let service_info = find_environmentd_service(client, k8s_namespaces)
204204
.await
205-
.with_context(|| format!("Cannot find ports for environmentd service"))?;
205+
.with_context(|| "Cannot find ports for environmentd service")?;
206206

207207
let maybe_internal_sql_port = service_info.service_ports.iter().find_map(|port_info| {
208208
if let Some(port_name) = &port_info.name {

0 commit comments

Comments
 (0)