Skip to content

Conversation

@morningman
Copy link
Contributor

  1. Add new system table: file_cache_statistics

    This table is used for viewing metrics related to file cache on BE side

    mysql> select * from information_schema.file_cache_statistics limit 10;
    +-------+---------------+----------------------------+--------------------------------+--------------------+
    | BE_ID | BE_IP         | CACHE_PATH                 | METRIC_NAME                    | METRIC_VALUE       |
    +-------+---------------+----------------------------+--------------------------------+--------------------+
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | disposable_queue_curr_elements |                  0 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | disposable_queue_curr_size     |                  0 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | disposable_queue_max_elements  |             102400 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | disposable_queue_max_size      |        21474836480 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio                     | 0.8539634687001242 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio_1h                  |                  0 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio_5m                  |                  0 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | index_queue_curr_elements      |                  0 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | index_queue_curr_size          |                  0 |
    | 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | index_queue_max_elements       |             102400 |
    +-------+---------------+----------------------------+--------------------------------+--------------------+
    

    It will show metrics of file caches on each BE.

  2. Add new metrics hits_ratio_1h and hits_ratio_5m for file cache

    This 2 metrics will show the hit ratio of file cache in recent 1 hour or 5 minutes.
    So that we can know recent hit ratio instead of global historical hit ratio.

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

{"METRIC_NAME", TYPE_VARCHAR, sizeof(StringRef), false},
{"METRIC_VALUE", TYPE_DOUBLE, sizeof(double), false}};

SchemaFileCacheStatisticsScanner::SchemaFileCacheStatisticsScanner()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]

be/src/exec/schema_scanner/schema_file_cache_statistics.cpp:37:

-         : SchemaScanner(_s_tbls_columns, TSchemaTableType::SCH_FILE_CACHE_STATISTICS) {}
+         : SchemaScanner(_s_tbls_columns, TSchemaTableType::SCH_FILE_CACHE_STATISTICS) = default;

SchemaFileCacheStatisticsScanner::SchemaFileCacheStatisticsScanner()
: SchemaScanner(_s_tbls_columns, TSchemaTableType::SCH_FILE_CACHE_STATISTICS) {}

SchemaFileCacheStatisticsScanner::~SchemaFileCacheStatisticsScanner() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use '= default' to define a trivial destructor [modernize-use-equals-default]

Suggested change
SchemaFileCacheStatisticsScanner::~SchemaFileCacheStatisticsScanner() {}
SchemaFileCacheStatisticsScanner::~SchemaFileCacheStatisticsScanner() = default;

@morningman morningman force-pushed the cache_sys_table_master branch from 1d9a5e6 to e0ecf97 Compare October 10, 2024 04:36
@morningman morningman force-pushed the cache_sys_table_master branch from 4dae78d to d16943c Compare October 11, 2024 09:26
@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.38% (9657/25832)
Line Coverage: 28.66% (80153/279629)
Region Coverage: 28.09% (41434/147495)
Branch Coverage: 24.70% (21108/85450)
Coverage Report: http://coverage.selectdb-in.cc/coverage/d16943c541446f13b5a06f4b4c100b832e525b69_d16943c541446f13b5a06f4b4c100b832e525b69/report/index.html

Copy link
Contributor

@suxiaogang223 suxiaogang223 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Oct 14, 2024
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@morningman morningman merged commit b50f761 into apache:master Oct 14, 2024
qzsee pushed a commit to qzsee/incubator-doris that referenced this pull request Oct 16, 2024
…40078)

1. Add new system table: `file_cache_statistics`

	This table is used for viewing metrics related to file cache on BE side

	```
	mysql> select * from information_schema.file_cache_statistics limit 10;

+-------+---------------+----------------------------+--------------------------------+--------------------+
| BE_ID | BE_IP | CACHE_PATH | METRIC_NAME | METRIC_VALUE |

+-------+---------------+----------------------------+--------------------------------+--------------------+
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_curr_elements | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_curr_size | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_max_elements | 102400 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_max_size | 21474836480 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio |
0.8539634687001242 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio_1h | 0
|
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio_5m | 0
|
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
index_queue_curr_elements | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
index_queue_curr_size | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
index_queue_max_elements | 102400 |

+-------+---------------+----------------------------+--------------------------------+--------------------+
	```

	It will show metrics of file caches on each BE.

2. Add new metrics `hits_ratio_1h` and `hits_ratio_5m` for file cache

This 2 metrics will show the hit ratio of file cache in recent 1 hour or
5 minutes.
So that we can know recent hit ratio instead of global historical hit
ratio.
morningman added a commit to morningman/doris that referenced this pull request Oct 21, 2024
…40078)

1. Add new system table: `file_cache_statistics`

	This table is used for viewing metrics related to file cache on BE side

	```
	mysql> select * from information_schema.file_cache_statistics limit 10;

+-------+---------------+----------------------------+--------------------------------+--------------------+
| BE_ID | BE_IP | CACHE_PATH | METRIC_NAME | METRIC_VALUE |

+-------+---------------+----------------------------+--------------------------------+--------------------+
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_curr_elements | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_curr_size | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_max_elements | 102400 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
disposable_queue_max_size | 21474836480 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio |
0.8539634687001242 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio_1h | 0
|
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ | hits_ratio_5m | 0
|
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
index_queue_curr_elements | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
index_queue_curr_size | 0 |
| 10003 | 172.20.32.136 | /mnt/output/be/file_cache/ |
index_queue_max_elements | 102400 |

+-------+---------------+----------------------------+--------------------------------+--------------------+
	```

	It will show metrics of file caches on each BE.

2. Add new metrics `hits_ratio_1h` and `hits_ratio_5m` for file cache

This 2 metrics will show the hit ratio of file cache in recent 1 hour or
5 minutes.
So that we can know recent hit ratio instead of global historical hit
ratio.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.1.6-merged dev/3.0.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants