diff --git a/doc/user/content/sql/system-catalog/mz_catalog.md b/doc/user/content/sql/system-catalog/mz_catalog.md index 9040e067eda23..02e73dee7791c 100644 --- a/doc/user/content/sql/system-catalog/mz_catalog.md +++ b/doc/user/content/sql/system-catalog/mz_catalog.md @@ -63,10 +63,28 @@ Field | Type | Meaning ---------------|------------|---------- `id` | [`text`] | The ID of the type. +### `mz_cluster_replica_metrics_history` + +{{< warn-if-unreleased v0.115 >}} +The `mz_cluster_replica_metrics_history` table records CPU, memory, and disk utilization metrics +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. + + +| Field | Type | Meaning +| ---------------- | --------- | -------- +| `replica_id` | [`text`] | The ID of a cluster replica. +| `process_id` | [`uint8`] | An identifier 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. +| `occurred_at` | [`timestamp with time zone`] | Wall-clock timestamp at which the event occurred. + ### `mz_cluster_replica_sizes` The `mz_cluster_replica_sizes` table contains a mapping of logical sizes -(e.g. `100cc`) to physical sizes (number of processes, and CPU and memory allocations per process). +(e.g. `100cc`) to physical sizes (number of processes and resource allocations per process). This table was previously in the `mz_internal` schema. All queries previously referencing `mz_internal.mz_cluster_replica_sizes` should now reference `mz_catalog.mz_cluster_replica_sizes`. @@ -77,16 +95,34 @@ any kind of capacity planning. {{< /warning >}} -| Field | Type | Meaning | +| Field | Type | Meaning |------------------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| | `size` | [`text`] | The human-readable replica size. | | `processes` | [`uint8`] | The number of processes in the replica. | | `workers` | [`uint8`] | The number of Timely Dataflow workers per process. | -| `cpu_nano_cores` | [`uint8`] | The CPU allocation per process, in billionths of a vCPU core. | -| `memory_bytes` | [`uint8`] | The RAM allocation per process, in billionths of a vCPU core. | -| `disk_bytes` | [`uint8`] | The disk allocation per process. | +| `cpu_nano_cores` | [`uint8`] | The CPU allocation per process in billionths of a vCPU core. | +| `memory_bytes` | [`uint8`] | The RAM allocation per process in bytes. | +| `disk_bytes` | [`uint8`] | The disk allocation per process in bytes. | | `credits_per_hour` | [`numeric`] | The number of compute credits consumed per hour. | +### `mz_cluster_replica_utilization_history` + +{{< warn-if-unreleased v0.115 >}} +The `mz_cluster_replica_utilization_history` view records CPU, memory, and disk utilization metrics +for all processes of all extant cluster replicas, as a percentage of the total resource allocation. + +At this time, we do not make any guarantees about the exactness or freshness of these numbers. + + +| Field | Type | Meaning +|------------------|----------------------|-------- +| `replica_id` | [`text`] | The ID of a cluster replica. +| `process_id` | [`uint8`] | An identifier of a compute 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. +| `occurred_at` | [`timestamp with time zone`] | Wall-clock timestamp at which the event occurred. + ### `mz_cluster_replicas` The `mz_cluster_replicas` table contains a row for each cluster replica in the system. @@ -614,6 +650,7 @@ Field | Type | Meaning [`bigint`]: /sql/types/bigint [`boolean`]: /sql/types/boolean +[`double precision`]: /sql/types/double-precision [`integer`]: /sql/types/integer/ [`interval`]: /sql/types/interval [`jsonb`]: /sql/types/jsonb diff --git a/test/sqllogictest/autogenerated/mz_catalog.slt b/test/sqllogictest/autogenerated/mz_catalog.slt index cfbfae2fd0ea0..6fd133093a24a 100644 --- a/test/sqllogictest/autogenerated/mz_catalog.slt +++ b/test/sqllogictest/autogenerated/mz_catalog.slt @@ -56,6 +56,16 @@ SELECT position, name, type FROM objects WHERE schema = 'mz_catalog' AND object ---- 1 id text +query ITT +SELECT position, name, type FROM objects WHERE schema = 'mz_catalog' AND object = 'mz_cluster_replica_metrics_history' ORDER BY position +---- +1 replica_id text +2 process_id uint8 +3 cpu_nano_cores uint8 +4 memory_bytes uint8 +5 disk_bytes uint8 +6 occurred_at timestamp␠with␠time␠zone + query ITT SELECT position, name, type FROM objects WHERE schema = 'mz_catalog' AND object = 'mz_cluster_replica_sizes' ORDER BY position ---- @@ -67,6 +77,16 @@ SELECT position, name, type FROM objects WHERE schema = 'mz_catalog' AND object 6 disk_bytes uint8 7 credits_per_hour numeric +query ITT +SELECT position, name, type FROM objects WHERE schema = 'mz_catalog' AND object = 'mz_cluster_replica_utilization_history' ORDER BY position +---- +1 replica_id text +2 process_id uint8 +3 cpu_percent double␠precision +4 memory_percent double␠precision +5 disk_percent double␠precision +6 occurred_at timestamp␠with␠time␠zone + query ITT SELECT position, name, type FROM objects WHERE schema = 'mz_catalog' AND object = 'mz_cluster_replicas' ORDER BY position ---- @@ -411,7 +431,9 @@ mz_array_types mz_audit_events mz_aws_privatelink_connections mz_base_types +mz_cluster_replica_metrics_history mz_cluster_replica_sizes +mz_cluster_replica_utilization_history mz_cluster_replicas mz_clusters mz_columns