mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 05:36:00 +00:00
max duration profiler measure
This commit is contained in:
@@ -40,10 +40,7 @@ const driver = {
|
||||
profilerChartMeasures: [
|
||||
{ label: 'Req count/s', field: 'countPerSec' },
|
||||
{ label: 'Avg duration', field: 'avgDuration' },
|
||||
|
||||
// { label: 'Req count/s', field: 'countPerSec', perSecond: true },
|
||||
// { field: 'countAll', hidden: true },
|
||||
// { label: 'Avg duration', field: 'millis', perField: 'countAll' },
|
||||
{ label: 'Max duration', field: 'maxDuration' },
|
||||
],
|
||||
databaseUrlPlaceholder: 'e.g. mongodb://username:password@mongodb.mydomain.net/dbname',
|
||||
|
||||
|
||||
@@ -78,12 +78,14 @@ function aggregateProfileChartEntry(aggr, obj, stepDuration) {
|
||||
|
||||
const countAll = (aggr.countAll || 0) + 1;
|
||||
const sumMillis = (aggr.sumMillis || 0) + obj.millis;
|
||||
const maxDuration = obj.millis > (aggr.maxDuration || 0) ? obj.millis : aggr.maxDuration || 0;
|
||||
|
||||
return {
|
||||
countAll,
|
||||
sumMillis,
|
||||
countPerSec: (countAll / stepDuration) * 1000,
|
||||
avgDuration: sumMillis / countAll,
|
||||
maxDuration,
|
||||
};
|
||||
|
||||
// return {
|
||||
|
||||
Reference in New Issue
Block a user