Skip to content

Commit

Permalink
[#8939] Delete Counter class for jdk7
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Jun 17, 2022
1 parent 9456b43 commit 5003b67
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 220 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
package com.navercorp.pinpoint.profiler.monitor.metric.response;

import com.google.inject.Inject;
import com.navercorp.pinpoint.profiler.util.Counter;
import com.navercorp.pinpoint.profiler.util.CounterFactory;

import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.LongAdder;

/**
* @author Taejin Koo
Expand All @@ -46,8 +45,7 @@ public ResponseTimeValue resetAndGetValue() {
final long totalValue = reset.getTotalValue();
final long maxValue = reset.getMaxValue();
final long transactionCount = reset.getTransactionCount();
ResponseTimeValue result = new ResponseTimeValue0(totalValue, maxValue, transactionCount);
return result;
return new ResponseTimeValue0(totalValue, maxValue, transactionCount);
}

private ResponseTimeCollector reset() {
Expand All @@ -58,13 +56,13 @@ private ResponseTimeCollector reset() {
}

private static class ResponseTimeCollector {
private final Counter totalValue;
private final Counter transactionCount;
private final LongAdder totalValue;
private final LongAdder transactionCount;
private final AtomicLong maxValue = new AtomicLong(0);

private ResponseTimeCollector() {
this.totalValue = CounterFactory.newCounter();
this.transactionCount = CounterFactory.newCounter();
this.totalValue = new LongAdder();
this.transactionCount = new LongAdder();
}

void add(long value) {
Expand Down Expand Up @@ -136,14 +134,12 @@ public long getTransactionCount() {

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ResponseTimeValue0{");
sb.append("totalResponseTime=").append(totalResponseTime);
sb.append(", transactionCount=").append(transactionCount);
sb.append(", maxResponseTime=").append(maxResponseTime);
sb.append('}');
return sb.toString();
return "ResponseTimeValue0{" +
"totalResponseTime=" + totalResponseTime +
", maxResponseTime=" + maxResponseTime +
", transactionCount=" + transactionCount +
'}';
}

}

}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 5003b67

Please sign in to comment.