/packages/modules/StatsD/statsd/tests/ |
D | statsd_test_util.cpp | 715 void writeAttribution(AStatsEvent* statsEvent, const vector<int>& attributionUids, in writeAttribution() argument 722 AStatsEvent_writeAttributionChain(statsEvent, in writeAttribution() 727 bool parseStatsEventToLogEvent(AStatsEvent* statsEvent, LogEvent* logEvent) { in parseStatsEventToLogEvent() argument 728 AStatsEvent_build(statsEvent); in parseStatsEventToLogEvent() 731 uint8_t* buf = AStatsEvent_getBuffer(statsEvent, &size); in parseStatsEventToLogEvent() 734 AStatsEvent_release(statsEvent); in parseStatsEventToLogEvent() 741 AStatsEvent* statsEvent = AStatsEvent_obtain(); in CreateTwoValueLogEvent() local 742 AStatsEvent_setAtomId(statsEvent, atomId); in CreateTwoValueLogEvent() 743 AStatsEvent_overwriteTimestamp(statsEvent, eventTimeNs); in CreateTwoValueLogEvent() 745 AStatsEvent_writeInt32(statsEvent, value1); in CreateTwoValueLogEvent() [all …]
|
D | LogEvent_test.cpp | 52 AStatsEvent* statsEvent = AStatsEvent_obtain(); in createFieldWithBoolAnnotationLogEvent() local 53 createStatsEvent(statsEvent, typeId, /*atomId=*/100); in createFieldWithBoolAnnotationLogEvent() 54 AStatsEvent_addBoolAnnotation(statsEvent, annotationId, annotationValue); in createFieldWithBoolAnnotationLogEvent() 55 AStatsEvent_build(statsEvent); in createFieldWithBoolAnnotationLogEvent() 58 const uint8_t* buf = AStatsEvent_getBuffer(statsEvent, &size); in createFieldWithBoolAnnotationLogEvent() 66 AStatsEvent_release(statsEvent); in createFieldWithBoolAnnotationLogEvent() 73 AStatsEvent* statsEvent = AStatsEvent_obtain(); in createFieldWithIntAnnotationLogEvent() local 74 createStatsEvent(statsEvent, typeId, /*atomId=*/100); in createFieldWithIntAnnotationLogEvent() 75 AStatsEvent_addInt32Annotation(statsEvent, annotationId, annotationValue); in createFieldWithIntAnnotationLogEvent() 76 AStatsEvent_build(statsEvent); in createFieldWithIntAnnotationLogEvent() [all …]
|
D | LogEntryMatcher_test.cpp | 47 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeIntLogEvent() local 48 AStatsEvent_setAtomId(statsEvent, atomId); in makeIntLogEvent() 49 AStatsEvent_overwriteTimestamp(statsEvent, timestamp); in makeIntLogEvent() 50 AStatsEvent_writeInt32(statsEvent, value); in makeIntLogEvent() 52 parseStatsEventToLogEvent(statsEvent, logEvent); in makeIntLogEvent() 57 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeFloatLogEvent() local 58 AStatsEvent_setAtomId(statsEvent, atomId); in makeFloatLogEvent() 59 AStatsEvent_overwriteTimestamp(statsEvent, timestamp); in makeFloatLogEvent() 60 AStatsEvent_writeFloat(statsEvent, floatValue); in makeFloatLogEvent() 62 parseStatsEventToLogEvent(statsEvent, logEvent); in makeFloatLogEvent() [all …]
|
D | SocketListener_test.cpp | 36 AStatsEvent* statsEvent = nullptr; member in android::os::statsd::__anon187f477a0111::AStatsEventWrapper 40 statsEvent = AStatsEvent_obtain(); in AStatsEventWrapper() 41 createStatsEvent(statsEvent, INT64_TYPE, /*atomId=*/atomId); in AStatsEventWrapper() 42 AStatsEvent_build(statsEvent); in AStatsEventWrapper() 47 const uint8_t* buf = AStatsEvent_getBuffer(statsEvent, &size); in getBuffer() 52 AStatsEvent_release(statsEvent); in ~AStatsEventWrapper()
|
D | FieldValue_test.cpp | 41 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeLogEvent() local 42 AStatsEvent_setAtomId(statsEvent, atomId); in makeLogEvent() 43 AStatsEvent_overwriteTimestamp(statsEvent, timestamp); in makeLogEvent() 45 writeAttribution(statsEvent, attributionUids, attributionTags); in makeLogEvent() 46 AStatsEvent_writeString(statsEvent, name.c_str()); in makeLogEvent() 48 parseStatsEventToLogEvent(statsEvent, logEvent); in makeLogEvent() 54 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeLogEvent() local 55 AStatsEvent_setAtomId(statsEvent, atomId); in makeLogEvent() 56 AStatsEvent_overwriteTimestamp(statsEvent, timestamp); in makeLogEvent() 58 writeAttribution(statsEvent, attributionUids, attributionTags); in makeLogEvent() [all …]
|
D | statsd_test_util.h | 378 void writeAttribution(AStatsEvent* statsEvent, const vector<int>& attributionUids, 382 bool parseStatsEventToLogEvent(AStatsEvent* statsEvent, LogEvent* logEvent); 570 void createStatsEvent(AStatsEvent* statsEvent, uint8_t typeId, uint32_t atomId); 572 void fillStatsEventWithSampleValue(AStatsEvent* statsEvent, uint8_t typeId);
|
/packages/modules/StatsD/statsd/tests/utils/ |
D | DbUtils_test.cpp | 42 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeAStatsEvent() local 43 AStatsEvent_setAtomId(statsEvent, atomId); in makeAStatsEvent() 44 AStatsEvent_overwriteTimestamp(statsEvent, timestampNs); in makeAStatsEvent() 45 return statsEvent; in makeAStatsEvent() 48 LogEvent makeLogEvent(AStatsEvent* statsEvent) { in makeLogEvent() argument 50 parseStatsEventToLogEvent(statsEvent, &event); in makeLogEvent() 73 AStatsEvent* statsEvent = makeAStatsEvent(tagId, eventElapsedTimeNs + 10); in TEST_F() local 74 AStatsEvent_writeString(statsEvent, "test_string"); in TEST_F() 75 LogEvent logEvent = makeLogEvent(statsEvent); in TEST_F() 99 AStatsEvent* statsEvent = makeAStatsEvent(tagId, eventElapsedTimeNs + 10); in TEST_F() local [all …]
|
/packages/modules/StatsD/framework/test/unittests/src/android/util/ |
D | StatsEventTest.java | 44 final StatsEvent statsEvent = StatsEvent.newBuilder().usePooledBuffer().build(); in testNoFields() local 48 assertThat(statsEvent.getAtomId()).isEqualTo(expectedAtomId); in testNoFields() 51 ByteBuffer.wrap(statsEvent.getBytes()).order(ByteOrder.LITTLE_ENDIAN); in testNoFields() 79 assertThat(statsEvent.getNumBytes()).isEqualTo(buffer.position()); in testNoFields() 81 statsEvent.release(); in testNoFields() 89 final StatsEvent statsEvent = StatsEvent.newBuilder() in testOnlyAtomId() local 95 assertThat(statsEvent.getAtomId()).isEqualTo(expectedAtomId); in testOnlyAtomId() 98 ByteBuffer.wrap(statsEvent.getBytes()).order(ByteOrder.LITTLE_ENDIAN); in testOnlyAtomId() 118 assertThat(statsEvent.getNumBytes()).isEqualTo(buffer.position()); in testOnlyAtomId() 120 statsEvent.release(); in testOnlyAtomId() [all …]
|
/packages/modules/StatsD/statsd/tests/log_event/ |
D | LogEventQueue_test.cpp | 39 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeStatsEvent() local 40 AStatsEvent_setAtomId(statsEvent, 10); in makeStatsEvent() 41 AStatsEvent_overwriteTimestamp(statsEvent, timestampNs); in makeStatsEvent() 42 AStatsEvent_build(statsEvent); in makeStatsEvent() 43 return statsEvent; in makeStatsEvent() 47 AStatsEvent* statsEvent = makeStatsEvent(timestampNs); in makeLogEvent() local 49 parseStatsEventToLogEvent(statsEvent, logEvent.get()); in makeLogEvent() 129 auto statsEvent = makeStatsEvent(eventTimeNs); in TEST() local 131 const uint8_t* buffer = AStatsEvent_getBuffer(statsEvent, &bufferSize); in TEST() 133 AStatsEvent_release(statsEvent); in TEST() [all …]
|
/packages/modules/StatsD/statsd/benchmark/ |
D | filter_value_benchmark.cpp | 33 AStatsEvent* statsEvent = AStatsEvent_obtain(); in createLogEventAndMatcher() local 34 AStatsEvent_setAtomId(statsEvent, 1); in createLogEventAndMatcher() 35 AStatsEvent_overwriteTimestamp(statsEvent, 100000); in createLogEventAndMatcher() 39 writeAttribution(statsEvent, attributionUids, attributionTags); in createLogEventAndMatcher() 41 AStatsEvent_writeFloat(statsEvent, 3.2f); in createLogEventAndMatcher() 42 AStatsEvent_writeString(statsEvent, "LOCATION"); in createLogEventAndMatcher() 43 AStatsEvent_writeInt64(statsEvent, 990); in createLogEventAndMatcher() 45 parseStatsEventToLogEvent(statsEvent, event); in createLogEventAndMatcher()
|
D | get_dimensions_for_condition_benchmark.cpp | 33 AStatsEvent* statsEvent = AStatsEvent_obtain(); in createLogEventAndLink() local 34 AStatsEvent_setAtomId(statsEvent, 1); in createLogEventAndLink() 35 AStatsEvent_overwriteTimestamp(statsEvent, 100000); in createLogEventAndLink() 39 writeAttribution(statsEvent, attributionUids, attributionTags); in createLogEventAndLink() 41 AStatsEvent_writeFloat(statsEvent, 3.2f); in createLogEventAndLink() 42 AStatsEvent_writeString(statsEvent, "LOCATION"); in createLogEventAndLink() 43 AStatsEvent_writeInt64(statsEvent, 990); in createLogEventAndLink() 45 parseStatsEventToLogEvent(statsEvent, event); in createLogEventAndLink()
|
/packages/modules/StatsD/statsd/tests/e2e/ |
D | RestrictedEventMetric_e2e_test.cpp | 177 AStatsEvent* statsEvent = AStatsEvent_obtain(); in TEST_F() local 178 AStatsEvent_setAtomId(statsEvent, atomTag); in TEST_F() 179 AStatsEvent_addInt32Annotation(statsEvent, ASTATSLOG_ANNOTATION_ID_RESTRICTION_CATEGORY, in TEST_F() 181 AStatsEvent_overwriteTimestamp(statsEvent, configAddedTimeNs + 200); in TEST_F() 183 AStatsEvent_writeString(statsEvent, "111"); in TEST_F() 184 AStatsEvent_writeInt32(statsEvent, 11); in TEST_F() 185 AStatsEvent_writeFloat(statsEvent, 11.0); in TEST_F() 187 parseStatsEventToLogEvent(statsEvent, logEvent.get()); in TEST_F() 224 AStatsEvent* statsEvent = AStatsEvent_obtain(); in TEST_F() local 225 AStatsEvent_setAtomId(statsEvent, atomTag); in TEST_F() [all …]
|
/packages/modules/StatsD/statsd/tests/metrics/ |
D | RestrictedEventMetricProducer_test.cpp | 97 AStatsEvent* statsEvent = AStatsEvent_obtain(); in TEST_F() local 98 AStatsEvent_setAtomId(statsEvent, 1); in TEST_F() 99 AStatsEvent_addInt32Annotation(statsEvent, ASTATSLOG_ANNOTATION_ID_RESTRICTION_CATEGORY, in TEST_F() 101 AStatsEvent_overwriteTimestamp(statsEvent, 1); in TEST_F() 103 AStatsEvent_writeString(statsEvent, "111"); in TEST_F() 104 AStatsEvent_writeInt32(statsEvent, 11); in TEST_F() 105 AStatsEvent_writeFloat(statsEvent, 11.0); in TEST_F() 107 parseStatsEventToLogEvent(statsEvent, &logEvent); in TEST_F()
|
D | CountMetricProducer_test.cpp | 47 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeLogEvent() local 48 AStatsEvent_setAtomId(statsEvent, atomId); in makeLogEvent() 49 AStatsEvent_overwriteTimestamp(statsEvent, timestampNs); in makeLogEvent() 51 parseStatsEventToLogEvent(statsEvent, logEvent); in makeLogEvent() 55 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeLogEvent() local 56 AStatsEvent_setAtomId(statsEvent, atomId); in makeLogEvent() 57 AStatsEvent_overwriteTimestamp(statsEvent, timestampNs); in makeLogEvent() 58 AStatsEvent_writeString(statsEvent, uid.c_str()); in makeLogEvent() 60 parseStatsEventToLogEvent(statsEvent, logEvent); in makeLogEvent()
|
D | EventMetricProducer_test.cpp | 45 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeLogEvent() local 46 AStatsEvent_setAtomId(statsEvent, atomId); in makeLogEvent() 47 AStatsEvent_overwriteTimestamp(statsEvent, timestampNs); in makeLogEvent() 48 AStatsEvent_writeString(statsEvent, str.c_str()); in makeLogEvent() 50 AStatsEvent_writeByteArray(statsEvent, bytesField->data(), bytesField->size()); in makeLogEvent() 53 parseStatsEventToLogEvent(statsEvent, logEvent); in makeLogEvent()
|
D | DurationMetricProducer_test.cpp | 50 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeLogEvent() local 51 AStatsEvent_setAtomId(statsEvent, atomId); in makeLogEvent() 52 AStatsEvent_overwriteTimestamp(statsEvent, timestampNs); in makeLogEvent() 54 parseStatsEventToLogEvent(statsEvent, logEvent); in makeLogEvent()
|
D | GaugeMetricProducer_test.cpp | 61 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeLogEvent() local 62 AStatsEvent_setAtomId(statsEvent, atomId); in makeLogEvent() 63 AStatsEvent_overwriteTimestamp(statsEvent, timestampNs); in makeLogEvent() 65 AStatsEvent_writeInt32(statsEvent, value1); in makeLogEvent() 66 AStatsEvent_writeString(statsEvent, str1.c_str()); in makeLogEvent() 67 AStatsEvent_writeInt32(statsEvent, value2); in makeLogEvent() 70 parseStatsEventToLogEvent(statsEvent, logEvent.get()); in makeLogEvent()
|
/packages/modules/StatsD/statsd/tests/state/ |
D | StateTracker_test.cpp | 71 AStatsEvent* statsEvent = AStatsEvent_obtain(); in buildIncorrectOverlayEvent() local 72 AStatsEvent_setAtomId(statsEvent, util::OVERLAY_STATE_CHANGED); in buildIncorrectOverlayEvent() 73 AStatsEvent_overwriteTimestamp(statsEvent, 1000); in buildIncorrectOverlayEvent() 75 AStatsEvent_writeInt32(statsEvent, uid); in buildIncorrectOverlayEvent() 76 AStatsEvent_writeString(statsEvent, packageName.c_str()); in buildIncorrectOverlayEvent() 78 AStatsEvent_writeInt32(statsEvent, state); in buildIncorrectOverlayEvent() 81 parseStatsEventToLogEvent(statsEvent, logEvent.get()); in buildIncorrectOverlayEvent() 87 AStatsEvent* statsEvent = AStatsEvent_obtain(); in buildOverlayEventBadStateType() local 88 AStatsEvent_setAtomId(statsEvent, util::OVERLAY_STATE_CHANGED); in buildOverlayEventBadStateType() 89 AStatsEvent_overwriteTimestamp(statsEvent, 1000); in buildOverlayEventBadStateType() [all …]
|
/packages/modules/StatsD/tests/utils/src/android/util/ |
D | StatsEventTestUtils.java | 53 public static Atom convertToAtom(StatsEvent statsEvent) throws InvalidProtocolBufferException { in convertToAtom() argument 54 return Atom.parseFrom(getProtoBytes(statsEvent)); in convertToAtom() 60 private static byte[] getProtoBytes(StatsEvent statsEvent) { in getProtoBytes() argument 62 ByteBuffer buf = ByteBuffer.wrap(statsEvent.getBytes()).order(ByteOrder.LITTLE_ENDIAN); in getProtoBytes() 101 if (buf.position() != statsEvent.getNumBytes()) { in getProtoBytes() 108 statsEvent.release(); in getProtoBytes()
|
/packages/modules/StatsD/framework/java/android/util/ |
D | StatsLog.java | 466 public static void write(@NonNull final StatsEvent statsEvent) { in write() argument 467 writeImpl(statsEvent.getBytes(), statsEvent.getNumBytes(), statsEvent.getAtomId()); in write() 468 statsEvent.release(); in write()
|
/packages/modules/StatsD/statsd/tests/external/ |
D | StatsPuller_test.cpp | 64 AStatsEvent* statsEvent = AStatsEvent_obtain(); in createSimpleEvent() local 65 AStatsEvent_setAtomId(statsEvent, pullTagId); in createSimpleEvent() 66 AStatsEvent_overwriteTimestamp(statsEvent, eventTimeNs); in createSimpleEvent() 67 AStatsEvent_writeInt64(statsEvent, value); in createSimpleEvent() 70 parseStatsEventToLogEvent(statsEvent, logEvent.get()); in createSimpleEvent()
|
/packages/modules/StatsD/statsd/tests/condition/ |
D | SimpleConditionTracker_test.cpp | 68 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeWakeLockEvent() local 69 AStatsEvent_setAtomId(statsEvent, 1); in makeWakeLockEvent() 70 AStatsEvent_overwriteTimestamp(statsEvent, 0); in makeWakeLockEvent() 73 writeAttribution(statsEvent, uids, tags); in makeWakeLockEvent() 75 AStatsEvent_writeString(statsEvent, wl.c_str()); in makeWakeLockEvent() 76 AStatsEvent_writeInt32(statsEvent, acquire); in makeWakeLockEvent() 78 parseStatsEventToLogEvent(statsEvent, logEvent); in makeWakeLockEvent()
|
/packages/modules/StatsD/statsd/tests/shell/ |
D | ShellSubscriber_test.cpp | 112 AStatsEvent* statsEvent = AStatsEvent_obtain(); in makeCpuActiveTimeAtom() local 113 AStatsEvent_setAtomId(statsEvent, CPU_ACTIVE_TIME); in makeCpuActiveTimeAtom() 114 AStatsEvent_overwriteTimestamp(statsEvent, kCpuActiveTimeEventTimestampNs); in makeCpuActiveTimeAtom() 115 AStatsEvent_writeInt32(statsEvent, uid); in makeCpuActiveTimeAtom() 116 AStatsEvent_writeInt64(statsEvent, timeMillis); in makeCpuActiveTimeAtom() 119 parseStatsEventToLogEvent(statsEvent, logEvent.get()); in makeCpuActiveTimeAtom()
|
/packages/apps/Launcher3/quickstep/src/com/android/launcher3/model/ |
D | QuickstepModelDelegate.java | 278 StatsEvent statsEvent = StatsLogCompatManager.buildStatsEvent(itemInfo, in registerSnapshotLoggingCallback() 280 eventList.add(statsEvent); in registerSnapshotLoggingCallback()
|