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

Add CSV output support to some aggregators #94

Merged
merged 4 commits into from
Jun 13, 2023
Merged

Add CSV output support to some aggregators #94

merged 4 commits into from
Jun 13, 2023

Conversation

zix99
Copy link
Owner

@zix99 zix99 commented Jun 10, 2023

Add CSV output support to various aggregators. Can output to file or stdout

@netlify
Copy link

netlify bot commented Jun 10, 2023

Deploy Preview for raredocs ready!

Name Link
🔨 Latest commit b343079
🔍 Latest deploy log https://app.netlify.com/sites/raredocs/deploys/64867d9554ffd00007c4fe0a
😎 Deploy Preview https://deploy-preview-94--raredocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2023

Codecov Report

Merging #94 (b343079) into master (ab79389) will decrease coverage by 0.32%.
The diff coverage is 74.16%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   89.91%   89.60%   -0.32%     
==========================================
  Files         104      107       +3     
  Lines        5305     5425     +120     
==========================================
+ Hits         4770     4861      +91     
- Misses        410      429      +19     
- Partials      125      135      +10     
Impacted Files Coverage Δ
cmd/bargraph.go 94.44% <40.00%> (-5.56%) ⬇️
cmd/heatmap.go 93.33% <40.00%> (-3.14%) ⬇️
cmd/histo.go 88.67% <40.00%> (-2.41%) ⬇️
cmd/reduce.go 91.30% <40.00%> (-1.65%) ⬇️
cmd/tabulate.go 96.89% <40.00%> (-2.30%) ⬇️
pkg/csv/aggWriters.go 76.47% <76.47%> (ø)
pkg/csv/csvfile.go 85.18% <85.18%> (ø)
cmd/helpers/output.go 95.00% <100.00%> (+7.50%) ⬆️
pkg/aggregation/accumulator.go 100.00% <100.00%> (ø)
pkg/multiterm/nullterm.go 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

cols := agg.OrderedColumns(sorting.NVNameSorter)
w.Write(append([]string{""}, cols...))
for _, row := range agg.OrderedRows(sorting.NVNameSorter) {
arr := make([]string, len(cols)+1)
Copy link
Owner Author

Choose a reason for hiding this comment

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

could save memory here by make once

}

for _, group := range aggr.Groups(sorting.ByName) {
row := make([]string, 0)
Copy link
Owner Author

Choose a reason for hiding this comment

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

do we know capacity here?

w.Write(header)

for _, item := range aggr.ItemsSorted(sorting.NVNameSorter) {
row := []any{item.Name}
Copy link
Owner Author

Choose a reason for hiding this comment

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

save memory with cap hint

@zix99 zix99 merged commit aaca8d4 into master Jun 13, 2023
7 of 9 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.

None yet

2 participants