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: correct shelf metrics in 7mode #2245

Merged
merged 5 commits into from
Aug 4, 2023
Merged

fix: correct shelf metrics in 7mode #2245

merged 5 commits into from
Aug 4, 2023

Conversation

Hardikl
Copy link
Contributor

@Hardikl Hardikl commented Jul 31, 2023

image image

cmd/collectors/zapi/plugins/shelf/shelf.go Outdated Show resolved Hide resolved
cmd/collectors/zapi/plugins/shelf/shelf.go Outdated Show resolved Hide resolved
cmd/collectors/zapi/plugins/shelf/shelf.go Outdated Show resolved Hide resolved
cmd/collectors/zapi/plugins/shelf/shelf.go Outdated Show resolved Hide resolved
cmd/collectors/zapi/plugins/shelf/shelf.go Outdated Show resolved Hide resolved
Comment on lines 63 to 82
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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@cgrinds cgrinds merged commit 3300e30 into main Aug 4, 2023
9 checks passed
@cgrinds cgrinds deleted the hl_7mode_shelf branch August 4, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants