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

Fix Info Output Format #1019

Merged
merged 4 commits into from
Feb 18, 2025
Merged

Conversation

vazois
Copy link
Contributor

@vazois vazois commented Feb 14, 2025

This PR ensures that the info output format follows the following pattern
<fieldname>: <subfield1>=<value1>, <subfield2>=<value2>, ....

@vazois vazois linked an issue Feb 14, 2025 that may be closed by this pull request
@TalZaccai TalZaccai requested a review from badrishc February 14, 2025 19:41
@prvyk
Copy link
Contributor

prvyk commented Feb 15, 2025

Can you also makes another change? In the section header names, just change the output so names not have spaces. Just happened to run into a tool which barfed on that.

/~https://github.com/predis/predis/blob/ac933cc5481eb4c7cc2132c1013ad3bbb780847a/src/Command/Redis/INFO.php#L59

e.g.

> diff --git a/libs/server/Metrics/Info/GarnetInfoMetrics.cs b/libs/server/Metrics/Info/GarnetInfoMetrics.cs
> index 94c05fdc..e264d62e 100644
> --- a/libs/server/Metrics/Info/GarnetInfoMetrics.cs
> +++ b/libs/server/Metrics/Info/GarnetInfoMetrics.cs
> @@ -305,17 +305,17 @@ namespace Garnet.server
>                  InfoMetricsType.CLUSTER => "Cluster",
>                  InfoMetricsType.REPLICATION => "Replication",
>                  InfoMetricsType.STATS => "Stats",
> -                InfoMetricsType.STORE => "Main Store",
> -                InfoMetricsType.OBJECTSTORE => "Object Store",
> -                InfoMetricsType.STOREHASHTABLE => "Main Store Hash Table Distribution",
> -                InfoMetricsType.OBJECTSTOREHASHTABLE => "Object Store Hash Table Distribution",
> -                InfoMetricsType.STOREREVIV => "Main Store Deleted Record Revivification",
> -                InfoMetricsType.OBJECTSTOREREVIV => "Object Store Deleted Record Revivification",
> +                InfoMetricsType.STORE => "Main_Store",
> +                InfoMetricsType.OBJECTSTORE => "Object_Store",
> +                InfoMetricsType.STOREHASHTABLE => "Main_Store_Hash_Table_Distribution",
> +                InfoMetricsType.OBJECTSTOREHASHTABLE => "Object_Store_Hash_Table_Distribution",
> +                InfoMetricsType.STOREREVIV => "Main_Store_Deleted_Record_Revivification",
> +                InfoMetricsType.OBJECTSTOREREVIV => "Object_Store_Deleted_Record_Revivification",
>                  InfoMetricsType.PERSISTENCE => "Persistence",
>                  InfoMetricsType.CLIENTS => "Clients",
>                  InfoMetricsType.KEYSPACE => "Keyspace",
>                  InfoMetricsType.MODULES => "Modules",
> -                InfoMetricsType.BPSTATS => "BufferPool Stats",
> +                InfoMetricsType.BPSTATS => "BufferPool_Stats",
>                  _ => "Default",
>              };
>          }
> 

(Camel case etc. would work too)

@vazois vazois merged commit d7c65b7 into microsoft:main Feb 18, 2025
18 checks passed
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.

Garnet output INFO is not stable
4 participants