Skip to content

Commit e523616

Browse files
committed
fix output and input data size
1 parent abacd5c commit e523616

File tree

6 files changed

+30
-32
lines changed

6 files changed

+30
-32
lines changed

presto-ui/src/components/LivePlan.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import ReactDOMServer from "react-dom/server";
1818
import * as dagreD3 from "dagre-d3-es";
1919
import * as d3 from "d3";
2020

21-
import {formatRows, getStageStateColor, truncateString} from "../utils";
21+
import {formatRows, getStageStateColor, truncateString, formatDataSizeBytes} from "../utils";
2222
import {initializeGraph, initializeSvg} from "../d3utils";
2323
import {QueryHeader} from "./QueryHeader";
2424

@@ -98,18 +98,18 @@ export class StageStatistics extends React.Component<StageStatisticsProps, Stage
9898
{stage.state}
9999
<hr/>
100100
CPU: {stats.totalCpuTime}<br />
101-
Buffered: {stats.bufferedDataSize}<br />
101+
Buffered: {formatDataSizeBytes(stats.bufferedDataSizeInBytes)}<br />
102102
{stats.fullyBlocked ?
103103
<div style={{color: '#ff0000'}}>Blocked: {stats.totalBlockedTime} </div> :
104104
<div>Blocked: {stats.totalBlockedTime} </div>
105105
}
106-
Memory: {stats.userMemoryReservation}
106+
Memory: {formatDataSizeBytes(stats.userMemoryReservationInBytes)}
107107
<br/>
108108
Splits: {"Q:" + stats.queuedDrivers + ", R:" + stats.runningDrivers + ", F:" + stats.completedDrivers}
109109
<br/>
110110
Lifespans: {stats.completedLifespans + " / " + stats.totalLifespans}
111111
<hr/>
112-
Input: {stats.rawInputDataSize + " / " + formatRows(stats.rawInputPositions)}
112+
Input: {formatDataSizeBytes(stats.rawInputDataSizeInBytes) + " / " + formatRows(stats.rawInputPositions)}
113113
</div>
114114
</div>
115115
);
@@ -251,7 +251,7 @@ export class LivePlan extends React.Component<LivePlanProps, LivePlanState> {
251251
class: "plan-edge",
252252
style: "stroke-width: 4px",
253253
arrowheadClass: "plan-arrowhead",
254-
label: sourceStats.outputDataSizeInBytes + " / " + formatRows(sourceStats.outputPositions),
254+
label: formatDataSizeBytes(sourceStats.outputDataSizeInBytes) + " / " + formatRows(sourceStats.outputPositions),
255255
labelStyle: "color: #fff; font-weight: bold; font-size: 24px;",
256256
labelType: "html",
257257
});

