Add daily stats to console (#12329)

This commit is contained in:
Atul Mohan 2022-05-05 15:31:21 -07:00 committed by GitHub
parent 2d8eb117c0
commit eb6de94e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -56,6 +56,7 @@ export class BarGroup extends React.Component<BarGroupProps> {
datasource: entry.datasource, datasource: entry.datasource,
xValue: entry.x, xValue: entry.x,
yValue: entry.y, yValue: entry.y,
dailySize: entry.dailySize,
}; };
return ( return (
<BarUnit <BarUnit

View File

@ -193,6 +193,7 @@ ORDER BY "start" DESC`;
y0, y0,
datasource, datasource,
color: SegmentTimeline.getColor(i), color: SegmentTimeline.getColor(i),
dailySize: d.total,
}; };
y0 += d[datasource] === undefined ? 0 : d[datasource]; y0 += d[datasource] === undefined ? 0 : d[datasource];
return barUnitData; return barUnitData;

View File

@ -31,6 +31,7 @@ export interface BarUnitData {
width: number; width: number;
datasource: string; datasource: string;
color: string; color: string;
dailySize?: number;
} }
export interface BarChartMargin { export interface BarChartMargin {
@ -48,6 +49,7 @@ export interface HoveredBarInfo {
datasource?: string; datasource?: string;
xValue?: number; xValue?: number;
yValue?: number; yValue?: number;
dailySize?: number;
} }
interface StackedBarChartProps { interface StackedBarChartProps {
@ -151,6 +153,11 @@ export const StackedBarChart = React.memo(function StackedBarChart(props: Stacke
<div className="bar-chart-tooltip"> <div className="bar-chart-tooltip">
<div>Datasource: {hoverOn.datasource}</div> <div>Datasource: {hoverOn.datasource}</div>
<div>Time: {hoverOn.xValue}</div> <div>Time: {hoverOn.xValue}</div>
<div>
{`${
activeDataType === 'countData' ? 'Daily total count:' : 'Daily total size:'
} ${formatTick(hoverOn.dailySize!)}`}
</div>
<div> <div>
{`${activeDataType === 'countData' ? 'Count:' : 'Size:'} ${formatTick( {`${activeDataType === 'countData' ? 'Count:' : 'Size:'} ${formatTick(
hoverOn.yValue!, hoverOn.yValue!,