• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.adservices.service.stats;
18 
19 import com.android.adservices.service.common.AppManifestConfigCall;
20 import com.android.adservices.service.common.AppManifestConfigHelper;
21 import com.android.adservices.service.stats.kanon.KAnonBackgroundJobStatusStats;
22 import com.android.adservices.service.stats.kanon.KAnonGetChallengeStatusStats;
23 import com.android.adservices.service.stats.kanon.KAnonImmediateSignJoinStatusStats;
24 import com.android.adservices.service.stats.kanon.KAnonInitializeStatusStats;
25 import com.android.adservices.service.stats.kanon.KAnonJoinStatusStats;
26 import com.android.adservices.service.stats.kanon.KAnonSignStatusStats;
27 import com.android.adservices.service.stats.pas.EncodingFetchStats;
28 import com.android.adservices.service.stats.pas.EncodingJobRunStats;
29 import com.android.adservices.service.stats.pas.EncodingJsExecutionStats;
30 import com.android.adservices.service.stats.pas.PersistAdSelectionResultCalledStats;
31 import com.android.adservices.service.stats.pas.UpdateSignalsApiCalledStats;
32 
33 /** Interface for Adservices logger. */
34 public interface AdServicesLogger {
35     /** log method for MeasurementReportsStats. */
logMeasurementReports(MeasurementReportsStats measurementReportsStats)36     void logMeasurementReports(MeasurementReportsStats measurementReportsStats);
37 
38     /** log ApiCallStats which has stats about the API call such as the status. */
logApiCallStats(ApiCallStats apiCallStats)39     void logApiCallStats(ApiCallStats apiCallStats);
40 
41     /** log UIStats which has stats about UI events. */
logUIStats(UIStats uiStats)42     void logUIStats(UIStats uiStats);
43 
44     /**
45      * Logs API call stats specific to the FLEDGE APIs as an {@link ApiCallStats} object with app
46      * package name, if enabled.
47      */
logFledgeApiCallStats(int apiName, String appPackageName, int resultCode, int latencyMs)48     void logFledgeApiCallStats(int apiName, String appPackageName, int resultCode, int latencyMs);
49 
50     /** Logs API call stats specific to the FLEDGE APIs as an {@link ApiCallStats} object. */
logFledgeApiCallStats(int apiName, int resultCode, int latencyMs)51     void logFledgeApiCallStats(int apiName, int resultCode, int latencyMs);
52 
53     /** Logs measurement registrations response size. */
logMeasurementRegistrationsResponseSize(MeasurementRegistrationResponseStats stats)54     void logMeasurementRegistrationsResponseSize(MeasurementRegistrationResponseStats stats);
55 
56     /**
57      * Logs the runAdSelection process stats as an {@link RunAdSelectionProcessReportedStats}
58      * object.
59      */
logRunAdSelectionProcessReportedStats(RunAdSelectionProcessReportedStats stats)60     void logRunAdSelectionProcessReportedStats(RunAdSelectionProcessReportedStats stats);
61 
62     /**
63      * Logs the runAdBidding process stats as an {@link RunAdBiddingProcessReportedStats} object.
64      */
logRunAdBiddingProcessReportedStats(RunAdBiddingProcessReportedStats stats)65     void logRunAdBiddingProcessReportedStats(RunAdBiddingProcessReportedStats stats);
66 
67     /**
68      * Logs the runAdScoring process stats as an {@link RunAdScoringProcessReportedStats} object.
69      */
logRunAdScoringProcessReportedStats(RunAdScoringProcessReportedStats stats)70     void logRunAdScoringProcessReportedStats(RunAdScoringProcessReportedStats stats);
71 
72     /**
73      * Logs the runAdBiddingPerCA process stats as an {@link RunAdBiddingPerCAProcessReportedStats}
74      * object.
75      */
logRunAdBiddingPerCAProcessReportedStats(RunAdBiddingPerCAProcessReportedStats stats)76     void logRunAdBiddingPerCAProcessReportedStats(RunAdBiddingPerCAProcessReportedStats stats);
77 
78     /**
79      * Logs the backgroundFetch process stats as an {@link BackgroundFetchProcessReportedStats}
80      * object.
81      */
logBackgroundFetchProcessReportedStats(BackgroundFetchProcessReportedStats stats)82     void logBackgroundFetchProcessReportedStats(BackgroundFetchProcessReportedStats stats);
83 
84     /**
85      * Logs the updateCustomAudience process stats as an {@link
86      * com.android.adservices.service.stats.UpdateCustomAudienceProcessReportedStats} objects.
87      */
logUpdateCustomAudienceProcessReportedStats( UpdateCustomAudienceProcessReportedStats stats)88     void logUpdateCustomAudienceProcessReportedStats(
89             UpdateCustomAudienceProcessReportedStats stats);
90 
91     /**
92      * Logs GetTopics API call stats as an {@link
93      * com.android.adservices.service.stats.GetTopicsReportedStats} object.
94      */
logGetTopicsReportedStats(GetTopicsReportedStats stats)95     void logGetTopicsReportedStats(GetTopicsReportedStats stats);
96 
97     /**
98      * Logs stats for getTopTopics as an {@link
99      * com.android.adservices.service.stats.EpochComputationGetTopTopicsStats} object.
100      */
logEpochComputationGetTopTopicsStats(EpochComputationGetTopTopicsStats stats)101     void logEpochComputationGetTopTopicsStats(EpochComputationGetTopTopicsStats stats);
102 
103     /**
104      * Logs classifier stats during epoch computation as an {@link
105      * com.android.adservices.service.stats.EpochComputationClassifierStats} object.
106      */
logEpochComputationClassifierStats(EpochComputationClassifierStats stats)107     void logEpochComputationClassifierStats(EpochComputationClassifierStats stats);
108 
109     /** Logs measurement debug keys stats. */
logMeasurementDebugKeysMatch(MsmtDebugKeysMatchStats stats)110     void logMeasurementDebugKeysMatch(MsmtDebugKeysMatchStats stats);
111 
112     /** Logs measurement AdID match for debug keys stats. */
logMeasurementAdIdMatchForDebugKeysStats(MsmtAdIdMatchForDebugKeysStats stats)113     void logMeasurementAdIdMatchForDebugKeysStats(MsmtAdIdMatchForDebugKeysStats stats);
114 
115     /** Logs measurement attribution stats. */
logMeasurementAttributionStats(MeasurementAttributionStats measurementAttributionStats)116     void logMeasurementAttributionStats(MeasurementAttributionStats measurementAttributionStats);
117 
118     /** Logs measurement wipeout stats. */
logMeasurementWipeoutStats(MeasurementWipeoutStats measurementWipeoutStats)119     void logMeasurementWipeoutStats(MeasurementWipeoutStats measurementWipeoutStats);
120 
121     /** Logs measurement delayed source registration stats. */
logMeasurementDelayedSourceRegistrationStats( MeasurementDelayedSourceRegistrationStats measurementDelayedSourceRegistrationStats)122     void logMeasurementDelayedSourceRegistrationStats(
123             MeasurementDelayedSourceRegistrationStats measurementDelayedSourceRegistrationStats);
124 
125     /** Logs measurement click verification stats. */
logMeasurementClickVerificationStats( MeasurementClickVerificationStats measurementClickVerificationStats)126     void logMeasurementClickVerificationStats(
127             MeasurementClickVerificationStats measurementClickVerificationStats);
128 
129     /** Logs measurement ODP registrations. */
logMeasurementOdpRegistrations(MeasurementOdpRegistrationStats stats)130     void logMeasurementOdpRegistrations(MeasurementOdpRegistrationStats stats);
131 
132     /** Logs measurement ODP API calls. */
logMeasurementOdpApiCall(MeasurementOdpApiCallStats stats)133     void logMeasurementOdpApiCall(MeasurementOdpApiCallStats stats);
134 
135     /** Logs enrollment data stats. */
logEnrollmentDataStats(int mType, boolean mIsSuccessful, int mBuildId)136     void logEnrollmentDataStats(int mType, boolean mIsSuccessful, int mBuildId);
137 
138     /** Logs enrollment matching stats. */
logEnrollmentMatchStats(boolean mIsSuccessful, int mBuildId)139     void logEnrollmentMatchStats(boolean mIsSuccessful, int mBuildId);
140 
141     /** Logs enrollment file download stats. */
logEnrollmentFileDownloadStats(boolean mIsSuccessful, int mBuildId)142     void logEnrollmentFileDownloadStats(boolean mIsSuccessful, int mBuildId);
143 
144     /** Logs enrollment failure stats. */
logEnrollmentFailedStats( int mBuildId, int mDataFileGroupStatus, int mEnrollmentRecordCountInTable, String mQueryParameter, int mErrorCause)145     void logEnrollmentFailedStats(
146             int mBuildId,
147             int mDataFileGroupStatus,
148             int mEnrollmentRecordCountInTable,
149             String mQueryParameter,
150             int mErrorCause);
151 
152     /** Logs enrollment transaction stats. */
logEnrollmentTransactionStats(AdServicesEnrollmentTransactionStats stats)153     void logEnrollmentTransactionStats(AdServicesEnrollmentTransactionStats stats);
154 
155     /** Logs encryption key fetch stats. */
logEncryptionKeyFetchedStats(AdServicesEncryptionKeyFetchedStats stats)156     void logEncryptionKeyFetchedStats(AdServicesEncryptionKeyFetchedStats stats);
157 
158     /** Logs encryption key datastore transaction ended stats. */
logEncryptionKeyDbTransactionEndedStats( AdServicesEncryptionKeyDbTransactionEndedStats stats)159     void logEncryptionKeyDbTransactionEndedStats(
160             AdServicesEncryptionKeyDbTransactionEndedStats stats);
161 
162     /** Logs destinationRegisteredBeacon reported stats. */
logDestinationRegisteredBeaconsReportedStats( DestinationRegisteredBeaconsReportedStats stats)163     void logDestinationRegisteredBeaconsReportedStats(
164             DestinationRegisteredBeaconsReportedStats stats);
165 
166     /** Logs beacon level reporting for ReportInteraction API called stats. */
logReportInteractionApiCalledStats(ReportInteractionApiCalledStats stats)167     void logReportInteractionApiCalledStats(ReportInteractionApiCalledStats stats);
168 
169     /** Logs beacon level reporting for clearing interaction reporting table stats. */
logInteractionReportingTableClearedStats(InteractionReportingTableClearedStats stats)170     void logInteractionReportingTableClearedStats(InteractionReportingTableClearedStats stats);
171 
172     /** Logs call to {@link AppManifestConfigHelper} to check if app is allowed to access an API. */
logAppManifestConfigCall(AppManifestConfigCall call)173     void logAppManifestConfigCall(AppManifestConfigCall call);
174 
175     /** Logs status for {@link com.android.adservices.service.kanon.KAnonSignJoinManager}. */
logKAnonSignJoinStatus()176     void logKAnonSignJoinStatus();
177 
178     /**
179      * Logs status for initialize method for {@link
180      * com.android.adservices.service.kanon.KAnonCaller}.
181      */
logKAnonInitializeStats(KAnonInitializeStatusStats kAnonInitializeStatusStats)182     void logKAnonInitializeStats(KAnonInitializeStatusStats kAnonInitializeStatusStats);
183 
184     /** Logs status for sign method for {@link com.android.adservices.service.kanon.KAnonCaller */
logKAnonSignStats(KAnonSignStatusStats kAnonSignStatusStats)185     void logKAnonSignStats(KAnonSignStatusStats kAnonSignStatusStats);
186 
187     /** Logs status for join method for {@link com.android.adservices.service.kanon.KAnonCaller} */
logKAnonJoinStats(KAnonJoinStatusStats kAnonJoinStatusStats)188     void logKAnonJoinStats(KAnonJoinStatusStats kAnonJoinStatusStats);
189 
190     /**
191      * Logs status for {@link
192      * com.android.adservices.service.kanon.KAnonSignJoinBackgroundJobService}
193      */
logKAnonBackgroundJobStats(KAnonBackgroundJobStatusStats kAnonBackgroundJobStatusStats)194     void logKAnonBackgroundJobStats(KAnonBackgroundJobStatusStats kAnonBackgroundJobStatusStats);
195 
196     /**
197      * Logs status for immediate sign join in {@link
198      * com.android.adservices.service.kanon.KAnonSignJoinManager}
199      */
logKAnonImmediateSignJoinStats( KAnonImmediateSignJoinStatusStats kAnonImmediateSignJoinStatusStats)200     void logKAnonImmediateSignJoinStats(
201             KAnonImmediateSignJoinStatusStats kAnonImmediateSignJoinStatusStats);
202 
203     /** Logs status for get challenge method during kAnon sign join process. */
logKAnonGetChallengeJobStats(KAnonGetChallengeStatusStats kAnonGetChallengeStatusStats)204     void logKAnonGetChallengeJobStats(KAnonGetChallengeStatusStats kAnonGetChallengeStatusStats);
205 
206     /** Logs stats for GetAdSelectionDataApiCalled */
logGetAdSelectionDataApiCalledStats(GetAdSelectionDataApiCalledStats stats)207     void logGetAdSelectionDataApiCalledStats(GetAdSelectionDataApiCalledStats stats);
208 
209     /** Logs stats for GetAdSelectionDataBuyerInputGenerated */
logGetAdSelectionDataBuyerInputGeneratedStats( GetAdSelectionDataBuyerInputGeneratedStats stats)210     void logGetAdSelectionDataBuyerInputGeneratedStats(
211             GetAdSelectionDataBuyerInputGeneratedStats stats);
212 
213     /** Logs AdFilteringProcessJoinCAReported stats. */
logAdFilteringProcessJoinCAReportedStats(AdFilteringProcessJoinCAReportedStats stats)214     void logAdFilteringProcessJoinCAReportedStats(AdFilteringProcessJoinCAReportedStats stats);
215 
216     /** Logs AdFilteringProcessAdSelectionReported stats. */
logAdFilteringProcessAdSelectionReportedStats( AdFilteringProcessAdSelectionReportedStats stats)217     void logAdFilteringProcessAdSelectionReportedStats(
218             AdFilteringProcessAdSelectionReportedStats stats);
219 
220     /** Logs AdCounterHistogramUpdaterReported stats. */
logAdCounterHistogramUpdaterReportedStats(AdCounterHistogramUpdaterReportedStats stats)221     void logAdCounterHistogramUpdaterReportedStats(AdCounterHistogramUpdaterReportedStats stats);
222 
223     /** Logs TopicsEncryptionEpochComputationReported stats. */
logTopicsEncryptionEpochComputationReportedStats( TopicsEncryptionEpochComputationReportedStats stats)224     void logTopicsEncryptionEpochComputationReportedStats(
225             TopicsEncryptionEpochComputationReportedStats stats);
226 
227     /** Logs TopicsEncryptionGetTopicsReported stats */
logTopicsEncryptionGetTopicsReportedStats( TopicsEncryptionGetTopicsReportedStats stats)228     void logTopicsEncryptionGetTopicsReportedStats(
229             TopicsEncryptionGetTopicsReportedStats stats);
230 
231     /** Logs stats for shell command indicating success/failure, latency. */
logShellCommandStats(ShellCommandStats stats)232     void logShellCommandStats(ShellCommandStats stats);
233 
234     /**
235      * Logs stats for signature verification for {@link
236      * android.adservices.adselection.SignedContextualAds} during on-device ad selection auction
237      */
logSignatureVerificationStats(SignatureVerificationStats stats)238     void logSignatureVerificationStats(SignatureVerificationStats stats);
239 
240     /** Logs stats for EncodingFetchStats */
logEncodingJsFetchStats(EncodingFetchStats stats)241     void logEncodingJsFetchStats(EncodingFetchStats stats);
242 
243     /** Logs stats for UpdateSignalsApiCalledStats */
logUpdateSignalsApiCalledStats(UpdateSignalsApiCalledStats stats)244     void logUpdateSignalsApiCalledStats(UpdateSignalsApiCalledStats stats);
245 
246     /** Logs stats for ServerAuctionBackgroundKeyFetchScheduled */
logServerAuctionBackgroundKeyFetchScheduledStats( ServerAuctionBackgroundKeyFetchScheduledStats stats)247     void logServerAuctionBackgroundKeyFetchScheduledStats(
248             ServerAuctionBackgroundKeyFetchScheduledStats stats);
249 
250     /** Logs stats for UpdateSignalsApiCalledStats */
logEncodingJsExecutionStats(EncodingJsExecutionStats stats)251     void logEncodingJsExecutionStats(EncodingJsExecutionStats stats);
252 
253     /** Logs stats for ServerAuctionKeyFetchCalled */
logServerAuctionKeyFetchCalledStats(ServerAuctionKeyFetchCalledStats stats)254     void logServerAuctionKeyFetchCalledStats(ServerAuctionKeyFetchCalledStats stats);
255 
256     /** Logs stats for EncodingJobRunStats */
logEncodingJobRunStats(EncodingJobRunStats stats)257     void logEncodingJobRunStats(EncodingJobRunStats stats);
258 
259     /** Logs stats for PersistAdSelectionResultCalledStats */
logPersistAdSelectionResultCalledStats(PersistAdSelectionResultCalledStats stats)260     void logPersistAdSelectionResultCalledStats(PersistAdSelectionResultCalledStats stats);
261 
262     /** Logs stats for SelectAdsFromOutcomesApiCalledStats */
logSelectAdsFromOutcomesApiCalledStats(SelectAdsFromOutcomesApiCalledStats stats)263     void logSelectAdsFromOutcomesApiCalledStats(SelectAdsFromOutcomesApiCalledStats stats);
264 
265     /** Logs stats for ReportImpressionApiCalledStats */
logReportImpressionApiCalledStats(ReportImpressionApiCalledStats stats)266     void logReportImpressionApiCalledStats(ReportImpressionApiCalledStats stats);
267 }
268