MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / GraphsWrapper

Function GraphsWrapper

web/pgadmin/dashboard/static/js/Graphs.jsx:246–287  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

244};
245
246export function GraphsWrapper(props) {
247 const options = useMemo(()=>({
248 showDataPoints: props.showDataPoints,
249 showTooltip: props.showTooltip,
250 lineBorderWidth: props.lineBorderWidth,
251 theme: props.theme,
252 }), [props.showTooltip, props.showDataPoints, props.lineBorderWidth, props.theme]);
253 return (
254 <>
255 <Grid container spacing={0.5}>
256 <Grid size={{ md: 6 }}>
257 <ChartContainer id='sessions-graph' title={props.isDatabase ? gettext('Database sessions') : gettext('Server sessions')}
258 datasets={props.sessionStats.datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
259 <StreamingChart data={props.sessionStats} dataPointSize={DATA_POINT_SIZE} xRange={X_AXIS_LENGTH} options={options} valueFormatter={(v)=>toPrettySize(v, '')}/>
260 </ChartContainer>
261 </Grid>
262 <Grid size={{ md: 6 }}>
263 <ChartContainer id='tps-graph' title={gettext('Transactions per second')} datasets={props.tpsStats.datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
264 <StreamingChart data={props.tpsStats} dataPointSize={DATA_POINT_SIZE} xRange={X_AXIS_LENGTH} options={options} valueFormatter={(v)=>toPrettySize(v, '')}/>
265 </ChartContainer>
266 </Grid>
267 </Grid>
268 <Grid container spacing={0.5} style={{marginTop: '4px', marginBottom: '4px'}}>
269 <Grid size={{ md: 4 }}>
270 <ChartContainer id='ti-graph' title={gettext('Tuples in')} datasets={props.tiStats.datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
271 <StreamingChart data={props.tiStats} dataPointSize={DATA_POINT_SIZE} xRange={X_AXIS_LENGTH} options={options} valueFormatter={(v)=>toPrettySize(v, '')}/>
272 </ChartContainer>
273 </Grid>
274 <Grid size={{ md: 4 }}>
275 <ChartContainer id='to-graph' title={gettext('Tuples out')} datasets={props.toStats.datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
276 <StreamingChart data={props.toStats} dataPointSize={DATA_POINT_SIZE} xRange={X_AXIS_LENGTH} options={options} valueFormatter={(v)=>toPrettySize(v, '')}/>
277 </ChartContainer>
278 </Grid>
279 <Grid size={{ md: 4 }}>
280 <ChartContainer id='bio-graph' title={gettext('Block I/O')} datasets={props.bioStats.datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
281 <StreamingChart data={props.bioStats} dataPointSize={DATA_POINT_SIZE} xRange={X_AXIS_LENGTH} options={options} valueFormatter={(v)=>toPrettySize(v, '')}/>
282 </ChartContainer>
283 </Grid>
284 </Grid>
285 </>
286 );
287}
288
289const propTypeStats = PropTypes.shape({
290 datasets: PropTypes.array,

Callers

nothing calls this directly

Calls 2

toPrettySizeFunction · 0.90
gettextFunction · 0.85

Tested by

no test coverage detected