Home
last modified time | relevance | path

Searched refs:multiplySafeByRational (Results 1 – 4 of 4) sorted by relevance

/frameworks/base/tests/net/java/com/android/server/net/
DNetworkStatsCollectionTest.java26 import static android.net.NetworkUtils.multiplySafeByRational;
510 assertEquals(25, multiplySafeByRational(50, 1, 2)); in testMultiplySafeRational()
511 assertEquals(100, multiplySafeByRational(50, 2, 1)); in testMultiplySafeRational()
513 assertEquals(-10, multiplySafeByRational(30, -1, 3)); in testMultiplySafeRational()
514 assertEquals(0, multiplySafeByRational(30, 0, 3)); in testMultiplySafeRational()
515 assertEquals(10, multiplySafeByRational(30, 1, 3)); in testMultiplySafeRational()
516 assertEquals(20, multiplySafeByRational(30, 2, 3)); in testMultiplySafeRational()
517 assertEquals(30, multiplySafeByRational(30, 3, 3)); in testMultiplySafeRational()
518 assertEquals(40, multiplySafeByRational(30, 4, 3)); in testMultiplySafeRational()
521 multiplySafeByRational(300_000_000_000L, 10_000_000_000L, 30_000_000_000L)); in testMultiplySafeRational()
[all …]
/frameworks/base/core/java/android/net/
DNetworkStatsHistory.java29 import static android.net.NetworkUtils.multiplySafeByRational;
368 final long fracRxBytes = multiplySafeByRational(rxBytes, overlap, duration); in recordData()
369 final long fracRxPackets = multiplySafeByRational(rxPackets, overlap, duration); in recordData()
370 final long fracTxBytes = multiplySafeByRational(txBytes, overlap, duration); in recordData()
371 final long fracTxPackets = multiplySafeByRational(txPackets, overlap, duration); in recordData()
372 final long fracOperations = multiplySafeByRational(operations, overlap, duration); in recordData()
574 entry.activeTime += multiplySafeByRational(activeTime[i], overlap, bucketSpan); in getValues()
577 entry.rxBytes += multiplySafeByRational(rxBytes[i], overlap, bucketSpan); in getValues()
580 entry.rxPackets += multiplySafeByRational(rxPackets[i], overlap, bucketSpan); in getValues()
583 entry.txBytes += multiplySafeByRational(txBytes[i], overlap, bucketSpan); in getValues()
[all …]
DNetworkUtils.java487 public static long multiplySafeByRational(long value, long num, long den) { in multiplySafeByRational() method in NetworkUtils
/frameworks/base/services/core/java/com/android/server/net/
DNetworkStatsCollection.java31 import static android.net.NetworkUtils.multiplySafeByRational;
290 final long targetRxBytes = multiplySafeByRational(targetBytes, rawRxBytes, rawBytes); in getHistory()
291 final long targetTxBytes = multiplySafeByRational(targetBytes, rawTxBytes, rawBytes); in getHistory()
300 entry.rxBytes = multiplySafeByRational( in getHistory()
302 entry.txBytes = multiplySafeByRational( in getHistory()