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,
xValue: entry.x,
yValue: entry.y,
dailySize: entry.dailySize,
};
return (
<BarUnit

View File

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

View File

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