Home
last modified time | relevance | path

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

/packages/modules/Connectivity/staticlibs/tests/unit/src/com/android/net/module/util/
DNetworkStatsUtilsTest.kt36 assertEquals(3 * 5 / 2, NetworkStatsUtils.multiplySafeByRational(3, 5, 2)) in testMultiplySafeByRational()
39 assertEquals(0 * 7 / 3, NetworkStatsUtils.multiplySafeByRational(0, 7, 3)) in testMultiplySafeByRational()
40 assertEquals(7 * 0 / 3, NetworkStatsUtils.multiplySafeByRational(7, 0, 3)) in testMultiplySafeByRational()
41 assertEquals(0 * 0 / 1, NetworkStatsUtils.multiplySafeByRational(0, 0, 1)) in testMultiplySafeByRational()
42 assertEquals(0, NetworkStatsUtils.multiplySafeByRational(0, Long.MAX_VALUE, Long.MAX_VALUE)) in testMultiplySafeByRational()
43 assertEquals(0, NetworkStatsUtils.multiplySafeByRational(Long.MAX_VALUE, 0, Long.MAX_VALUE)) in testMultiplySafeByRational()
45 NetworkStatsUtils.multiplySafeByRational(7, 3, 0) in testMultiplySafeByRational()
48 NetworkStatsUtils.multiplySafeByRational(0, 0, 0) in testMultiplySafeByRational()
52 assertEquals(101, NetworkStatsUtils.multiplySafeByRational( in testMultiplySafeByRational()
54 assertEquals(721, NetworkStatsUtils.multiplySafeByRational( in testMultiplySafeByRational()
[all …]
/packages/modules/Connectivity/tests/unit/java/android/net/
DNetworkStatsCollectionTest.java35 import static com.android.net.module.util.NetworkStatsUtils.multiplySafeByRational;
553 assertEquals(25, multiplySafeByRational(50, 1, 2)); in testMultiplySafeRational()
554 assertEquals(100, multiplySafeByRational(50, 2, 1)); in testMultiplySafeRational()
556 assertEquals(-10, multiplySafeByRational(30, -1, 3)); in testMultiplySafeRational()
557 assertEquals(0, multiplySafeByRational(30, 0, 3)); in testMultiplySafeRational()
558 assertEquals(10, multiplySafeByRational(30, 1, 3)); in testMultiplySafeRational()
559 assertEquals(20, multiplySafeByRational(30, 2, 3)); in testMultiplySafeRational()
560 assertEquals(30, multiplySafeByRational(30, 3, 3)); in testMultiplySafeRational()
561 assertEquals(40, multiplySafeByRational(30, 4, 3)); in testMultiplySafeRational()
564 multiplySafeByRational(300_000_000_000L, 10_000_000_000L, 30_000_000_000L)); in testMultiplySafeRational()
[all …]
/packages/modules/Connectivity/framework-t/src/android/net/
DNetworkStatsHistory.java35 import static com.android.net.module.util.NetworkStatsUtils.multiplySafeByRational;
580 final long fracRxBytes = multiplySafeByRational(rxBytes, overlap, duration); in recordData()
581 final long fracRxPackets = multiplySafeByRational(rxPackets, overlap, duration); in recordData()
582 final long fracTxBytes = multiplySafeByRational(txBytes, overlap, duration); in recordData()
583 final long fracTxPackets = multiplySafeByRational(txPackets, overlap, duration); in recordData()
584 final long fracOperations = multiplySafeByRational(operations, overlap, duration); in recordData()
812 entry.activeTime += multiplySafeByRational(activeTime[i], overlap, bucketSpan); in getValues()
815 entry.rxBytes += multiplySafeByRational(rxBytes[i], overlap, bucketSpan); in getValues()
818 entry.rxPackets += multiplySafeByRational(rxPackets[i], overlap, bucketSpan); in getValues()
821 entry.txBytes += multiplySafeByRational(txBytes[i], overlap, bucketSpan); in getValues()
[all …]
DNetworkStats.java19 import static com.android.net.module.util.NetworkStatsUtils.multiplySafeByRational;
1735 multiplySafeByRational(underlyingIfacesTotal.rxBytes, in addTrafficToApplications()
1743 multiplySafeByRational(underlyingIfacesTotal.rxPackets, in addTrafficToApplications()
1750 multiplySafeByRational(underlyingIfacesTotal.txBytes, in addTrafficToApplications()
1757 multiplySafeByRational(underlyingIfacesTotal.txPackets, in addTrafficToApplications()
1764 multiplySafeByRational(underlyingIfacesTotal.operations, in addTrafficToApplications()
1777 multiplySafeByRational(totalRxBytes, in addTrafficToApplications()
1784 multiplySafeByRational(totalRxPackets, in addTrafficToApplications()
1791 multiplySafeByRational(totalTxBytes, in addTrafficToApplications()
1798 multiplySafeByRational(totalTxPackets, in addTrafficToApplications()
[all …]
DNetworkStatsCollection.java40 import static com.android.net.module.util.NetworkStatsUtils.multiplySafeByRational;
340 final long targetRxBytes = multiplySafeByRational(targetBytes, rawRxBytes, rawBytes); in getHistory()
341 final long targetTxBytes = multiplySafeByRational(targetBytes, rawTxBytes, rawBytes); in getHistory()
350 entry.rxBytes = multiplySafeByRational( in getHistory()
352 entry.txBytes = multiplySafeByRational( in getHistory()
/packages/modules/Connectivity/staticlibs/framework/com/android/net/module/util/
DNetworkStatsUtils.java43 public static long multiplySafeByRational(long value, long num, long den) { in multiplySafeByRational() method in NetworkStatsUtils