Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 20 additions & 26 deletions doc/user/content/sql/system-catalog/mz_internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,13 @@ for all processes of all extant cluster replicas.
At this time, we do not make any guarantees about the exactness or freshness of these numbers.

<!-- RELATION_SPEC mz_internal.mz_cluster_replica_metrics -->
| Field | Type | Meaning
| ------------------- | ------------ | --------
| `replica_id` | [`text`] | The ID of a cluster replica.
| `process_id` | [`uint8`] | The ID of a process within the replica.
| `cpu_nano_cores` | [`uint8`] | Approximate CPU usage, in billionths of a vCPU core.
| `memory_bytes` | [`uint8`] | Approximate RAM usage, in bytes.
| `disk_bytes` | [`uint8`] | Approximate disk usage, in bytes.
| `heap_bytes` | [`uint8`] | Approximate heap (RAM + swap) usage, in bytes.
| `heap_limit` | [`uint8`] | Available heap (RAM + swap) space, in bytes.
| Field | Type | Meaning |
| ------------------- | ------------ | -------- |
| `replica_id` | [`text`] | The ID of a cluster replica. |
| `process_id` | [`uint8`] | The ID of a process within the replica. |
| `cpu_nano_cores` | [`uint8`] | Approximate CPU usage, in billionths of a vCPU core. |
| `memory_bytes` | [`uint8`] | Approximate RAM usage, in bytes. |
| `disk_bytes` | [`uint8`] | Approximate disk usage in bytes. |

## `mz_cluster_replica_metrics_history`

Expand All @@ -185,12 +183,10 @@ At this time, we do not make any guarantees about the exactness or freshness of
| ---------------- | --------- | --------
| `replica_id` | [`text`] | The ID of a cluster replica.
| `process_id` | [`uint8`] | The ID of a process within the replica.
| `cpu_nano_cores` | [`uint8`] | Approximate CPU usage, in billionths of a vCPU core.
| `memory_bytes` | [`uint8`] | Approximate memory usage, in bytes.
| `disk_bytes` | [`uint8`] | Approximate disk usage, in bytes.
| `cpu_nano_cores` | [`uint8`] | Approximate CPU usage in billionths of a vCPU core.
| `memory_bytes` | [`uint8`] | Approximate memory usage in bytes.
| `disk_bytes` | [`uint8`] | Approximate disk usage in bytes.
| `occurred_at` | [`timestamp with time zone`] | Wall-clock timestamp at which the event occurred.
| `heap_bytes` | [`uint8`] | Approximate heap (RAM + swap) usage, in bytes.
| `heap_limit` | [`uint8`] | Available heap (RAM + swap) space, in bytes.

## `mz_cluster_replica_statuses`

Expand Down Expand Up @@ -229,14 +225,13 @@ for all processes of all extant cluster replicas, as a percentage of the total r
At this time, we do not make any guarantees about the exactness or freshness of these numbers.

<!-- RELATION_SPEC mz_internal.mz_cluster_replica_utilization -->
| Field | Type | Meaning
|------------------|----------------------|---------
| `replica_id` | [`text`] | The ID of a cluster replica.
| `process_id` | [`uint8`] | The ID of a process within the replica.
| `cpu_percent` | [`double precision`] | Approximate CPU usage, in percent of the total allocation.
| `memory_percent` | [`double precision`] | Approximate RAM usage, in percent of the total allocation.
| `disk_percent` | [`double precision`] | Approximate disk usage, in percent of the total allocation.
| `heap_percent` | [`double precision`] | Approximate heap (RAM + swap) usage, in percent of the total allocation.
| Field | Type | Meaning |
|------------------|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `replica_id` | [`text`] | The ID of a cluster replica. |
| `process_id` | [`uint8`] | The ID of a process within the replica. |
| `cpu_percent` | [`double precision`] | Approximate CPU usage in percent of the total allocation. |
| `memory_percent` | [`double precision`] | Approximate RAM usage in percent of the total allocation. |
| `disk_percent` | [`double precision`] | Approximate disk usage in percent of the total allocation. |

