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 com.android.adservices.service.stats.AdsRelevanceStatusUtils; 20 21 import com.google.auto.value.AutoValue; 22 23 /** Class for logging per encoding background job run stats. */ 24 @AutoValue 25 public abstract class EncodingJobRunStats { 26 /** Returns the number of AdTechs who successfully encoded in this background job run. */ getSignalEncodingSuccesses()27 public abstract int getSignalEncodingSuccesses(); 28 29 /** Returns the number of AdTechs who failed to encoded in this background job run. */ getSignalEncodingFailures()30 public abstract int getSignalEncodingFailures(); 31 32 /** Returns the number of AdTechs skipped due to their signals being unmodified. */ getSignalEncodingSkips()33 public abstract int getSignalEncodingSkips(); 34 35 /** Returns the PAS encoding source type. */ getEncodingSourceType()36 public abstract int getEncodingSourceType(); 37 38 /** Returns generic builder. */ builder()39 public static Builder builder() { 40 return new AutoValue_EncodingJobRunStats.Builder() 41 .setEncodingSourceType(AdsRelevanceStatusUtils.PAS_ENCODING_SOURCE_TYPE_UNSET); 42 } 43 44 /** Builder class for EncodingJobRunStats. */ 45 @AutoValue.Builder 46 public abstract static class Builder { setSignalEncodingSuccesses(int value)47 public abstract Builder setSignalEncodingSuccesses(int value); 48 setSignalEncodingFailures(int value)49 public abstract Builder setSignalEncodingFailures(int value); 50 setSignalEncodingSkips(int value)51 public abstract Builder setSignalEncodingSkips(int value); 52 setEncodingSourceType( @dsRelevanceStatusUtils.PasEncodingSourceType int encodingSourceType)53 public abstract Builder setEncodingSourceType( 54 @AdsRelevanceStatusUtils.PasEncodingSourceType int encodingSourceType); 55 build()56 public abstract EncodingJobRunStats build(); 57 } 58 } 59