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

Commit 450f1b7d authored by Arun Voddu's avatar Arun Voddu Committed by Android (Google) Code Review
Browse files

Merge "[Satellite] Satellite metrics to capture pending message count per datagram type." into main

parents 1f1b36f3 f2945b90
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -223,6 +223,10 @@ public final class SatelliteSessionStats implements Parcelable {
        return mCountOfUserMessagesInQueueToBeSent;
    }

    public void incrementUserMessagesInQueueToBeSent() {
        mCountOfUserMessagesInQueueToBeSent++;
    }

    public long getLatencyOfAllSuccessfulUserMessages() {
        return mLatencyOfSuccessfulUserMessages;
    }
@@ -288,6 +292,18 @@ public final class SatelliteSessionStats implements Parcelable {
        }
    }

    public void updateCountOfUserMessagesInQueueToBeSent(
            @SatelliteManager.DatagramType int datagramType) {
        try {
            datagramStats.putIfAbsent(datagramType, new SatelliteSessionStats.Builder().build());
            SatelliteSessionStats data = datagramStats.get(datagramType);
            data.incrementUserMessagesInQueueToBeSent();
        } catch (Exception e) {
            Log.e("SatelliteSessionStats",
                    "Error while addCountOfUserMessagesInQueueToBeSent: " + e.getMessage());
        }
    }

    public int getCountOfUnsuccessfulUserMessages(@SatelliteManager.DatagramType int datagramType) {
        SatelliteSessionStats data = datagramStats.get(datagramType);
        return data.getCountOfUnsuccessfulUserMessages();