25832583// the type of profile
25842584func getTotal(prof *profile.Profile, idx int) int64 <span class="cov2" title="2">{
25852585 var total, diffTotal int64
2586- for _, sample := range prof.Sample </span><span class="cov9" title="51 ">{
2586+ for _, sample := range prof.Sample </span><span class="cov9" title="52 ">{
25872587 var v int64
25882588 v = sample.Value[idx]
25892589 if v < 0 </span><span class="cov0" title="0">{
25902590 v = -v
25912591 }</span>
2592- <span class="cov9" title="51 ">total += v
2592+ <span class="cov9" title="52 ">total += v
25932593 if sample.DiffBaseSample() </span><span class="cov0" title="0">{
25942594 diffTotal += v
25952595 }</span>
26142614 <span class="cov1" title="1">return fmt.Sprintf("%.f%s", metric, defaultMetric)</span>
26152615 }
26162616 <span class="cov6" title="10">for k, u := range typeMap </span><span class="cov10" title="55">{
2617- if u >= formatter && (value/u) >= 1.0 </span><span class="cov7" title="22 ">{
2617+ if u >= formatter && (value/u) >= 1.0 </span><span class="cov7" title="15 ">{
26182618 formatter = u
26192619 mesure = k
26202620 }</span>
26212621 }
26222622
26232623 <span class="cov6" title="10">metric := value / formatter
2624- if math.IsNaN(metric) </span><span class="cov2 " title="2 ">{
2624+ if math.IsNaN(metric) </span><span class="cov3 " title="3 ">{
26252625 metric = 0
26262626 }</span>
26272627
@@ -20298,12 +20298,12 @@
2029820298
2029920299// function to check if an identifier is a parameter/variable and add the required keyword if so
2030020300func convertToParamVar(str string, s *BicepVisitor) string <span class="cov5" title="44">{
20301- for variable := range s.varList </span><span class="cov7" title="219 ">{
20301+ for variable := range s.varList </span><span class="cov7" title="221 ">{
2030220302 if variable == str </span><span class="cov3" title="7">{
2030320303 return "variables('" + str + CloseParenthesis
2030420304 }</span>
2030520305 }
20306- <span class="cov5" title="37">for parameter := range s.paramList </span><span class="cov9" title="576 ">{
20306+ <span class="cov5" title="37">for parameter := range s.paramList </span><span class="cov9" title="599 ">{
2030720307 if parameter == str </span><span class="cov4" title="22">{
2030820308 return "parameters('" + str + CloseParenthesis
2030920309 }</span>
2773727737 progress: progress,
2773827738 pBar: newPb,
2773927739 wg: wg,
27740- close: func() error </span><span class="cov3 " title="2 ">{
27740+ close: func() error </span><span class="cov1 " title="1 ">{
2774127741 newPb.Finish()
2774227742 return nil
2774327743 }</span>,
2774627746
2774727747// Start initializes the Counter Progress Bar
2774827748func (p ProgressBar) Start() <span class="cov3" title="2">{
27749- defer func() </span><span class="cov3 " title="2 ">{
27749+ defer func() </span><span class="cov1 " title="1 ">{
2775027750 err := p.Close()
2775127751 if err != nil </span><span class="cov0" title="0">{
2775227752 log.Error().Msgf("failed to stop progress bar %v", err)
@@ -27758,14 +27758,14 @@
2775827758 newProgress, ok := <-p.progress
2775927759 p.currentProgress += newProgress
2776027760 p.pBar.Increment()
27761- if !ok || p.currentProgress >= p.pBar.Total() </span><span class="cov3 " title="2 ">{
27761+ if !ok || p.currentProgress >= p.pBar.Total() </span><span class="cov1 " title="1 ">{
2776227762 break</span>
2776327763 }
2776427764 }
2776527765}
2776627766
2776727767// Close stops the Counter Progress Bar
27768- func (p ProgressBar) Close() error <span class="cov3 " title="2 ">{ return p.close() }</span>
27768+ func (p ProgressBar) Close() error <span class="cov1 " title="1 ">{ return p.close() }</span>
2776927769</pre>
2777027770
2777127771 <pre class="file" id="file99" style="display: none">package progress
0 commit comments