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 /** Class for logging Ad filtering process during join CA. */ 22 @AutoValue 23 public abstract class AdFilteringProcessJoinCAReportedStats { 24 /** Returns the status response code in AdServices. */ getStatusCode()25 public abstract int getStatusCode(); 26 27 /** 28 * Returns the total number of Ads using keys less than the maximum number of keys limitation. 29 */ getCountOfAdsWithKeysMuchSmallerThanLimitation()30 public abstract int getCountOfAdsWithKeysMuchSmallerThanLimitation(); 31 32 /** 33 * Returns the total number of Ads using keys are equal or greater than 50% maximum number of 34 * keys limitation but smaller than maximum number of keys limitation. 35 */ getCountOfAdsWithKeysSmallerThanLimitation()36 public abstract int getCountOfAdsWithKeysSmallerThanLimitation(); 37 38 /** 39 * Returns the total number of Ads using keys are equal to maximum number of keys limitation. 40 */ getCountOfAdsWithKeysEqualToLimitation()41 public abstract int getCountOfAdsWithKeysEqualToLimitation(); 42 43 /** 44 * Returns the total number of Ads using keys greater than the maximum number of keys 45 * limitation. 46 */ getCountOfAdsWithKeysLargerThanLimitation()47 public abstract int getCountOfAdsWithKeysLargerThanLimitation(); 48 49 /** Returns the total number of Ads using empty keys. */ getCountOfAdsWithEmptyKeys()50 public abstract int getCountOfAdsWithEmptyKeys(); 51 52 /** 53 * Returns the total number of Ads using filters less than the maximum number of filters 54 * limitation. 55 */ getCountOfAdsWithFiltersMuchSmallerThanLimitation()56 public abstract int getCountOfAdsWithFiltersMuchSmallerThanLimitation(); 57 58 /** 59 * Returns the total number of Ads using filters are equal or greater than 50% maximum number of 60 * filters limitation but smaller than maximum number of filters limitation. 61 */ getCountOfAdsWithFiltersSmallerThanLimitation()62 public abstract int getCountOfAdsWithFiltersSmallerThanLimitation(); 63 64 /** 65 * Returns the total number of Ads using filters are equal to maximum number of filters 66 * limitation. 67 */ getCountOfAdsWithFiltersEqualToLimitation()68 public abstract int getCountOfAdsWithFiltersEqualToLimitation(); 69 70 /** 71 * Returns the total number of Ads using filters greater than the maximum number of filters 72 * limitation. 73 */ getCountOfAdsWithFiltersLargerThanLimitation()74 public abstract int getCountOfAdsWithFiltersLargerThanLimitation(); 75 76 /** Returns the total number of Ads using empty filters. */ getCountOfAdsWithEmptyFilters()77 public abstract int getCountOfAdsWithEmptyFilters(); 78 79 /** Returns the total number of used Ad filtering keys per custom audience. */ getTotalNumberOfUsedKeys()80 public abstract int getTotalNumberOfUsedKeys(); 81 82 /** Returns the total number of used Ad filters per custom audience. */ getTotalNumberOfUsedFilters()83 public abstract int getTotalNumberOfUsedFilters(); 84 85 /** 86 * @return generic builder 87 */ builder()88 public static Builder builder() { 89 return new AutoValue_AdFilteringProcessJoinCAReportedStats.Builder(); 90 } 91 92 /** Builder class for AdFilteringProcessJoinCAReportedStats. */ 93 @AutoValue.Builder 94 public abstract static class Builder { 95 /** Sets the status response code in AdServices. */ setStatusCode(int value)96 public abstract Builder setStatusCode(int value); 97 98 /** 99 * Sets the total number of Ads using keys less than the maximum number of keys limitation. 100 */ setCountOfAdsWithKeysMuchSmallerThanLimitation(int value)101 public abstract Builder setCountOfAdsWithKeysMuchSmallerThanLimitation(int value); 102 103 /** 104 * Sets the total number of Ads using keys are equal or greater than 50% maximum number of 105 * keys limitation but smaller than maximum number of keys limitation. 106 */ setCountOfAdsWithKeysSmallerThanLimitation(int value)107 public abstract Builder setCountOfAdsWithKeysSmallerThanLimitation(int value); 108 109 /** 110 * Sets the total number of Ads using keys are equal to maximum number of keys limitation. 111 */ setCountOfAdsWithKeysEqualToLimitation(int value)112 public abstract Builder setCountOfAdsWithKeysEqualToLimitation(int value); 113 114 /** 115 * Sets the total number of Ads using keys greater than the maximum number of keys 116 * limitation. 117 */ setCountOfAdsWithKeysLargerThanLimitation(int value)118 public abstract Builder setCountOfAdsWithKeysLargerThanLimitation(int value); 119 120 /** Sets the total number of Ads using empty keys. */ setCountOfAdsWithEmptyKeys(int value)121 public abstract Builder setCountOfAdsWithEmptyKeys(int value); 122 123 /** 124 * Sets the total number of Ads using filters less than the maximum number of filters 125 * limitation. 126 */ setCountOfAdsWithFiltersMuchSmallerThanLimitation(int value)127 public abstract Builder setCountOfAdsWithFiltersMuchSmallerThanLimitation(int value); 128 129 /** 130 * Sets the total number of Ads using filters are equal or greater than 50% maximum number 131 * of filters limitation but smaller than maximum number of filters limitation. 132 */ setCountOfAdsWithFiltersSmallerThanLimitation(int value)133 public abstract Builder setCountOfAdsWithFiltersSmallerThanLimitation(int value); 134 135 /** 136 * Sets the total number of Ads using filters are equal to maximum number of filters 137 * limitation. 138 */ setCountOfAdsWithFiltersEqualToLimitation(int value)139 public abstract Builder setCountOfAdsWithFiltersEqualToLimitation(int value); 140 141 /** 142 * Sets the total number of Ads using filters greater than the maximum number of filters 143 * limitation. 144 */ setCountOfAdsWithFiltersLargerThanLimitation(int value)145 public abstract Builder setCountOfAdsWithFiltersLargerThanLimitation(int value); 146 147 /** Sets the total number of Ads using empty filters. */ setCountOfAdsWithEmptyFilters(int value)148 public abstract Builder setCountOfAdsWithEmptyFilters(int value); 149 150 /** Returns the total number of used Ad filtering keys per custom audience. */ setTotalNumberOfUsedKeys(int value)151 public abstract Builder setTotalNumberOfUsedKeys(int value); 152 153 /** Sets the total number of used Ad filters per custom audience. */ setTotalNumberOfUsedFilters(int value)154 public abstract Builder setTotalNumberOfUsedFilters(int value); 155 156 /** Returns an instance of {@link AdFilteringProcessJoinCAReportedStats} */ build()157 public abstract AdFilteringProcessJoinCAReportedStats build(); 158 } 159 } 160