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; 18 19 import com.google.auto.value.AutoValue; 20 21 /** 22 * Class for recording Custom Audience Update stats from a background job. This records information 23 * about how many updates were found and how many were successfully processed. 24 */ 25 @AutoValue 26 public abstract class ScheduledCustomAudienceUpdateBackgroundJobStats { 27 28 /** 29 * Returns the number of scheduled Custom Audience updates that were found to be performed by 30 * the background job. 31 */ getNumberOfUpdatesFound()32 public abstract int getNumberOfUpdatesFound(); 33 34 /** 35 * Returns the number of scheduled Custom Audience updates that were successfully performed by 36 * the background job. 37 */ getNumberOfSuccessfulUpdates()38 public abstract int getNumberOfSuccessfulUpdates(); 39 40 /** 41 * Returns a new builder for creating an instance of {@link 42 * ScheduledCustomAudienceUpdateBackgroundJobStats}. 43 */ builder()44 public static Builder builder() { 45 return new AutoValue_ScheduledCustomAudienceUpdateBackgroundJobStats.Builder(); 46 } 47 48 /** Builder for {@link ScheduledCustomAudienceUpdateBackgroundJobStats} objects. */ 49 @AutoValue.Builder 50 public abstract static class Builder { 51 /** Sets the number of scheduled Custom Audience updates that were found to be performed. */ setNumberOfUpdatesFound(int value)52 public abstract Builder setNumberOfUpdatesFound(int value); 53 54 /** 55 * Sets the number of scheduled Custom Audience updates that were successfully performed. 56 */ setNumberOfSuccessfulUpdates(int value)57 public abstract Builder setNumberOfSuccessfulUpdates(int value); 58 59 /** 60 * Returns a new {@link ScheduledCustomAudienceUpdateBackgroundJobStats} instance built from 61 * the values set on this builder. 62 */ build()63 public abstract ScheduledCustomAudienceUpdateBackgroundJobStats build(); 64 } 65 } 66