Skip to content

Commit

Permalink
Storages: Refine metrics of read threads and data sharing (#8653) (#8661
Browse files Browse the repository at this point in the history
)

ref #8652
  • Loading branch information
ti-chi-bot authored Jan 7, 2024
1 parent 704fae6 commit 8e4722f
Show file tree
Hide file tree
Showing 3 changed files with 248 additions and 6 deletions.
3 changes: 2 additions & 1 deletion dbms/src/Common/TiFlashMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ namespace DB
F(type_sche_no_segment, {"type", "sche_no_segment"}), \
F(type_sche_from_cache, {"type", "sche_from_cache"}), \
F(type_sche_new_task, {"type", "sche_new_task"}), \
F(type_push_block_bytes, {"type", "push_block_bytes"}), \
F(type_add_cache_succ, {"type", "add_cache_succ"}), \
F(type_add_cache_stale, {"type", "add_cache_stale"}), \
F(type_add_cache_reach_count_limit, {"type", "type_add_cache_reach_count_limit"}), \
F(type_add_cache_reach_count_limit, {"type", "add_cache_reach_count_limit"}), \
F(type_add_cache_total_bytes_limit, {"type", "add_cache_total_bytes_limit"}), \
F(type_get_cache_miss, {"type", "get_cache_miss"}), \
F(type_get_cache_part, {"type", "get_cache_part"}), \
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Storages/DeltaMerge/SegmentReadTaskPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ void SegmentReadTaskPool::pushBlock(Block && block)
{
blk_stat.push(block);
global_blk_stat.push(block);
GET_METRIC(tiflash_storage_read_thread_counter, type_push_block_bytes).Increment(block.bytes());
q.push(std::move(block), nullptr);
}

Expand Down
250 changes: 245 additions & 5 deletions metrics/grafana/tiflash_summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -2608,6 +2608,136 @@
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_TEST-CLUSTER}",
"decimals": null,
"description": "",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 44
},
"hiddenSeries": false,
"id": 268,
"legend": {
"alignAsTable": true,
"avg": false,
"current": true,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": 250,
"sort": "max",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.5.11",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "Limit",
"color": "#F2495C",
"hideTooltip": true,
"legend": false,
"linewidth": 2,
"nullPointMode": "connected"
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"exemplar": true,
"expr": "sum by (instance) (rate(tiflash_proxy_thread_cpu_seconds_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", name=~\"SegmentReader.*\"}[1m]))",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}} {{instance}}",
"refId": "A",
"step": 40
},
{
"exemplar": true,
"expr": "count by (instance) (tiflash_proxy_thread_cpu_seconds_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", name=~\"SegmentReader.*\"})",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "Limit",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Segment Reader",
"tooltip": {
"msResolution": false,
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 1,
"format": "percentunit",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"title": "Threads CPU",
Expand Down Expand Up @@ -7573,7 +7703,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_TEST-CLUSTER}",
"description": "The information of read thread scheduling and data sharing cache hit ratio. Data sharing cache is purpose-built for OLAP workload that can reduce repeated data reads of concurrent table scanning.",
"description": "The information of data sharing cache hit ratio. Data sharing cache is purpose-built for OLAP workload that can reduce repeated data reads of concurrent table scanning.",
"fieldConfig": {
"defaults": {},
"overrides": []
Expand All @@ -7589,12 +7719,12 @@
"hiddenSeries": false,
"id": 132,
"legend": {
"alignAsTable": false,
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
Expand Down Expand Up @@ -7623,7 +7753,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum(rate(tiflash_storage_read_thread_counter{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", type!~\"get_cache_miss|get_cache_hit|get_cache_part|get_cache_copy|sche_no_segment\"}[1m])) by (type)",
"expr": "sum(rate(tiflash_storage_read_thread_counter{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", type=~\"add_cache_stale|add_cache_succ|add_cache_total_bytes_limit|add_cache_reach_count_limit\"}[1m])) by (type)",
"format": "time_series",
"hide": false,
"interval": "",
Expand Down Expand Up @@ -7661,7 +7791,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Read Thread and Data Sharing",
"title": "Data Sharing",
"tooltip": {
"shared": true,
"sort": 0,
Expand Down Expand Up @@ -7699,6 +7829,116 @@
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_TEST-CLUSTER}",
"description": "The information of read thread scheduling.",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 78
},
"hiddenSeries": false,
"id": 269,
"legend": {
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.5.11",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"$$hashKey": "object:308",
"alias": "/push_block/",
"yaxis": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"exemplar": true,
"expr": "sum(rate(tiflash_storage_read_thread_counter{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", type=~\"sche_active_segment_limit|sche_from_cache|sche_new_task|sche_no_pool|sche_no_ru|sche_no_slot|push_block_bytes\"}[1m])) by (type)",
"format": "time_series",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{type}}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Read Thread Scheduling",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:321",
"decimals": null,
"format": "ops",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"$$hashKey": "object:322",
"format": "binBps",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
Expand Down

0 comments on commit 8e4722f

Please sign in to comment.