mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 07:56:01 +00:00
profiler charts
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
const driver = require('./driver');
|
||||
const formatProfilerEntry = require('../frontend/formatProfilerEntry');
|
||||
const formatProfilerChartEntry = require('../frontend/formatProfilerChartEntry');
|
||||
|
||||
module.exports = {
|
||||
packageName: 'dbgate-plugin-mongo',
|
||||
drivers: [driver],
|
||||
functions: {
|
||||
formatProfilerEntry,
|
||||
formatProfilerChartEntry,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -35,6 +35,11 @@ const driver = {
|
||||
supportsServerSummary: true,
|
||||
supportsDatabaseProfiler: true,
|
||||
profilerFormatterFunction: 'formatProfilerEntry@dbgate-plugin-mongo',
|
||||
profilerChartFormatterFunction: 'formatProfilerChartEntry@dbgate-plugin-mongo',
|
||||
profilerChartMeasures: [
|
||||
{ label: 'Req count', field: 'count' },
|
||||
{ label: 'Duration', field: 'millis' },
|
||||
],
|
||||
databaseUrlPlaceholder: 'e.g. mongodb://username:password@mongodb.mydomain.net/dbname',
|
||||
|
||||
getQuerySplitterOptions: () => mongoSplitterOptions,
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
const _ = require('lodash');
|
||||
const formatProfilerEntry = require('./formatProfilerEntry');
|
||||
|
||||
function formatProfilerChartEntry(obj) {
|
||||
const fmt = formatProfilerEntry(obj);
|
||||
|
||||
return {
|
||||
ts: fmt.ts,
|
||||
millis: fmt.stats.millis,
|
||||
count: 1,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = formatProfilerChartEntry;
|
||||
@@ -2,6 +2,7 @@ const _ = require('lodash');
|
||||
|
||||
function formatProfilerEntry(obj) {
|
||||
const ts = obj.ts;
|
||||
const stats = { millis: obj.millis };
|
||||
let op = obj.op;
|
||||
let doc;
|
||||
let query;
|
||||
@@ -64,6 +65,7 @@ function formatProfilerEntry(obj) {
|
||||
doc,
|
||||
query,
|
||||
ext,
|
||||
stats,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import driver from './driver';
|
||||
import formatProfilerEntry from './formatProfilerEntry';
|
||||
import formatProfilerChartEntry from './formatProfilerChartEntry';
|
||||
|
||||
export default {
|
||||
packageName: 'dbgate-plugin-mongo',
|
||||
drivers: [driver],
|
||||
functions: {
|
||||
formatProfilerEntry,
|
||||
formatProfilerChartEntry,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user