1 /* 2 * Copyright (C) 2024 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.pas; 18 19 import android.adservices.common.AdTechIdentifier; 20 21 import com.android.adservices.service.stats.AdsRelevanceStatusUtils; 22 23 public interface EncodingExecutionLogHelper { 24 /** Start the clock for timing the js execution. */ startClock()25 void startClock(); 26 27 /** Set the status of the JS run. */ setStatus(@dsRelevanceStatusUtils.JsRunStatus int status)28 void setStatus(@AdsRelevanceStatusUtils.JsRunStatus int status); 29 30 /** 31 * Log the adtech whose JS is being run. This could be made more efficient by passing the 32 * enrollment id around with the ETLD+1 instead of having to retrieve it every time. 33 */ setAdtech(AdTechIdentifier adtech)34 void setAdtech(AdTechIdentifier adtech); 35 36 /** 37 * Finish the timer, and log the metric if not already finished. If already finished, do 38 * nothing. 39 */ finish()40 void finish(); 41 } 42