mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved WebURIStat & Proxy.
This commit is contained in:
@@ -108,7 +108,10 @@ public class PreparedStatementProxyImpl extends StatementProxyImpl implements Pr
|
||||
parametersSize = jdbcIndex;
|
||||
}
|
||||
if (parametersSize >= parameters.length) {
|
||||
parameters = Arrays.copyOf(parameters, parametersSize + 16);
|
||||
int oldCapacity = parameters.length;
|
||||
int newCapacity = oldCapacity + (oldCapacity >> 1);
|
||||
|
||||
parameters = Arrays.copyOf(parameters, newCapacity);
|
||||
}
|
||||
parameters[index] = parameter;
|
||||
|
||||
|
||||
@@ -178,9 +178,9 @@ public class WebURIStat {
|
||||
requestTimeNanoUpdater.addAndGet(this, nanos);
|
||||
|
||||
for (;;) {
|
||||
long current = requestTimeNanoUpdater.get(this);
|
||||
long current = requestTimeNanoMaxUpdater.get(this);
|
||||
if (current < nanos) {
|
||||
if (requestTimeNanoUpdater.compareAndSet(this, current, nanos)) {
|
||||
if (requestTimeNanoMaxUpdater.compareAndSet(this, current, nanos)) {
|
||||
// 可能不准确,但是绝大多数情况下都会正确,性能换取一致性
|
||||
requestTimeNanoMaxOccurTime = System.currentTimeMillis();
|
||||
|
||||
|
||||
@@ -247,7 +247,9 @@ druid.lang = function() {
|
||||
/**weburi-detail*/
|
||||
'RefreshPeriod':['Refresh Period', '刷新时间'],
|
||||
'SuspendRefresh':['Suspend Refresh', '暂停刷新'],
|
||||
'RequestTimeMillis':['RequestTimeMillis', '请求时间'],
|
||||
'RequestTimeMillis':['RequestTimeMillisTotal', '请求时间(和)'],
|
||||
'RequestTimeMillisMax':['RequestTimeMillisMax', '请求最慢(单次)'],
|
||||
'RequestTimeMillisMaxOccurTime':['RequestTimeMillisMaxOccurTime', '请求最慢发生时间'],
|
||||
'JdbcExecutePeak':['JdbcExecutePeak', 'jdbc执行峰值'],
|
||||
'JdbcFetchRowPeak':['JdbcFetchRowPeak', 'jdbc查询取回行数峰值'],
|
||||
'JdbcUpdatePeak':['JdbcUpdatePeak', 'jdbc更新峰值'],
|
||||
|
||||
Reference in New Issue
Block a user