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(server): adding matrices for memory defrag #535

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

boazsade
Copy link
Contributor

@boazsade boazsade commented Dec 6, 2022

Signed-off-by: Boaz Sade boaz@dragonflydb.io

Add metrics for the memory defragmentation.
This see this run the command "info stats"
Two new entries:
defrag_attempt_total - the total number of times that the stasks (for all shards) checked memory for possible defragmentation
defrag_realloc_total - the total number of pointers (from all shards) that were moved dues defragmentation

@boazsade boazsade requested a review from romange December 6, 2022 07:13
@@ -1304,6 +1305,8 @@ void ServerFamily::Info(CmdArgList args, ConnectionContext* cntx) {
append("total_writes_processed", m.conn_stats.io_write_cnt);
append("async_writes_count", m.conn_stats.async_writes_cnt);
append("parser_err_count", m.conn_stats.parser_err_cnt);
append("defragmentations_tries_total", m.defrag_stats.tries);
append("defragmented_addresses_total", m.defrag_stats.success_count);
Copy link
Collaborator

Choose a reason for hiding this comment

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

some renaming:

defragmentations_tries_total -> defrag_attempt_total
defragmented_addresses_total -> defrag_realloc_total

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@@ -35,6 +35,7 @@ struct Metrics {
SliceEvents events;
TieredStats tiered_stats;
EngineShard::Stats shard_stats;
EngineShard::DefragStats defrag_stats;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not see why it should be separate from EngineShard::Stats, I would move it there since these are part of the shard stats

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove this type completely (it would require small change in unit test as well).

Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
@romange romange merged commit 3efc564 into dragonflydb:main Dec 6, 2022
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

2 participants