summaryrefslogtreecommitdiff
path: root/core/java/android/net/ConnectivityMetricsEvent.java
Commit message (Collapse)AuthorAgeFilesLines
* Remove hidden API usage in metrics toStringRemi NGUYEN VAN2020-12-021-4/+2
| | | | | | | | | | | | | Remove usage of hidden NetworkType, transport APIs in toString() implementations of metrics and data usage classes. The toString implementations can log the transports or network type as hex or raw indices. While slightly less readable, the metrics classes and network type APIs are deprecated. Bug: 174436414 Test: m Change-Id: I79239a540b66dadd3bbe0a997960530878331358
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Networking metrics: minor pretty printing improvementsHugo Benichi2017-11-081-1/+2
| | | | | | Bug: 65700460 Test: manually verified the output of $ adb shell dumpsys connmetrics Change-Id: Ieae535b48d2e2b6e9087431d345c8f916006bb6c
* Connectivity metrics: add transports pretty printingHugo Benichi2017-04-131-1/+4
| | | | | | | | | | | | This patch also - partially reverts commit f927f0c52e7df5b057e7d28888c3cfed164d241a that exposed a getTransports method on NetworkCapabilities. - moves enumerateBits to BitUtils (as unpackBits), and adds the reverse packBit method. Bug: 34901696 Test: manually looked at $ adb shell dumpsys connmetrics list Change-Id: Id04f9080e7f75608deeb49306aec34941e71794c
* Connectivity metrics: add transports to validation probesHugo Benichi2017-03-211-1/+4
| | | | | | | | | | This patch adds transports info to ValidationProbeEvent and migrates netId logging for this event to the topt-level netId field in ConnectivityMetricsEvent. Test: modified unit tests. $ runtest frameworks-net passes Bug: 3490169 Change-Id: Ibf51049ba8901ae5ca4ea86e2f500944a4738b5c
* Connectivity metrics: change how interface names are loggedHugo Benichi2017-03-211-2/+8
| | | | | | | | | | | | | This patch deprecates the ifname field for specific metrics events of types DhcpClientEvent, DhcpErrorEvent, IpReachabilityEvent and IpManagerEvent. Instead ifnames are logged in ConnectivityMetricsEvent, allowing for link layer inference. Test: updated unit tests, $ runtest frameworks-net passes Bug: 34901696 Change-Id: I8bfabcb115bbd5289471d653c153a40bb48f28cd
* ConnectivityMetricsEvent: add ifname, netid, transportsHugo Benichi2017-03-161-4/+20
| | | | | | | | | | | | This patch adds new fields to ConnectivityMetricsEvent to make it more symmetric to IpConnectivityEvent in ipconnectivity.proto. Follow-up patches will start populating these fields for users of IpConnectivityLog. Test: unit tests updated, $ runtest frameworks-net passes Bug: 34901696 Change-Id: I396767cdfcf38cce893c0d6e1f4524f12e3fdc64
* Connectivity metrics: simplify ConnectivityMetricsEventHugo Benichi2017-03-151-25/+11
| | | | | | | | | | Now that ConnectivityMetricsEvent is only used for core networking metrics and is not @SystemApi anymore, remove unused fields and prepare for additional new fields. Test: updated unit tests, $ runtest frameworks-net passes Bug: 34901696 Change-Id: I15abad19981d491f16f2a3afe401f1e833079907
* IP connectivity metrics: cleanup obsolete codeHugo Benichi2017-02-221-50/+0
| | | | | | | | | | | | | | | | | | This patch cleans obsolete code related to IP connectivity metrics: - remove @SystemApi on android.net.metrics: now that metrics events are processed and serialized in the frameworks only, event classes should not appear in the system apis. - remove obsolete Logger classes: ConnectivityMetrics app was the unique user of ConnectivityMetricsLogger until nyc-mr1. From nyc-mr1 the app started using dumpsys to get metrics for IpConnectivity and Telephony, which made ConnectivityMetricsLogger obsolete. - simplifications in MetricsTestUtil Test: - runtest frameworks-net - manually verified $ adb shell dumpsys connmetrics Bug: 30054585 Bug: 32648597 Change-Id: I85ef65f7f69eb9299e4636cc7af54067201d9daf
* Better ConnectivityMetricsEvent printingHugo Benichi2016-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds more information printing for IpConnectivity event classes in android.net.metrics. example: ConnectivityMetricsEvent(14:36:35.799, 0, 1026): DhcpClientEvent(wlan0, DhcpRequestingState) ConnectivityMetricsEvent(14:36:35.805, 0, 1026): DhcpClientEvent(wlan0, DhcpHaveAddressState) ConnectivityMetricsEvent(14:36:35.809, 0, 4096): IpManagerEvent(wlan0, PROVISIONING_OK, 155ms) ConnectivityMetricsEvent(14:36:35.810, 0, 1026): DhcpClientEvent(wlan0, DhcpBoundState) ConnectivityMetricsEvent(14:36:35.871, 0, 2048): NetworkEvent(101, NETWORK_CONNECTED, 0ms) ConnectivityMetricsEvent(14:36:35.874, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:599, 3ms) ConnectivityMetricsEvent(14:36:35.874, 0, 2048): NetworkEvent(101, NETWORK_VALIDATION_FAILED, 0ms) ConnectivityMetricsEvent(14:36:35.928, 0, 3072): DefaultNetworkEvent(0 -> 101, [WIFI], IPv4: false, IPv6: false) ConnectivityMetricsEvent(14:36:37.008, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:204, 134ms) ConnectivityMetricsEvent(14:36:37.008, 0, 2050): NetworkEvent(101, NETWORK_VALIDATED, 1137ms) Also fixes a couple of event logging issues: - do no record spurious receive DhcpErrorEvent when a network goes down. - add an eventType field to IpManagerEvent instead of using the loggger component tag. Bug: 28204408 Change-Id: Ia6f4ccfd7a0c63a5ccec18825f226c0b5781217b
* When dumping connectivity metrics events, print data as well.Lorenzo Colitti2016-04-251-2/+2
| | | | | | | | | | | | | | | | | | Currently the output is not very interesting, looking like: ConnectivityMetricsEvent(1461591945223, 4, 5): Bundle[mParcelledData.dataSize=340] ConnectivityMetricsEvent(1461591945289, 0, 2048): android.net.metrics.NetworkEvent@b76cd61 ConnectivityMetricsEvent(1461591945296, 4, 5): Bundle[mParcelledData.dataSize=340] ConnectivityMetricsEvent(1461591945299, 0, 3072): android.net.metrics.DefaultNetworkEvent@e2f3086 ConnectivityMetricsEvent(1461591945527, 0, 2051): android.net.metrics.ValidationProbeEvent@884ad47 but at least it's better than nothing, and event logger users can always implement a better toString method on their events. This is only enabled if --events is passed into the dump. Bug: 28204408 Change-Id: Ife96b8d54e5e91317d86b622d5efc29724969f63
* Make ConnectivityMetricsLogger and related classes @SystemApiPavel Zhamaitsiak2016-04-141-5/+16
| | | | | Bug: 25691077 Change-Id: Ia98d0a52a9541d9ae773be2b0e962d609f9dd7ee
* resolve merge conflicts of 20ebbb3 to nyc-devPavel Zhamaitsiak2016-04-041-0/+38
|\ | | | | | | Change-Id: I31d76a02456b3f09a6bdac11c6dbc5e913f5f7df
| * ConnectivityMetricsLogger: Switch to "pull" modelPavel Zhamaitsiak2016-03-311-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If subscriber is in external app, its process can be killed. This would lead to loss of events. To avoid that, we will be storing events in the logger service. Clients can periodically pull data from it. Another option for client apps is to register PendingIntent which will be sent when certain number of new events has been received. If events are logged at unexpectedly high rate from particular component, then throttling mechanism will activate and new events will be blocked for some time from that component. Change-Id: I710409626eb5a42bcd3fe8126eac6b756fa1ab8b
* | Parcelable classes should always be final.Jeff Sharkey2016-02-291-3/+2
|/ | | | | | | Also hide ConnectivityMetricsEvent which isn't being used yet. Bug: 27415331 Change-Id: Iacdccddda504f3f669185f807b4f35b8dc2b0212
* Add Connectivity Metrics Logger servicePavel Zhamaitsiak2016-02-231-0/+82
This service can be used to pass events to metrics collection service Change-Id: I213874300693cd121f2c8676f70893315de4c4c0