|
16 | 16 | */ |
17 | 17 | package org.apache.gluten.metrics; |
18 | 18 |
|
19 | | -import org.apache.gluten.exception.GlutenException; |
20 | | - |
21 | 19 | public class Metrics implements IMetrics { |
22 | | - public long[] inputRows; |
23 | | - public long[] inputVectors; |
24 | | - public long[] inputBytes; |
25 | | - public long[] rawInputRows; |
26 | | - public long[] rawInputBytes; |
27 | | - public long[] outputRows; |
28 | | - public long[] outputVectors; |
29 | | - public long[] outputBytes; |
30 | | - public long[] cpuCount; |
31 | | - public long[] wallNanos; |
32 | | - public long[] scanTime; |
33 | | - public long[] peakMemoryBytes; |
34 | | - public long[] numMemoryAllocations; |
35 | | - public long[] spilledInputBytes; |
36 | | - public long[] spilledBytes; |
37 | | - public long[] spilledRows; |
38 | | - public long[] spilledPartitions; |
39 | | - public long[] spilledFiles; |
40 | | - public long[] numDynamicFiltersProduced; |
41 | | - public long[] numDynamicFiltersAccepted; |
42 | | - public long[] numReplacedWithDynamicFilterRows; |
43 | | - public long[] numDynamicFilterInputRows; |
44 | | - public long[] flushRowCount; |
45 | | - public long[] abandonedPartialAggregationRows; |
46 | | - public long[] loadedToValueHook; |
47 | | - public long[] bloomFilterBlocksByteSize; |
48 | | - public long[] skippedSplits; |
49 | | - public long[] processedSplits; |
50 | | - public long[] skippedStrides; |
51 | | - public long[] processedStrides; |
52 | | - public long[] remainingFilterTime; |
53 | | - public long[] ioWaitTime; |
54 | | - public long[] storageReadBytes; |
55 | | - public long[] storageReads; |
56 | | - public long[] localReadBytes; |
57 | | - public long[] ramReadBytes; |
58 | | - public long[] preloadSplits; |
59 | | - public long[] pageLoadTime; |
60 | | - public long[] dataSourceAddSplitTime; |
61 | | - public long[] dataSourceReadTime; |
62 | | - |
63 | | - public long[] physicalWrittenBytes; |
64 | | - public long[] writeIOTime; |
65 | | - public long[] numWrittenFiles; |
66 | | - |
67 | | - public long[] loadLazyVectorTime; |
68 | | - |
69 | | - public SingleMetric singleMetric = new SingleMetric(); |
| 20 | + public final String metricsJson; |
| 21 | + public final int numMetrics; |
| 22 | + public final SingleMetric singleMetric = new SingleMetric(); |
70 | 23 |
|
71 | 24 | public String taskStats; |
72 | 25 |
|
73 | 26 | /** Create an instance for native metrics. */ |
74 | | - public Metrics( |
75 | | - long[] inputRows, |
76 | | - long[] inputVectors, |
77 | | - long[] inputBytes, |
78 | | - long[] rawInputRows, |
79 | | - long[] rawInputBytes, |
80 | | - long[] outputRows, |
81 | | - long[] outputVectors, |
82 | | - long[] outputBytes, |
83 | | - long[] cpuCount, |
84 | | - long[] wallNanos, |
85 | | - long veloxToArrow, |
86 | | - long[] peakMemoryBytes, |
87 | | - long[] numMemoryAllocations, |
88 | | - long[] spilledInputBytes, |
89 | | - long[] spilledBytes, |
90 | | - long[] spilledRows, |
91 | | - long[] spilledPartitions, |
92 | | - long[] spilledFiles, |
93 | | - long[] numDynamicFiltersProduced, |
94 | | - long[] numDynamicFiltersAccepted, |
95 | | - long[] numReplacedWithDynamicFilterRows, |
96 | | - long[] numDynamicFilterInputRows, |
97 | | - long[] flushRowCount, |
98 | | - long[] abandonedPartialAggregationRows, |
99 | | - long[] loadedToValueHook, |
100 | | - long[] bloomFilterBlocksByteSize, |
101 | | - long[] scanTime, |
102 | | - long[] skippedSplits, |
103 | | - long[] processedSplits, |
104 | | - long[] skippedStrides, |
105 | | - long[] processedStrides, |
106 | | - long[] remainingFilterTime, |
107 | | - long[] ioWaitTime, |
108 | | - long[] storageReadBytes, |
109 | | - long[] storageReads, |
110 | | - long[] localReadBytes, |
111 | | - long[] ramReadBytes, |
112 | | - long[] preloadSplits, |
113 | | - long[] pageLoadTime, |
114 | | - long[] dataSourceAddSplitTime, |
115 | | - long[] dataSourceReadTime, |
116 | | - long[] physicalWrittenBytes, |
117 | | - long[] writeIOTime, |
118 | | - long[] numWrittenFiles, |
119 | | - long[] loadLazyVectorTime, |
120 | | - String taskStats) { |
121 | | - this.inputRows = inputRows; |
122 | | - this.inputVectors = inputVectors; |
123 | | - this.inputBytes = inputBytes; |
124 | | - this.rawInputRows = rawInputRows; |
125 | | - this.rawInputBytes = rawInputBytes; |
126 | | - this.outputRows = outputRows; |
127 | | - this.outputVectors = outputVectors; |
128 | | - this.outputBytes = outputBytes; |
129 | | - this.cpuCount = cpuCount; |
130 | | - this.wallNanos = wallNanos; |
131 | | - this.scanTime = scanTime; |
| 27 | + public Metrics(String metricsJson, int numMetrics, long veloxToArrow, String taskStats) { |
| 28 | + this.metricsJson = metricsJson; |
| 29 | + this.numMetrics = numMetrics; |
132 | 30 | this.singleMetric.veloxToArrow = veloxToArrow; |
133 | | - this.peakMemoryBytes = peakMemoryBytes; |
134 | | - this.numMemoryAllocations = numMemoryAllocations; |
135 | | - this.spilledInputBytes = spilledInputBytes; |
136 | | - this.spilledBytes = spilledBytes; |
137 | | - this.spilledRows = spilledRows; |
138 | | - this.spilledPartitions = spilledPartitions; |
139 | | - this.spilledFiles = spilledFiles; |
140 | | - this.numDynamicFiltersProduced = numDynamicFiltersProduced; |
141 | | - this.numDynamicFiltersAccepted = numDynamicFiltersAccepted; |
142 | | - this.numReplacedWithDynamicFilterRows = numReplacedWithDynamicFilterRows; |
143 | | - this.numDynamicFilterInputRows = numDynamicFilterInputRows; |
144 | | - this.flushRowCount = flushRowCount; |
145 | | - this.abandonedPartialAggregationRows = abandonedPartialAggregationRows; |
146 | | - this.loadedToValueHook = loadedToValueHook; |
147 | | - this.bloomFilterBlocksByteSize = bloomFilterBlocksByteSize; |
148 | | - this.skippedSplits = skippedSplits; |
149 | | - this.processedSplits = processedSplits; |
150 | | - this.skippedStrides = skippedStrides; |
151 | | - this.processedStrides = processedStrides; |
152 | | - this.remainingFilterTime = remainingFilterTime; |
153 | | - this.ioWaitTime = ioWaitTime; |
154 | | - this.storageReadBytes = storageReadBytes; |
155 | | - this.storageReads = storageReads; |
156 | | - this.localReadBytes = localReadBytes; |
157 | | - this.ramReadBytes = ramReadBytes; |
158 | | - this.preloadSplits = preloadSplits; |
159 | | - this.pageLoadTime = pageLoadTime; |
160 | | - this.dataSourceAddSplitTime = dataSourceAddSplitTime; |
161 | | - this.dataSourceReadTime = dataSourceReadTime; |
162 | | - |
163 | | - this.physicalWrittenBytes = physicalWrittenBytes; |
164 | | - this.writeIOTime = writeIOTime; |
165 | | - this.numWrittenFiles = numWrittenFiles; |
166 | | - this.loadLazyVectorTime = loadLazyVectorTime; |
167 | 31 | this.taskStats = taskStats; |
168 | 32 | } |
169 | 33 |
|
170 | | - public OperatorMetrics getOperatorMetrics(int index) { |
171 | | - if (index >= inputRows.length) { |
172 | | - throw new GlutenException("Invalid index."); |
173 | | - } |
174 | | - |
175 | | - return new OperatorMetrics( |
176 | | - inputRows[index], |
177 | | - inputVectors[index], |
178 | | - inputBytes[index], |
179 | | - rawInputRows[index], |
180 | | - rawInputBytes[index], |
181 | | - outputRows[index], |
182 | | - outputVectors[index], |
183 | | - outputBytes[index], |
184 | | - cpuCount[index], |
185 | | - wallNanos[index], |
186 | | - peakMemoryBytes[index], |
187 | | - numMemoryAllocations[index], |
188 | | - spilledInputBytes[index], |
189 | | - spilledBytes[index], |
190 | | - spilledRows[index], |
191 | | - spilledPartitions[index], |
192 | | - spilledFiles[index], |
193 | | - numDynamicFiltersProduced[index], |
194 | | - numDynamicFiltersAccepted[index], |
195 | | - numReplacedWithDynamicFilterRows[index], |
196 | | - numDynamicFilterInputRows[index], |
197 | | - flushRowCount[index], |
198 | | - abandonedPartialAggregationRows[index], |
199 | | - loadedToValueHook[index], |
200 | | - bloomFilterBlocksByteSize[index], |
201 | | - scanTime[index], |
202 | | - skippedSplits[index], |
203 | | - processedSplits[index], |
204 | | - skippedStrides[index], |
205 | | - processedStrides[index], |
206 | | - remainingFilterTime[index], |
207 | | - ioWaitTime[index], |
208 | | - storageReadBytes[index], |
209 | | - storageReads[index], |
210 | | - localReadBytes[index], |
211 | | - ramReadBytes[index], |
212 | | - preloadSplits[index], |
213 | | - pageLoadTime[index], |
214 | | - dataSourceAddSplitTime[index], |
215 | | - dataSourceReadTime[index], |
216 | | - physicalWrittenBytes[index], |
217 | | - writeIOTime[index], |
218 | | - numWrittenFiles[index], |
219 | | - loadLazyVectorTime[index]); |
220 | | - } |
221 | | - |
222 | 34 | public SingleMetric getSingleMetrics() { |
223 | 35 | return singleMetric; |
224 | 36 | } |
|
0 commit comments