-
Notifications
You must be signed in to change notification settings - Fork 37
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: correct shelf metrics in 7mode #2245
Conversation
Hardikl
commented
Jul 31, 2023
my.shelfData = matrix.New(my.Parent+".Shelf", "shelf", "shelf") | ||
my.shelfInstanceKeys = make([]string, 0) | ||
my.shelfInstanceLabels = []shelfInstanceLabel{} | ||
shelfExportOptions := node.NewS("export_options") | ||
shelfInstanceKeys := shelfExportOptions.NewChildS("instance_keys", "") | ||
shelfInstanceLabels := shelfExportOptions.NewChildS("instance_labels", "") | ||
|
||
if counters := my.ParentParams.GetChildS("counters"); counters != nil { | ||
if channelInfo := counters.GetChildS("shelf-environ-channel-info"); channelInfo != nil { | ||
if shelfList := channelInfo.GetChildS("shelf-environ-shelf-list"); shelfList != nil { | ||
if shelfInfo := shelfList.GetChildS("shelf-environ-shelf-info"); shelfInfo != nil { | ||
my.parseShelfTemplate(shelfInfo, shelfInstanceKeys, shelfInstanceLabels, false, "") | ||
} | ||
} | ||
} | ||
} | ||
|
||
shelfInstanceKeys.NewChildS("", "channel") | ||
shelfInstanceKeys.NewChildS("", "shelf") | ||
my.shelfData.SetExportOptions(shelfExportOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to move all of this code in a seperate method? This may avoid lots of argument pass in parseShelfTemplate
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved couple of code line to other function. And reduce extra args, But we still need this parseTemplate
as we do call it in recursion.