Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6abcef6d authored by Blake Kragten's avatar Blake Kragten Committed by Gerrit Code Review
Browse files

Merge "Adding additional modem power metrics to the telephony metrics"

parents 77094052 6f166384
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1556,4 +1556,20 @@ message ModemPowerStats {

  // Amount of time modem is in tx (ms)
  repeated int64 tx_time_ms = 9;

  // Number of bytes sent (tx)
  optional int64 num_bytes_tx = 10;

  // Number of packets received (rx)
  optional int64 num_packets_rx = 11;

  // Number of bytes received (rx)
  optional int64 num_bytes_rx = 12;

  // Amount of time phone spends in various Radio Access Technologies (ms)
  repeated int64 time_in_rat_ms = 13;

  // Amount of time phone spends in various cellular
  // rx signal strength levels (ms)
  repeated int64 time_in_rx_signal_strength_level_ms = 14;
}
+10 −3
Original line number Diff line number Diff line
@@ -60,9 +60,16 @@ public class ModemPowerMetrics {
            m.rxTimeMs = stats.getRxTimeMs();
            long[] t = stats.getTxTimeMs();
            m.txTimeMs = new long[t.length];
            for (int i = 0; i < t.length; i++) {
                m.txTimeMs[i] = t[i];
            }
            System.arraycopy(t, 0, m.txTimeMs, 0, t.length);
            m.numBytesTx = stats.getNumBytesTx();
            m.numPacketsRx = stats.getNumPacketsRx();
            m.numBytesRx = stats.getNumBytesRx();
            long[] tr = stats.getTimeInRatMs();
            m.timeInRatMs = new long[tr.length];
            System.arraycopy(tr, 0, m.timeInRatMs, 0, tr.length);
            long[] trx = stats.getTimeInRxSignalStrengthLevelMs();
            m.timeInRxSignalStrengthLevelMs = new long[trx.length];
            System.arraycopy(trx, 0, m.timeInRxSignalStrengthLevelMs, 0, trx.length);
        }
        return m;
    }
+12 −4
Original line number Diff line number Diff line
@@ -433,14 +433,22 @@ public class TelephonyMetrics {
        pw.println("Power log duration (battery time) (ms): " + s.loggingDurationMs);
        pw.println("Energy consumed by modem (mAh): " + s.energyConsumedMah);
        pw.println("Number of packets sent (tx): " + s.numPacketsTx);
        pw.println("Amount of time kernel is active because of cellular data (ms): " +
            s.cellularKernelActiveTimeMs);
        pw.println("Amount of time spent in very poor rx signal level (ms): " +
            s.timeInVeryPoorRxSignalLevelMs);
        pw.println("Number of bytes sent (tx): " + s.numBytesTx);
        pw.println("Number of packets received (rx): " + s.numPacketsRx);
        pw.println("Number of bytes received (rx): " + s.numBytesRx);
        pw.println("Amount of time kernel is active because of cellular data (ms): "
                + s.cellularKernelActiveTimeMs);
        pw.println("Amount of time spent in very poor rx signal level (ms): "
                + s.timeInVeryPoorRxSignalLevelMs);
        pw.println("Amount of time modem is in sleep (ms): " + s.sleepTimeMs);
        pw.println("Amount of time modem is in idle (ms): " + s.idleTimeMs);
        pw.println("Amount of time modem is in rx (ms): " + s.rxTimeMs);
        pw.println("Amount of time modem is in tx (ms): " + Arrays.toString(s.txTimeMs));
        pw.println("Amount of time phone spent in various Radio Access Technologies (ms): "
                + Arrays.toString(s.timeInRatMs));
        pw.println("Amount of time phone spent in various cellular "
                + "rx signal strength levels (ms): "
                + Arrays.toString(s.timeInRxSignalStrengthLevelMs));
        pw.decreaseIndent();
    }