## `mz_cluster_replica_utilization_history`

Expand All @@ -251,10 +246,9 @@ At this time, we do not make any guarantees about the exactness or freshness of
|------------------|----------------------|--------
| `replica_id` | [`text`] | The ID of a cluster replica.
| `process_id` | [`uint8`] | The ID of a process within the replica.
| `cpu_percent` | [`double precision`] | Approximate CPU usage, in percent of the total allocation.
| `memory_percent` | [`double precision`] | Approximate RAM usage, in percent of the total allocation.
| `disk_percent` | [`double precision`] | Approximate disk usage, in percent of the total allocation.
| `heap_percent` | [`double precision`] | Approximate heap (RAM + swap) usage, in percent of the total allocation.
| `cpu_percent` | [`double precision`] | Approximate CPU usage in percent of the total allocation.
| `memory_percent` | [`double precision`] | Approximate RAM usage in percent of the total allocation.
| `disk_percent` | [`double precision`] | Approximate disk usage in percent of the total allocation.
| `occurred_at` | [`timestamp with time zone`] | Wall-clock timestamp at which the event occurred.

## `mz_cluster_replica_history`
Expand Down
50 changes: 12 additions & 38 deletions src/catalog/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4893,19 +4893,14 @@ pub static MZ_CLUSTER_REPLICA_METRICS_HISTORY: LazyLock<BuiltinSource> =
("process_id", "The ID of a process within the replica."),
(
"cpu_nano_cores",
"Approximate CPU usage, in billionths of a vCPU core.",
"Approximate CPU usage in billionths of a vCPU core.",
),
("memory_bytes", "Approximate memory usage, in bytes."),
("disk_bytes", "Approximate disk usage, in bytes."),
("memory_bytes", "Approximate memory usage in bytes."),
("disk_bytes", "Approximate disk usage in bytes."),
(
"occurred_at",
"Wall-clock timestamp at which the event occurred.",
),
(
"heap_bytes",
"Approximate heap (RAM + swap) usage, in bytes.",
),
("heap_limit", "Available heap (RAM + swap) space, in bytes."),
]),
is_retained_metrics_object: false,
access: vec![PUBLIC_SELECT],
Expand Down Expand Up @@ -4939,8 +4934,6 @@ pub static MZ_CLUSTER_REPLICA_METRICS: LazyLock<BuiltinView> = LazyLock::new(||
.with_column("cpu_nano_cores", SqlScalarType::UInt64.nullable(true))
.with_column("memory_bytes", SqlScalarType::UInt64.nullable(true))
.with_column("disk_bytes", SqlScalarType::UInt64.nullable(true))
.with_column("heap_bytes", SqlScalarType::UInt64.nullable(true))
.with_column("heap_limit", SqlScalarType::UInt64.nullable(true))
.with_key(vec![0, 1])
.finish(),
column_comments: BTreeMap::from_iter([
Expand All @@ -4951,12 +4944,7 @@ pub static MZ_CLUSTER_REPLICA_METRICS: LazyLock<BuiltinView> = LazyLock::new(||
"Approximate CPU usage, in billionths of a vCPU core.",
),
("memory_bytes", "Approximate RAM usage, in bytes."),
("disk_bytes", "Approximate disk usage, in bytes."),
(
"heap_bytes",
"Approximate heap (RAM + swap) usage, in bytes.",
),
("heap_limit", "Available heap (RAM + swap) space, in bytes."),
("disk_bytes", "Approximate disk usage in bytes."),
]),
sql: "
SELECT
Expand All @@ -4965,9 +4953,7 @@ SELECT
process_id,
cpu_nano_cores,
memory_bytes,
disk_bytes,
heap_bytes,
heap_limit
disk_bytes
FROM mz_internal.mz_cluster_replica_metrics_history
JOIN mz_cluster_replicas r ON r.id = replica_id
ORDER BY replica_id, process_id, occurred_at DESC",
Expand Down Expand Up @@ -8866,26 +8852,21 @@ pub static MZ_CLUSTER_REPLICA_UTILIZATION: LazyLock<BuiltinView> = LazyLock::new
.with_column("cpu_percent", SqlScalarType::Float64.nullable(true))
.with_column("memory_percent", SqlScalarType::Float64.nullable(true))
.with_column("disk_percent", SqlScalarType::Float64.nullable(true))
.with_column("heap_percent", SqlScalarType::Float64.nullable(true))
.finish(),
column_comments: BTreeMap::from_iter([
("replica_id", "The ID of a cluster replica."),
("process_id", "The ID of a process within the replica."),
(
"cpu_percent",
"Approximate CPU usage, in percent of the total allocation.",
"Approximate CPU usage in percent of the total allocation.",
),
(
"memory_percent",
"Approximate RAM usage, in percent of the total allocation.",
"Approximate RAM usage in percent of the total allocation.",
),
(
"disk_percent",
"Approximate disk usage, in percent of the total allocation.",
),
(
"heap_percent",
"Approximate heap (RAM + swap) usage, in percent of the total allocation.",
"Approximate disk usage in percent of the total allocation.",
),
]),
sql: "
Expand All @@ -8894,8 +8875,7 @@ SELECT
m.process_id,
m.cpu_nano_cores::float8 / NULLIF(s.cpu_nano_cores, 0) * 100 AS cpu_percent,
m.memory_bytes::float8 / NULLIF(s.memory_bytes, 0) * 100 AS memory_percent,
m.disk_bytes::float8 / NULLIF(s.disk_bytes, 0) * 100 AS disk_percent,
m.heap_bytes::float8 / NULLIF(m.heap_limit, 0) * 100 AS heap_percent
m.disk_bytes::float8 / NULLIF(s.disk_bytes, 0) * 100 AS disk_percent
FROM
mz_catalog.mz_cluster_replicas AS r
JOIN mz_catalog.mz_cluster_replica_sizes AS s ON r.size = s.size
Expand All @@ -8914,7 +8894,6 @@ pub static MZ_CLUSTER_REPLICA_UTILIZATION_HISTORY: LazyLock<BuiltinView> =
.with_column("cpu_percent", SqlScalarType::Float64.nullable(true))
.with_column("memory_percent", SqlScalarType::Float64.nullable(true))
.with_column("disk_percent", SqlScalarType::Float64.nullable(true))
.with_column("heap_percent", SqlScalarType::Float64.nullable(true))
.with_column(
"occurred_at",
SqlScalarType::TimestampTz { precision: None }.nullable(false),
Expand All @@ -8925,19 +8904,15 @@ pub static MZ_CLUSTER_REPLICA_UTILIZATION_HISTORY: LazyLock<BuiltinView> =
("process_id", "The ID of a process within the replica."),
(
"cpu_percent",
"Approximate CPU usage, in percent of the total allocation.",
"Approximate CPU usage in percent of the total allocation.",
),
(
"memory_percent",
"Approximate RAM usage, in percent of the total allocation.",
"Approximate RAM usage in percent of the total allocation.",
),
(
"disk_percent",
"Approximate disk usage, in percent of the total allocation.",
),
(
"heap_percent",
"Approximate heap (RAM + swap) usage, in percent of the total allocation.",
"Approximate disk usage in percent of the total allocation.",
),
(
"occurred_at",
Expand All @@ -8951,7 +8926,6 @@ SELECT
m.cpu_nano_cores::float8 / NULLIF(s.cpu_nano_cores, 0) * 100 AS cpu_percent,
m.memory_bytes::float8 / NULLIF(s.memory_bytes, 0) * 100 AS memory_percent,
m.disk_bytes::float8 / NULLIF(s.disk_bytes, 0) * 100 AS disk_percent,
m.heap_bytes::float8 / NULLIF(m.heap_limit, 0) * 100 AS heap_percent,
m.occurred_at
FROM
mz_catalog.mz_cluster_replicas AS r
Expand Down
Loading