Skip to content

Commit

Permalink
Polish (#4077)
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored Sep 11, 2023
1 parent e97555a commit 201f054
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected void recordNonNegative(long amount, TimeUnit unit) {
max.record(nanoAmount, TimeUnit.NANOSECONDS);

if (histogram != null) {
histogram.recordLong(TimeUnit.NANOSECONDS.convert(amount, unit));
histogram.recordLong(nanoAmount);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public FilterReply decide(Marker marker, Logger logger, Level level, String form
// and can return immediately and
// avoid the relatively expensive ThreadLocal access below. See also logbacks
// Logger.callTurboFilters().
// Calling logger.isEnabledFor(level) might be sub-optimal since it cals this
// Calling logger.isEnabledFor(level) might be sub-optimal since it calls this
// filter again. This behavior caused a StackOverflowError in the past.
if (format == null || !level.isGreaterOrEqual(logger.getEffectiveLevel())) {
return FilterReply.NEUTRAL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ void outputSummary(PrintStream printStream, double bucketScaling) {

String bucketFormatString = "%14.1f %10d\n";

FixedBoundaryHistogram currentHistogram = currentHistogram();
for (int i = 0; i < buckets.length; i++) {
printStream.format(Locale.US, bucketFormatString, buckets[i] / bucketScaling,
currentHistogram().values.get(i));
currentHistogram.values.get(i));
}

printStream.write('\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class StepDistributionSummary extends AbstractDistributionSummary impleme
* Create a new {@code StepDistributionSummary}.
* @param id ID
* @param clock clock
* @param distributionStatisticConfig distribution static configuration
* @param distributionStatisticConfig distribution statistic configuration
* @param scale scale
* @param stepMillis step in milliseconds
* @param supportsAggregablePercentiles whether it supports aggregable percentiles
Expand All @@ -60,7 +60,7 @@ public StepDistributionSummary(Id id, Clock clock, DistributionStatisticConfig d

@Override
protected void recordNonNegative(double amount) {
count.add(1);
count.add(1L);
total.add(amount);
max.record(amount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public StepTimer(final Id id, final Clock clock, final DistributionStatisticConf
@Override
protected void recordNonNegative(final long amount, final TimeUnit unit) {
final long nanoAmount = (long) TimeUtils.convert(amount, unit, TimeUnit.NANOSECONDS);
count.add(1);
count.add(1L);
total.add(nanoAmount);
max.record(nanoAmount);
}
Expand Down

0 comments on commit 201f054

Please sign in to comment.