Skip to content

Conversation

kendriyavid
Copy link
Contributor

@kendriyavid kendriyavid commented Feb 21, 2025

- Implemented FunctionStats in rueidiscompat to enhance functionality.
-Ensured compatibility with existing code and followed project conventions.
}

func (cmd *FunctionStatsCmd) from(res rueidis.RedisResult) {
fstats := new(FunctionStats)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
fstats := new(FunctionStats)
var fstats FunctionStats

case "command":
val.Command, err = attr.AsStrSlice()
case "duration_ms":
ms, err := attr.ToInt64()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ms, err := attr.ToInt64()
ms, err := attr.AsInt64()

for k, v := range emap {
switch k {
case "libraries_count":
engine.LibrariesCount, err = v.ToInt64()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
engine.LibrariesCount, err = v.ToInt64()
engine.LibrariesCount, err = v.AsInt64()

case "libraries_count":
engine.LibrariesCount, err = v.ToInt64()
case "functions_count":
engine.FunctionsCount, err = v.ToInt64()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
engine.FunctionsCount, err = v.ToInt64()
engine.FunctionsCount, err = v.AsInt64()

case "name":
val.Name, err = v.ToString()
case "duration_ms":
ms, err := v.ToInt64()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ms, err := v.ToInt64()
ms, err := v.AsInt64()

Copy link
Collaborator

@rueian rueian left a comment

Choose a reason for hiding this comment

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

Nice work! Thank you @kendriyavid.

@rueian rueian merged commit 18c4610 into redis:main Feb 21, 2025
27 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.

Add FunctionStats to rueidiscompat
2 participants