Home
last modified time | relevance | path

Searched refs:uidStats (Results 1 – 25 of 35) sorted by relevance

12

/frameworks/base/services/core/java/com/android/server/power/stats/
DPowerComponentAggregatedPowerStats.java133 PowerComponentAggregatedPowerStats.UidStats uidStats = mUidStats.valueAt(i); in setState() local
134 if (uidStats.stats == null) { in setState()
135 createUidStats(uidStats, timestampMs); in setState()
138 uidStats.states[uidStateId] = state; in setState()
139 if (uidStats.stats != null) { in setState()
140 uidStats.stats.setState(uidStateId, state, timestampMs); in setState()
152 UidStats uidStats = getUidStats(uid); in setUidState() local
153 if (uidStats.stats == null) { in setUidState()
154 createUidStats(uidStats, timestampMs); in setUidState()
157 uidStats.states[stateId] = state; in setUidState()
[all …]
DCpuPowerStatsCollector.java347 mCpuPowerStats.uidStats.clear(); in collectStats()
415 UidStats uidStats = mUidStats.get(uid); in processUidStats() local
416 if (uidStats == null) { in processUidStats()
417 uidStats = new UidStats(); in processUidStats()
418 uidStats.timeByPowerBracket = new long[powerBracketCount]; in processUidStats()
419 uidStats.stats = new long[mLayout.getUidStatsArrayLength()]; in processUidStats()
420 mUidStats.put(uid, uidStats); in processUidStats()
426 timeByPowerBracket[bracket] - uidStats.timeByPowerBracket[bracket]); in processUidStats()
430 mLayout.setUidTimeByPowerBracket(uidStats.stats, bracket, delta); in processUidStats()
431 uidStats.timeByPowerBracket[bracket] = timeByPowerBracket[bracket]; in processUidStats()
[all …]
DBluetoothPowerStatsCollector.java160 mPowerStats.uidStats.clear(); in collectStats()
249 long[] stats = mPowerStats.uidStats.get(uid); in collectBluetoothActivityInfo()
252 mPowerStats.uidStats.put(uid, stats); in collectBluetoothActivityInfo()
264 UidStats uidStats = mUidStats.get(uid); in collectBluetoothScanStats() local
265 if (uidStats == null) { in collectBluetoothScanStats()
266 uidStats = new UidStats(); in collectBluetoothScanStats()
267 mUidStats.put(uid, uidStats); in collectBluetoothScanStats()
269 uidStats.scanTime += scanTimeMs; in collectBluetoothScanStats()
285 long[] stats = mPowerStats.uidStats.get(uid); in collectBluetoothScanStats()
288 mPowerStats.uidStats.put(uid, stats); in collectBluetoothScanStats()
DBinaryStatePowerStatsProcessor.java130 long[] uidStats = mPowerStats.uidStats.get(mInitiatingUid); in recordUsageDuration() local
131 if (uidStats == null) { in recordUsageDuration()
132 uidStats = new long[mDescriptor.uidStatsArrayLength]; in recordUsageDuration()
133 mPowerStats.uidStats.put(mInitiatingUid, uidStats); in recordUsageDuration()
134 mStatsLayout.setUidUsageDuration(uidStats, durationMs); in recordUsageDuration()
161 mPowerStats.uidStats.clear(); in flushPowerStats()
DWifiPowerStatsCollector.java223 mPowerStats.uidStats.clear(); in collectNetworkStats()
244 long[] stats = mPowerStats.uidStats.get(uid); in collectNetworkStats()
247 mPowerStats.uidStats.put(uid, stats); in collectNetworkStats()
278 long[] stats = mPowerStats.uidStats.get(uid); in collectWifiScanTime()
281 mPowerStats.uidStats.put(uid, stats); in collectWifiScanTime()
DPowerStatsExporter.java180 long[] uidStats = new long[descriptor.uidStatsArrayLength]; in populateUidBatteryConsumers() local
207 if (!powerComponentStats.getUidStats(uidStats, uid, states)) { in populateUidBatteryConsumers()
211 double power = layout.getUidPowerEstimate(uidStats); in populateUidBatteryConsumers()
/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/
DBinaryStatePowerStatsProcessorTest.java115 long[] uidStats = new long[stats.getPowerStatsDescriptor().uidStatsArrayLength]; in powerProfileModel() local
116 stats.getUidStats(uidStats, APP_UID1, in powerProfileModel()
118 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel()
121 stats.getUidStats(uidStats, APP_UID1, in powerProfileModel()
123 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel()
126 stats.getUidStats(uidStats, APP_UID1, in powerProfileModel()
128 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel()
135 stats.getUidStats(uidStats, APP_UID2, in powerProfileModel()
137 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel()
140 stats.getUidStats(uidStats, APP_UID2, in powerProfileModel()
[all …]
DBluetoothPowerStatsProcessorTest.java232 long[] uidStats = new long[aggregatedStats.getPowerStatsDescriptor().uidStatsArrayLength]; in powerProfileModel_mostlyDataTransfer() local
233 aggregatedStats.getUidStats(uidStats, APP_UID1, in powerProfileModel_mostlyDataTransfer()
235 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_mostlyDataTransfer()
238 aggregatedStats.getUidStats(uidStats, APP_UID1, in powerProfileModel_mostlyDataTransfer()
240 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_mostlyDataTransfer()
243 aggregatedStats.getUidStats(uidStats, APP_UID1, in powerProfileModel_mostlyDataTransfer()
245 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_mostlyDataTransfer()
253 aggregatedStats.getUidStats(uidStats, APP_UID2, in powerProfileModel_mostlyDataTransfer()
255 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_mostlyDataTransfer()
258 aggregatedStats.getUidStats(uidStats, APP_UID2, in powerProfileModel_mostlyDataTransfer()
[all …]
DMobileRadioPowerStatsProcessorTest.java272 long[] uidStats = new long[aggregatedStats.getPowerStatsDescriptor().uidStatsArrayLength]; in powerProfileModel() local
273 aggregatedStats.getUidStats(uidStats, APP_UID, in powerProfileModel()
275 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel()
277 uidPower1 += statsLayout.getUidPowerEstimate(uidStats); in powerProfileModel()
279 aggregatedStats.getUidStats(uidStats, APP_UID, in powerProfileModel()
281 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel()
283 uidPower1 += statsLayout.getUidPowerEstimate(uidStats); in powerProfileModel()
285 aggregatedStats.getUidStats(uidStats, APP_UID, in powerProfileModel()
287 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel()
289 uidPower1 += statsLayout.getUidPowerEstimate(uidStats); in powerProfileModel()
[all …]
DWifiPowerStatsProcessorTest.java269 long[] uidStats = new long[aggregatedStats.getPowerStatsDescriptor().uidStatsArrayLength]; in powerProfileModel_powerController() local
270 aggregatedStats.getUidStats(uidStats, APP_UID1, in powerProfileModel_powerController()
272 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_powerController()
275 aggregatedStats.getUidStats(uidStats, APP_UID1, in powerProfileModel_powerController()
277 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_powerController()
280 aggregatedStats.getUidStats(uidStats, APP_UID1, in powerProfileModel_powerController()
282 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_powerController()
291 aggregatedStats.getUidStats(uidStats, APP_UID2, in powerProfileModel_powerController()
293 assertThat(statsLayout.getUidPowerEstimate(uidStats)) in powerProfileModel_powerController()
296 aggregatedStats.getUidStats(uidStats, APP_UID2, in powerProfileModel_powerController()
[all …]
DUserPowerCalculatorTest.java120 BatteryStatsImpl.Uid uidStats = mStatsRule.getUidStats(UserHandle.getUid(userId, uid)); in prepareUidBatteryConsumer() local
123 uidStats.noteAudioTurnedOnLocked(0); in prepareUidBatteryConsumer()
124 uidStats.noteAudioTurnedOffLocked(audioDuration1Ms); in prepareUidBatteryConsumer()
125 uidStats.noteAudioTurnedOnLocked(1000000); in prepareUidBatteryConsumer()
126 uidStats.noteAudioTurnedOffLocked(1000000 + audioDuration2Ms); in prepareUidBatteryConsumer()
128 uidStats.noteVideoTurnedOnLocked(0); in prepareUidBatteryConsumer()
129 uidStats.noteVideoTurnedOffLocked(videoDuration1Ms); in prepareUidBatteryConsumer()
130 uidStats.noteVideoTurnedOnLocked(2000000); in prepareUidBatteryConsumer()
131 uidStats.noteVideoTurnedOffLocked(2000000 + videoDuration2Ms); in prepareUidBatteryConsumer()
DCpuPowerStatsCollectorTest.java241 long[] uidStats = new long[descriptor.uidStatsArrayLength]; in powerStatsDescriptor() local
242 layout.setUidTimeByPowerBracket(uidStats, 3, 46); in powerStatsDescriptor()
243 layout.setUidPowerEstimate(uidStats, 47); in powerStatsDescriptor()
259 assertThat(layout.getUidTimeByPowerBracket(uidStats, 3)).isEqualTo(46); in powerStatsDescriptor()
260 assertThat(layout.getUidPowerEstimate(uidStats)).isEqualTo(47); in powerStatsDescriptor()
294 assertThat(layout.getUidTimeByPowerBracket(mCollectedStats.uidStats.get(UID_1), 0)) in collectStats()
296 assertThat(layout.getUidTimeByPowerBracket(mCollectedStats.uidStats.get(UID_1), 1)) in collectStats()
298 assertThat(layout.getUidTimeByPowerBracket(mCollectedStats.uidStats.get(UID_2), 0)) in collectStats()
300 assertThat(layout.getUidTimeByPowerBracket(mCollectedStats.uidStats.get(UID_2), 1)) in collectStats()
324 assertThat(layout.getUidTimeByPowerBracket(mCollectedStats.uidStats.get(UID_1), 0)) in collectStats()
[all …]
DGnssPowerCalculatorTest.java57 BatteryStatsImpl.Uid uidStats = mStatsRule.getUidStats(APP_UID); in testTimerBasedModel() local
58 uidStats.noteStartGps(1000); in testTimerBasedModel()
59 uidStats.noteStopGps(2000); in testTimerBasedModel()
89 BatteryStatsImpl.Uid uidStats = mStatsRule.getUidStats(APP_UID); in testMeasuredEnergyBasedModel() local
90 uidStats.noteStartGps(1000); in testMeasuredEnergyBasedModel()
91 uidStats.noteStopGps(2000); in testMeasuredEnergyBasedModel()
DFlashlightPowerCalculatorTest.java53 BatteryStatsImpl.Uid uidStats = mStatsRule.getUidStats(APP_UID); in testTimerBasedModel() local
54 uidStats.noteFlashlightTurnedOnLocked(1000); in testTimerBasedModel()
55 uidStats.noteFlashlightTurnedOffLocked(2000); in testTimerBasedModel()
DVideoPowerCalculatorTest.java53 BatteryStatsImpl.Uid uidStats = mStatsRule.getUidStats(APP_UID); in testTimerBasedModel() local
54 uidStats.noteVideoTurnedOnLocked(1000); in testTimerBasedModel()
55 uidStats.noteVideoTurnedOffLocked(2000); in testTimerBasedModel()
DAudioPowerCalculatorTest.java53 BatteryStatsImpl.Uid uidStats = mStatsRule.getUidStats(APP_UID); in testTimerBasedModel() local
54 uidStats.noteAudioTurnedOnLocked(1000); in testTimerBasedModel()
55 uidStats.noteAudioTurnedOffLocked(2000); in testTimerBasedModel()
DPowerStatsAggregatorTest.java87 powerStats.uidStats.put(TEST_UID, new long[]{0}); in stateUpdates()
99 powerStats.uidStats.put(TEST_UID, new long[]{1234}); in stateUpdates()
119 powerStats.uidStats.put(TEST_UID, new long[]{4444}); in stateUpdates()
194 powerStats.uidStats.put(TEST_UID, new long[]{0}); in incompatiblePowerStats()
203 powerStats.uidStats.put(TEST_UID, new long[]{1234}); in incompatiblePowerStats()
214 powerStats.uidStats.put(TEST_UID, new long[]{4444}); in incompatiblePowerStats()
DMobileRadioPowerStatsCollectorTest.java275 assertThat(powerStats.uidStats.size()).isEqualTo(2); in collectStats()
276 long[] actual1 = powerStats.uidStats.get(APP_UID1); in collectStats()
283 long[] actual2 = powerStats.uidStats.get(APP_UID2); in collectStats()
289 assertThat(powerStats.uidStats.get(ISOLATED_UID)).isNull(); in collectStats()
290 assertThat(powerStats.uidStats.get(APP_UID3)).isNull(); in collectStats()
318 assertThat(powerStats.uidStats.size()).isEqualTo(2); in collectStats_noPerNetworkTypeData()
319 long[] actual1 = powerStats.uidStats.get(APP_UID1); in collectStats_noPerNetworkTypeData()
326 long[] actual2 = powerStats.uidStats.get(APP_UID2); in collectStats_noPerNetworkTypeData()
332 assertThat(powerStats.uidStats.get(ISOLATED_UID)).isNull(); in collectStats_noPerNetworkTypeData()
333 assertThat(powerStats.uidStats.get(APP_UID3)).isNull(); in collectStats_noPerNetworkTypeData()
DAggregatedPowerStatsTest.java119 ps.uidStats.put(APP_1, new long[]{389, 0, 739}); in prepareAggregatePowerStats()
120 ps.uidStats.put(APP_2, new long[]{278, 314, 628}); in prepareAggregatePowerStats()
136 ps.uidStats.put(APP_1, new long[]{0, 0, 400}); in prepareAggregatePowerStats()
137 ps.uidStats.put(APP_2, new long[]{100, 200, 300}); in prepareAggregatePowerStats()
DBluetoothPowerStatsCollectorTest.java201 assertThat(powerStats.uidStats.size()).isEqualTo(2); in collectStats()
202 long[] actual1 = powerStats.uidStats.get(APP_UID1); in collectStats()
208 long[] actual2 = powerStats.uidStats.get(APP_UID2); in collectStats()
213 assertThat(powerStats.uidStats.get(ISOLATED_UID)).isNull(); in collectStats()
/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DPowerStatsTest.java80 stats.uidStats.put(42, new long[]{40, 50}); in parceling_compatibleParcel()
81 stats.uidStats.put(99, new long[]{60, 70}); in parceling_compatibleParcel()
109 assertThat(newStats.uidStats.size()).isEqualTo(2); in parceling_compatibleParcel()
110 assertThat(newStats.uidStats.get(42)).isEqualTo(new long[]{40, 50}); in parceling_compatibleParcel()
111 assertThat(newStats.uidStats.get(99)).isEqualTo(new long[]{60, 70}); in parceling_compatibleParcel()
211 stats.uidStats.put(42, new long[]{40, 50}); in formatForBatteryHistory()
212 stats.uidStats.put(99, new long[]{60, 70}); in formatForBatteryHistory()
232 stats.uidStats.put(42, new long[]{40, 50}); in dump()
233 stats.uidStats.put(99, new long[]{60, 70}); in dump()
/frameworks/base/core/java/com/android/internal/os/
DPowerStats.java434 public final SparseArray<long[]> uidStats = new SparseArray<>(); field in PowerStats
461 parcel.writeInt(uidStats.size()); in writeToParcel()
462 for (int i = 0; i < uidStats.size(); i++) { in writeToParcel()
463 parcel.writeInt(uidStats.keyAt(i)); in writeToParcel()
464 VARINT_PARCELER.writeLongArray(parcel, uidStats.valueAt(i)); in writeToParcel()
509 long[] uidStats = new long[descriptor.uidStatsArrayLength]; in readFromParcel() local
510 VARINT_PARCELER.readLongArray(parcel, uidStats); in readFromParcel()
511 stats.uidStats.put(uid, uidStats); in readFromParcel()
552 for (int i = 0; i < uidStats.size(); i++) { in formatForBatteryHistory()
554 .append(UserHandle.formatUid(uidStats.keyAt(i))) in formatForBatteryHistory()
[all …]
/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/controllers/
DConnectivityController.java339 final UidStats uidStats = in maybeStartTrackingJobLocked() local
342 uidStats.numReadyWithConnectivity++; in maybeStartTrackingJobLocked()
359 final UidStats uidStats = in prepareForExecutionLocked() local
361 uidStats.runningJobs.add(jobStatus); in prepareForExecutionLocked()
369 final UidStats uidStats = in unprepareFromExecutionLocked() local
371 uidStats.runningJobs.remove(jobStatus); in unprepareFromExecutionLocked()
384 final UidStats uidStats = in maybeStopTrackingJobLocked() local
386 uidStats.numReadyWithConnectivity--; in maybeStopTrackingJobLocked()
387 uidStats.runningJobs.remove(jobStatus); in maybeStopTrackingJobLocked()
500 final UidStats uidStats = in evaluateStateLocked() local
[all …]
/frameworks/base/services/core/java/com/android/server/stats/pull/
DAggregatedMobileDataStatsPuller.java280 for (Map.Entry<UidProcState, MobileDataStats> uidStats : mUidStats.entrySet()) { in pullDataBytesTransferLocked()
281 if (!uidStats.getValue().isEmpty()) { in pullDataBytesTransferLocked()
282 MobileDataStats stats = uidStats.getValue(); in pullDataBytesTransferLocked()
285 uidStats.getKey().getUid(), in pullDataBytesTransferLocked()
286 ActivityManager.processStateAmToProto(uidStats.getKey().getState()), in pullDataBytesTransferLocked()
/frameworks/base/core/java/android/os/
DBluetoothBatteryStats.java84 public BluetoothBatteryStats(@NonNull List<UidStats> uidStats) { in BluetoothBatteryStats() argument
85 mUidStats = uidStats; in BluetoothBatteryStats()

12