Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add metrics for memtable #1036

Merged
merged 6 commits into from
Jun 27, 2023
Merged

feat: add metrics for memtable #1036

merged 6 commits into from
Jun 27, 2023

Conversation

jiacai2050
Copy link
Contributor

@jiacai2050 jiacai2050 commented Jun 27, 2023

Rationale

Current we meet many situations with small SST, in order to debug where the issue is, we need to know memtable's inner state.

Detailed Changes

Add metrics() for MemTable trait, which contains three metrics now: raw_size, encoded_size, row_cnt.

Test Plan

Manually, when memtable flush to level0, logs will contains metrics like

2023-06-27 16:21:21.994 INFO [analytic_engine/src/instance/flush_compaction.rs:392] Instance flush memtables to output, table:system, table_id:2199023255553, request_id:4074, mems_to_flush:FlushableMemTables { sampling_mem: None,
memtables: [MemTableState { time_range: TimeRange { inclusive_start: Timestamp(1687852800000), exclusive_end: Timestamp(1687860000000) }, id: 161, mem: 27262976, metrics: Metrics { row_raw_size: 11160000, row_encoded_size: 21840000, row_count: 120000 }, last_sequence: 3872 }] }, files_to_level0:[AddFile { level: Level(0), file: FileMeta { id: 178, size: 6806645, row_num: 120000, time_range: TimeRange { inclusive_start: Timestamp(1687852800000), exclusive_end: Timestamp(1687860000000) }, max_seq: 3872, storage_format: Columnar } }], flushed_sequence:3872

@Rachelint Rachelint closed this Jun 27, 2023
@Rachelint Rachelint deleted the debug-memtable branch June 27, 2023 07:28
@Rachelint Rachelint restored the debug-memtable branch June 27, 2023 07:30
@jiacai2050 jiacai2050 reopened this Jun 27, 2023
Copy link
Member

@ShiKaiWi ShiKaiWi left a comment

Choose a reason for hiding this comment

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

lgtm

@jiacai2050 jiacai2050 merged commit 946b3f8 into main Jun 27, 2023
6 checks passed
@jiacai2050 jiacai2050 deleted the debug-memtable branch June 27, 2023 13:10
dust1 pushed a commit to dust1/ceresdb that referenced this pull request Aug 9, 2023
## Rationale
Current we meet many situations with small SST, in order to debug where
the issue is, we need to know memtable's inner state.

## Detailed Changes
Add metrics() for MemTable trait, which contains three metrics now:
raw_size, encoded_size, row_cnt.

## Test Plan
Manually, when memtable flush to level0, logs will contains metrics like
```bash
2023-06-27 16:21:21.994 INFO [analytic_engine/src/instance/flush_compaction.rs:392] Instance flush memtables to output, table:system, table_id:2199023255553, request_id:4074, mems_to_flush:FlushableMemTables { sampling_mem: None,
memtables: [MemTableState { time_range: TimeRange { inclusive_start: Timestamp(1687852800000), exclusive_end: Timestamp(1687860000000) }, id: 161, mem: 27262976, metrics: Metrics { row_raw_size: 11160000, row_encoded_size: 21840000, row_count: 120000 }, last_sequence: 3872 }] }, files_to_level0:[AddFile { level: Level(0), file: FileMeta { id: 178, size: 6806645, row_num: 120000, time_range: TimeRange { inclusive_start: Timestamp(1687852800000), exclusive_end: Timestamp(1687860000000) }, max_seq: 3872, storage_format: Columnar } }], flushed_sequence:3872
```

---------

Co-authored-by: kamille <caoruiqiu.crq@antgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants