Skip to content
Merged
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
4 changes: 4 additions & 0 deletions pkg/apiserver/slowquery/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ type Model struct {
UnpackedBytesReceivedTiFlashTotal uint `gorm:"column:Unpacked_bytes_received_tiflash_total" json:"unpacked_bytes_received_tiflash_total"`
UnpackedBytesSentTiFlashCrossZone uint `gorm:"column:Unpacked_bytes_sent_tiflash_cross_zone" json:"unpacked_bytes_sent_tiflash_cross_zone"`
UnpackedBytesReceivedTiFlashCrossZone uint `gorm:"column:Unpacked_bytes_received_tiflash_cross_zone" json:"unpacked_bytes_received_tiflash_cross_zone"`

// IA remote read
IARemoteReadSegmentSize uint64 `gorm:"column:IA_remote_read_segment_size" json:"ia_remote_read_segment_size"`
IARemoteReadSegmentWaitTime float64 `gorm:"column:IA_remote_read_segment_wait_time" json:"ia_remote_read_segment_wait_time"`
}

type Field struct {
Expand Down
11 changes: 11 additions & 0 deletions pkg/apiserver/statement/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ type Model struct {
SumUnpackedBytesReceivedTiFlashTotal uint `json:"sum_unpacked_bytes_received_tiflash_total" agg:"SUM(sum_unpacked_bytes_received_tiflash_total)"`
SumUnpackedBytesSentTiFlashCrossZone uint `json:"sum_unpacked_bytes_sent_tiflash_cross_zone" agg:"SUM(sum_unpacked_bytes_sent_tiflash_cross_zone)"`
SumUnpackedBytesReceivedTiFlashCrossZone uint `json:"sum_unpacked_bytes_received_tiflash_cross_zone" agg:"SUM(sum_unpacked_bytes_received_tiflash_cross_zone)"`

// IA remote read segment metrics
SumIaReadSegmentCount int64 `json:"sum_ia_read_segment_count" agg:"SUM(sum_ia_read_segment_count)"`
SumIaRemoteReadSegmentSize int64 `json:"sum_ia_remote_read_segment_size" agg:"SUM(sum_ia_remote_read_segment_size)"`
SumIaRemoteReadSegmentWaitTime float64 `json:"sum_ia_remote_read_segment_wait_time" agg:"SUM(sum_ia_remote_read_segment_wait_time)"`
AvgIaReadSegmentCount float64 `json:"avg_ia_read_segment_count" agg:"SUM(exec_count * avg_ia_read_segment_count) / SUM(exec_count)"`
AvgIaRemoteReadSegmentSize float64 `json:"avg_ia_remote_read_segment_size" agg:"SUM(exec_count * avg_ia_remote_read_segment_size) / SUM(exec_count)"`
AvgIaRemoteReadSegmentWaitTime float64 `json:"avg_ia_remote_read_segment_wait_time" agg:"SUM(exec_count * avg_ia_remote_read_segment_wait_time) / SUM(exec_count)"`
MaxIaReadSegmentCount int64 `json:"max_ia_read_segment_count" agg:"MAX(max_ia_read_segment_count)"`
MaxIaRemoteReadSegmentSize int64 `json:"max_ia_remote_read_segment_size" agg:"MAX(max_ia_remote_read_segment_size)"`
MaxIaRemoteReadSegmentWaitTime float64 `json:"max_ia_remote_read_segment_wait_time" agg:"MAX(max_ia_remote_read_segment_wait_time)"`
}

// tableNames example: "d1.a1,d2.a2,d1.a1,d3.a3"
Expand Down
4 changes: 4 additions & 0 deletions ui-v2/packages/api/server/src/azores/index.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ export const diagnosisServiceGetSlowQueryListResponse = zod.object({
"plan_from_binding": zod.number().optional(),
"user": zod.string().optional(),
"host": zod.string().optional(),
"ia_remote_read_segment_size": zod.number().optional(),
"ia_remote_read_segment_wait_time": zod.number().optional(),
"process_time": zod.number().optional(),
"wait_time": zod.number().optional(),
"backoff_time": zod.number().optional(),
Expand Down Expand Up @@ -917,6 +919,8 @@ export const diagnosisServiceGetSlowQueryDetailResponse = zod.object({
"plan_from_binding": zod.number().optional(),
"user": zod.string().optional(),
"host": zod.string().optional(),
"ia_remote_read_segment_size": zod.number().optional(),
"ia_remote_read_segment_wait_time": zod.number().optional(),
"process_time": zod.number().optional(),
"wait_time": zod.number().optional(),
"backoff_time": zod.number().optional(),
Expand Down
10 changes: 10 additions & 0 deletions ui-v2/packages/libs/4-apps/src/slow-query/locales/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ function useLocales() {
"fields.time_queued_by_rc.desc",
"The total wait time spent in the resource queue (note: {{distro.tikv}} executes requests in parallel so that this is not a wall time)",
)
tk("fields.ia_remote_read_segment_size", "IA Remote Read Segment Size")
tk(
"fields.ia_remote_read_segment_size.desc",
"Total number of bytes read from IA remote segments",
)
tk("fields.ia_remote_read_segment_wait_time", "IA Remote Read Segment Wait Time")
tk(
"fields.ia_remote_read_segment_wait_time.desc",
"The wait time spent reading IA remote segments",
)

// additional fields
tk("fields.backoff_detail", "Backoff Detail")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export interface SlowqueryModel {
exec_retry_time?: number
get_commit_ts_time?: number
host?: string
ia_remote_read_segment_size?: number
ia_remote_read_segment_wait_time?: number
index_names?: string
instance?: string
is_internal?: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ function getData(
value: formatNumByUnit(data.rocksdb_key_skipped_count || 0, "short"),
desc: tk("fields.rocksdb_key_skipped_count.desc"),
},
{
name: tk("fields.ia_remote_read_segment_size"),
value: formatNumByUnit(data.ia_remote_read_segment_size || 0, "bytes"),
desc: tk("fields.ia_remote_read_segment_size.desc"),
},
{
name: tk("fields.ia_remote_read_segment_wait_time"),
value: formatNumByUnit(
data.ia_remote_read_segment_wait_time || 0,
"s",
),
desc: tk("fields.ia_remote_read_segment_wait_time.desc"),
},
]
}

Expand Down
2 changes: 2 additions & 0 deletions ui-v2/packages/libs/4-apps/src/slow-query/pages/list/cols.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export function useListTableColumns() {
tcf.number("ru", "short"), // @todo: fix
tcf.text("resource_group"),
tcf.number("time_queued_by_rc", "s"),
tcf.number("ia_remote_read_segment_size", "bytes"),
tcf.number("ia_remote_read_segment_wait_time", "s"),
])
}, [tk])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3702,7 +3702,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
},
/**
*
* @summary Get availiable instances
* @summary Get available instances
* @param {string} [dataSource]
* @param {string} [end]
* @param {string} [start]
Expand Down Expand Up @@ -5298,7 +5298,7 @@ export const DefaultApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary Get availiable instances
* @summary Get available instances
* @param {string} [dataSource]
* @param {string} [end]
* @param {string} [start]
Expand Down Expand Up @@ -6394,7 +6394,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
},
/**
*
* @summary Get availiable instances
* @summary Get available instances
* @param {string} [dataSource]
* @param {string} [end]
* @param {string} [start]
Expand Down Expand Up @@ -8908,7 +8908,7 @@ export class DefaultApi extends BaseAPI {

/**
*
* @summary Get availiable instances
* @summary Get available instances
* @param {DefaultApiTopsqlInstancesGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ export interface SlowqueryModel {
* @memberof SlowqueryModel
*/
'host'?: string;
/**
* IA remote read
* @type {number}
* @memberof SlowqueryModel
*/
'ia_remote_read_segment_size'?: number;
/**
*
* @type {number}
* @memberof SlowqueryModel
*/
'ia_remote_read_segment_wait_time'?: number;
/**
*
* @type {string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ export interface StatementModel {
* @memberof StatementModel
*/
'avg_get_commit_ts_time'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'avg_ia_read_segment_count'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'avg_ia_remote_read_segment_size'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'avg_ia_remote_read_segment_wait_time'?: number;
/**
*
* @type {number}
Expand Down Expand Up @@ -308,6 +326,24 @@ export interface StatementModel {
* @memberof StatementModel
*/
'max_get_commit_ts_time'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'max_ia_read_segment_count'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'max_ia_remote_read_segment_size'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'max_ia_remote_read_segment_wait_time'?: number;
/**
*
* @type {number}
Expand Down Expand Up @@ -542,6 +578,24 @@ export interface StatementModel {
* @memberof StatementModel
*/
'sum_errors'?: number;
/**
* IA remote read segment metrics
* @type {number}
* @memberof StatementModel
*/
'sum_ia_read_segment_count'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'sum_ia_remote_read_segment_size'?: number;
/**
*
* @type {number}
* @memberof StatementModel
*/
'sum_ia_remote_read_segment_wait_time'?: number;
/**
*
* @type {number}
Expand Down
37 changes: 36 additions & 1 deletion ui/packages/tidb-dashboard-client/swagger/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3459,7 +3459,7 @@
"JwtAuth": []
}
],
"summary": "Get availiable instances",
"summary": "Get available instances",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -5269,6 +5269,13 @@
"host": {
"type": "string"
},
"ia_remote_read_segment_size": {
"description": "IA remote read",
"type": "integer"
},
"ia_remote_read_segment_wait_time": {
"type": "number"
},
"index_names": {
"type": "string"
},
Expand Down Expand Up @@ -5598,6 +5605,15 @@
"avg_get_commit_ts_time": {
"type": "integer"
},
"avg_ia_read_segment_count": {
"type": "number"
},
"avg_ia_remote_read_segment_size": {
"type": "number"
},
"avg_ia_remote_read_segment_wait_time": {
"type": "number"
},
"avg_latency": {
"type": "integer"
},
Expand Down Expand Up @@ -5720,6 +5736,15 @@
"max_get_commit_ts_time": {
"type": "integer"
},
"max_ia_read_segment_count": {
"type": "integer"
},
"max_ia_remote_read_segment_size": {
"type": "integer"
},
"max_ia_remote_read_segment_wait_time": {
"type": "number"
},
"max_latency": {
"type": "integer"
},
Expand Down Expand Up @@ -5843,6 +5868,16 @@
"sum_errors": {
"type": "integer"
},
"sum_ia_read_segment_count": {
"description": "IA remote read segment metrics",
"type": "integer"
},
"sum_ia_remote_read_segment_size": {
"type": "integer"
},
"sum_ia_remote_read_segment_wait_time": {
"type": "number"
},
"sum_latency": {
"type": "integer"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,11 @@ export const tabCoprItems = (data: SlowqueryModel) => [
value={data.unpacked_bytes_received_tiflash_cross_zone}
/>
)
},
{
key: 'ia_remote_read_segment_size',
value: (
<ValueWithTooltip.ScaledBytes value={data.ia_remote_read_segment_size} />
)
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ export const tabTimeItems = (data: SlowqueryModel, t: TFunction) => {
key: 'time_queued_by_rc',
value: data.time_queued_by_rc! * 10e8,
indentLevel: 1
},
{
key: 'ia_remote_read_segment_wait_time',
value: data.ia_remote_read_segment_wait_time! * 10e8,
indentLevel: 1
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ slow_query:
unpacked_bytes_sent_tiflash_cross_zone_tooltip: The number of bytes sent to TiFlash across zones
unpacked_bytes_received_tiflash_cross_zone: Cross-Zone Bytes Received from TiFlash
unpacked_bytes_received_tiflash_cross_zone_tooltip: The number of bytes received from TiFlash across zones
ia_remote_read_segment_size: IA Remote Read Segment Size
ia_remote_read_segment_size_tooltip: Total number of bytes read from IA remote segments
ia_remote_read_segment_wait_time: IA Remote Read Segment Wait Time
ia_remote_read_segment_wait_time_tooltip: The wait time spent reading IA remote segments

common:
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ slow_query:
unpacked_bytes_received_tiflash_cross_zone: 跨可用区从 TiFlash 接收的字节数
unpacked_bytes_received_tiflash_cross_zone_tooltip: 跨可用区从 TiFlash 接收的字节数

# IA remote read
ia_remote_read_segment_size: IA 远程读取数据量
ia_remote_read_segment_size_tooltip: 从 IA 远程存储段读取的数据总量
ia_remote_read_segment_wait_time: IA 远程读分段等待时间
ia_remote_read_segment_wait_time_tooltip: IA 远程读分段等待时间

common:
status:
success: 成功
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export function slowQueryColumns(
tcf.bar.single('unpacked_bytes_sent_tiflash_total', 'bytes', rows),
tcf.bar.single('unpacked_bytes_received_tiflash_total', 'bytes', rows),
tcf.bar.single('unpacked_bytes_sent_tiflash_cross_zone', 'bytes', rows),
tcf.bar.single('unpacked_bytes_received_tiflash_cross_zone', 'bytes', rows)
tcf.bar.single('unpacked_bytes_received_tiflash_cross_zone', 'bytes', rows),
tcf.bar.single('ia_remote_read_segment_size', 'bytes', rows),
tcf.bar.single('ia_remote_read_segment_wait_time', 's', rows)
])
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { getValueFormat } from '@baurine/grafana-value-formats'

import { StatementModel } from '@lib/client'
import { ValueWithTooltip } from '@lib/components'
Expand Down Expand Up @@ -136,5 +137,21 @@ export const tabCoprItems = (data: StatementModel) => [
value={data.sum_unpacked_bytes_received_tiflash_cross_zone}
/>
)
},
{
key: 'avg_ia_remote_read_segment_size',
value: (
<ValueWithTooltip.ScaledBytes
value={data.avg_ia_remote_read_segment_size}
/>
)
},
{
key: 'max_ia_remote_read_segment_size',
value: (
<ValueWithTooltip.ScaledBytes
value={data.max_ia_remote_read_segment_size}
/>
)
}
]
Loading
Loading