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