pprof icon indicating copy to clipboard operation
pprof copied to clipboard

Colorize weblist output

Open Maaarcocr opened this issue 7 years ago • 13 comments

This is my first try at solving #218 (and also first time contributing here 😄)

This is how it looks: image

I have added 5 new CSS classes whose background-colors are from a red to yellow gradient (please feel free to criticize my color choices) I am not sure if I should use flatSum or cumSum in order to calculate the percentile, so if you have any opinion on this, please let me know.

I can add some basics tests for the calculatePercentile function, if needed.

Maaarcocr avatar Nov 29 '17 17:11 Maaarcocr

As you may have noticed I have some failing tests because of the different html output for weblist. Is there a way of updating the testdata easily?

Maaarcocr avatar Nov 30 '17 10:11 Maaarcocr

Codecov Report

Merging #271 (3e3a1c0) into master (3ec35eb) will increase coverage by 0.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
+ Coverage   67.14%   67.25%   +0.10%     
==========================================
  Files          78       78              
  Lines       14084    14130      +46     
==========================================
+ Hits         9457     9503      +46     
  Misses       3792     3792              
  Partials      835      835              
Impacted Files Coverage Δ
internal/report/source_html.go 0.00% <ø> (ø)
internal/report/source.go 82.68% <100.00%> (+1.27%) :arrow_up:
.../github.com/google/pprof/internal/report/source.go 82.68% <0.00%> (+1.27%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3ec35eb...3e3a1c0. Read the comment docs.

codecov-io avatar Dec 01 '17 19:12 codecov-io

Looks like test fail at formatting check.

aalexand avatar Dec 02 '17 06:12 aalexand

@aalexand solved 😄 I was sleeping so I couldn't fix it straight away.

Maaarcocr avatar Dec 02 '17 10:12 Maaarcocr

@Maaarcocr Could you address the PR comments?

aalexand avatar Dec 15 '17 23:12 aalexand

@aalexand Sorry for the delay. I've been ill and I had a lot of coursework in the meanwhile, I will address the comments either today or tomorrow.

Maaarcocr avatar Dec 16 '17 16:12 Maaarcocr

@aalexand I've changed the code based on your suggested changes.

I was wondering if I should change the background-color in a different way, such as: In getPtileCSSClassName I could instead produce a style string and we wouldnt not use classes anymore. This way, if we want to add more percentiles we would not need to manually change the HTML.

Maaarcocr avatar Dec 18 '17 13:12 Maaarcocr

Hi! I would love to get this merged if it is still something that the project need :smile:

Maaarcocr avatar Apr 09 '18 08:04 Maaarcocr

@aalexand any progress this PR...? would be great feature I think.

zchee avatar Mar 18 '21 00:03 zchee

@zchee the branch is out of date so the author will need to rebase it first.

aalexand avatar Mar 18 '21 00:03 aalexand

@aalexand Ah, your correct.

@Maaarcocr could you rebase it?

zchee avatar Mar 18 '21 00:03 zchee

Sorry for the very delayed answer. Will try to rebase when I have some free time, hopefully this weekend!

Maaarcocr avatar Apr 14 '21 14:04 Maaarcocr

still not merged?

zdyj3170101136 avatar Nov 07 '22 11:11 zdyj3170101136