presto-ui/src/components/QueryDetail.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ export class QueryDetail extends React.Component {
16461646
Output Data
16471647
</td>
16481648
<td className="info-text">
1649-
{query.queryStats.outputDataSizeInBytes}
1649+
{query.queryStats.outputDataSize}
16501650
</td>
16511651
</tr>
16521652
<tr>

presto-ui/src/components/QueryOverview.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ type QueryStats = {
139139
shuffledDataSize: string;
140140
peakTotalMemoryReservation: string;
141141
outputPositions: number;
142-
outputDataSizeInBytes: string;
142+
outputDataSize: string;
143143
writtenOutputPositions: number;
144144
writtenOutputLogicalDataSize: string;
145145
writtenOutputPhysicalDataSize: string;
@@ -1610,7 +1610,7 @@ export default function QueryOverview({ data, show }: { data: QueryData, show: b
16101610
Output Data
16111611
</td>
16121612
<td className="info-text">
1613-
{data.queryStats.outputDataSizeInBytes}
1613+
{data.queryStats.outputDataSize}
16141614
</td>
16151615
</tr>
16161616
<tr>

presto-ui/src/components/QueryPlanView.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { StageStatistics, PlanNode } from './LivePlan';
2020
import ReactDOMServer from "react-dom/server";
2121
import * as dagreD3 from "dagre-d3-es";
2222
import * as d3 from "d3";
23-
import { formatRows, getStageStateColor } from "../utils";
23+
import { formatDataSizeBytes, formatRows, getStageStateColor } from "../utils";
2424
import { initializeGraph } from "../d3utils";
2525

2626
export default function PlanView({show, data}) {
@@ -64,7 +64,7 @@ export default function PlanView({show, data}) {
6464
class: "plan-edge",
6565
style: "stroke-width: 4px",
6666
arrowheadClass: "plan-arrowhead",
67-
label: sourceStats.outputDataSizeInBytes + " / " + formatRows(sourceStats.outputPositions),
67+
label: formatDataSizeBytes(sourceStats.outputDataSizeInBytes) + " / " + formatRows(sourceStats.outputPositions),
6868
labelStyle: "color: #fff; font-weight: bold; font-size: 24px;",
6969
labelType: "html",
7070
});

presto-ui/src/components/QueryStageView.jsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
formatDataSize,
2626
formatDuration,
2727
getTaskNumber,
28-
parseDataSize,
2928
parseDuration
3029
} from "../utils";
3130
import { initializeGraph } from '../d3utils';
@@ -43,7 +42,7 @@ function OperatorSummary({ operator }) {
4342
parseDuration(operator.finishWall) +
4443
parseDuration(operator.blockedWall);
4544
const rowInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputPositions) / (totalWallTime / 1000.0);
46-
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * parseDataSize(operator.inputDataSize)) / (totalWallTime / 1000.0);
45+
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputDataSizeInBytes) / (totalWallTime / 1000.0);
4746

4847
return (
4948
<div className="header-data">
@@ -62,7 +61,7 @@ function OperatorSummary({ operator }) {
6261
Output
6362
</td>
6463
<td>
65-
{formatCount(operator.outputPositions) + " rows (" + operator.outputDataSizeInBytes + ")"}
64+
{formatCount(operator.outputPositions) + " rows (" + formatDataSize(operator.outputDataSizeInBytes) + ")"}
6665
</td>
6766
</tr>
6867
<tr>
@@ -94,7 +93,7 @@ function OperatorSummary({ operator }) {
9493
Input
9594
</td>
9695
<td>
97-
{formatCount(operator.inputPositions) + " rows (" + operator.inputDataSize + ")"}
96+
{formatCount(operator.inputPositions) + " rows (" + formatDataSize(operator.inputDataSizeInBytes) + ")"}
9897
</td>
9998
</tr>
10099
</tbody>
@@ -160,8 +159,8 @@ function OperatorDetail({ index, operator, tasks }) {
160159
},
161160
{
162161
name: "Input Data Size",
163-
id: "inputDataSize",
164-
supplier: operator => parseDataSize(operator.inputDataSize),
162+
id: "inputDataSizeInBytes",
163+
supplier: operator => operator.inputDataSizeInBytes,
165164
renderer: formatDataSize
166165
},
167166
{
@@ -173,7 +172,7 @@ function OperatorDetail({ index, operator, tasks }) {
173172
{
174173
name: "Output Data Size",
175174
id: "outputDataSizeInBytes",
176-
supplier: operator => parseDataSize(operator.outputDataSizeInBytes),
175+
supplier: operator => operator.outputDataSizeInBytes,
177176
renderer: formatDataSize
178177
},
179178
];
@@ -204,10 +203,10 @@ function OperatorDetail({ index, operator, tasks }) {
204203
const totalWallTime = getTotalWallTime(operator);
205204

206205
const rowInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputPositions) / totalWallTime;
207-
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * parseDataSize(operator.inputDataSize)) / (totalWallTime / 1000.0);
206+
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputDataSizeInBytes) / (totalWallTime / 1000.0);
208207

209208
const rowOutputRate = totalWallTime === 0 ? 0 : (1.0 * operator.outputPositions) / totalWallTime;
210-
const byteOutputRate = totalWallTime === 0 ? 0 : (1.0 * parseDataSize(operator.outputDataSizeInBytes)) / (totalWallTime / 1000.0);
209+
const byteOutputRate = totalWallTime === 0 ? 0 : (1.0 * operator.outputDataSizeInBytes) / (totalWallTime / 1000.0);
211210

212211
return (
213212
<div className="col-12 container mx-2">
@@ -230,7 +229,7 @@ function OperatorDetail({ index, operator, tasks }) {
230229
Input
231230
</td>
232231
<td>
233-
{formatCount(operator.inputPositions) + " rows (" + operator.inputDataSize + ")"}
232+
{formatCount(operator.inputPositions) + " rows (" + formatDataSize(operator.inputDataSizeInBytes) + ")"}
234233
</td>
235234
</tr>
236235
<tr>
@@ -246,7 +245,7 @@ function OperatorDetail({ index, operator, tasks }) {
246245
Output
247246
</td>
248247
<td>
249-
{formatCount(operator.outputPositions) + " rows (" + operator.outputDataSizeInBytes + ")"}
248+
{formatCount(operator.outputPositions) + " rows (" + formatDataSize(operator.outputDataSizeInBytes) + ")"}
250249
</td>
251250
</tr>
252251
<tr>

presto-ui/src/components/StageDetail.jsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
getFirstParameter,
2929
getTaskNumber,
3030
isQueryEnded,
31-
parseDataSize,
3231
parseDuration
3332
} from "../utils";
3433
import { initializeGraph, initializeSvg } from "../d3utils";
@@ -45,7 +44,7 @@ class OperatorSummary extends React.Component {
4544
const totalWallTime = parseDuration(operator.addInputWall) + parseDuration(operator.getOutputWall) + parseDuration(operator.finishWall) + parseDuration(operator.blockedWall);
4645

4746
const rowInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputPositions) / (totalWallTime / 1000.0);
48-
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * parseDataSize(operator.inputDataSize)) / (totalWallTime / 1000.0);
47+
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputDataSizeInBytes) / (totalWallTime / 1000.0);
4948

5049
return (
5150
<div className="header-data">
@@ -64,7 +63,7 @@ class OperatorSummary extends React.Component {
6463
Output
6564
</td>
6665
<td>
67-
{formatCount(operator.outputPositions) + " rows (" + operator.outputDataSizeInBytes + ")"}
66+
{formatCount(operator.outputPositions) + " rows (" + formatDataSize(operator.outputDataSizeInBytes) + ")"}
6867
</td>
6968
</tr>
7069
<tr>
@@ -96,7 +95,7 @@ class OperatorSummary extends React.Component {
9695
Input
9796
</td>
9897
<td>
99-
{formatCount(operator.inputPositions) + " rows (" + operator.inputDataSize + ")"}
98+
{formatCount(operator.inputPositions) + " rows (" + formatDataSize(operator.inputDataSizeInBytes) + ")"}
10099
</td>
101100
</tr>
102101
</tbody>
@@ -162,8 +161,8 @@ function OperatorDetail({ index, operator, tasks }) {
162161
},
163162
{
164163
name: "Input Data Size",
165-
id: "inputDataSize",
166-
supplier: operator => parseDataSize(operator.inputDataSize),
164+
id: "inputDataSizeInBytes",
165+
supplier: operator => operator.inputDataSizeInBytes,
167166
renderer: formatDataSize
168167
},
169168
{
@@ -175,7 +174,7 @@ function OperatorDetail({ index, operator, tasks }) {
175174
{
176175
name: "Output Data Size",
177176
id: "outputDataSizeInBytes",
178-
supplier: operator => parseDataSize(operator.outputDataSizeInBytes),
177+
supplier: operator => operator.outputDataSizeInBytes,
179178
renderer: formatDataSize
180179
},
181180
];
@@ -206,10 +205,10 @@ function OperatorDetail({ index, operator, tasks }) {
206205
const totalWallTime = getTotalWallTime(operator);
207206

208207
const rowInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputPositions) / totalWallTime;
209-
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * parseDataSize(operator.inputDataSize)) / (totalWallTime / 1000.0);
208+
const byteInputRate = totalWallTime === 0 ? 0 : (1.0 * operator.inputDataSizeInBytes) / (totalWallTime / 1000.0);
210209

211210
const rowOutputRate = totalWallTime === 0 ? 0 : (1.0 * operator.outputPositions) / totalWallTime;
212-
const byteOutputRate = totalWallTime === 0 ? 0 : (1.0 * parseDataSize(operator.outputDataSizeInBytes)) / (totalWallTime / 1000.0);
211+
const byteOutputRate = totalWallTime === 0 ? 0 : (1.0 * operator.outputDataSizeInBytes) / (totalWallTime / 1000.0);
213212

214213
return (
215214
<div className="col-12 container mx-2">
@@ -232,7 +231,7 @@ function OperatorDetail({ index, operator, tasks }) {
232231
Input
233232
</td>
234233
<td>
235-
{formatCount(operator.inputPositions) + " rows (" + operator.inputDataSize + ")"}
234+
{formatCount(operator.inputPositions) + " rows (" + formatDataSize(operator.inputDataSizeInBytes) + ")"}
236235
</td>
237236
</tr>
238237
<tr>
@@ -248,7 +247,7 @@ function OperatorDetail({ index, operator, tasks }) {
248247
Output
249248
</td>
250249
<td>
251-
{formatCount(operator.outputPositions) + " rows (" + operator.outputDataSizeInBytes + ")"}
250+
{formatCount(operator.outputPositions) + " rows (" + formatDataSize(operator.outputDataSizeInBytes) + ")"}
252251
</td>
253252
</tr>
254253
<tr>

0 commit comments

Comments
 (0)