• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 updateSignals API process reported stats. */
24 @AutoValue
25 public abstract class UpdateSignalsProcessReportedStats {
26     /** Returns the updated signals process latency in milliseconds for this API call. */
getUpdateSignalsProcessLatencyMillis()27     public abstract int getUpdateSignalsProcessLatencyMillis();
28 
29     /** Returns the Adservices API status code for this API call. */
getAdservicesApiStatusCode()30     public abstract int getAdservicesApiStatusCode();
31 
32     /** Returns the number of signals written for this API call. */
getSignalsWrittenCount()33     public abstract int getSignalsWrittenCount();
34 
35     /** Returns the number of keys from downloaded JSON for this API call. */
getKeysStoredCount()36     public abstract int getKeysStoredCount();
37 
38     /** Returns the number of values from downloaded JSON when calling PAS API. */
getValuesStoredCount()39     public abstract int getValuesStoredCount();
40 
41     /** Returns the number of eviction rules for this API call. */
getEvictionRulesCount()42     public abstract int getEvictionRulesCount();
43 
44     /** Returns the bucketed size of the buyer who called the APIs signals. */
45     @AdsRelevanceStatusUtils.Size
getPerBuyerSignalSize()46     public abstract int getPerBuyerSignalSize();
47 
48     /**
49      * Returns the average size, in bytes, of raw protected signals being updated for the buyer
50      * performing the update.
51      */
getMeanRawProtectedSignalsSizeBytes()52     public abstract float getMeanRawProtectedSignalsSizeBytes();
53 
54     /** Returns the size, in bytes, of the largest raw protected signal stored by the caller. */
getMaxRawProtectedSignalsSizeBytes()55     public abstract float getMaxRawProtectedSignalsSizeBytes();
56 
57     /** Returns the size, in bytes, of the smallest raw protected signal stored by the caller. */
getMinRawProtectedSignalsSizeBytes()58     public abstract float getMinRawProtectedSignalsSizeBytes();
59 
60     /** Returns a generic builder. */
builder()61     public static Builder builder() {
62         return new AutoValue_UpdateSignalsProcessReportedStats.Builder();
63     }
64 
65     /** Builder class for UpdateSignalsProcessReported. */
66     @AutoValue.Builder
67     public abstract static class Builder {
68         /** Sets the updated signals process latency in milliseconds for this API call. */
setUpdateSignalsProcessLatencyMillis(int value)69         public abstract Builder setUpdateSignalsProcessLatencyMillis(int value);
70 
71         /** Sets the Adservices API status code for this API call. */
setAdservicesApiStatusCode(int value)72         public abstract Builder setAdservicesApiStatusCode(int value);
73 
74         /** Sets the number of signals written for this API call. */
setSignalsWrittenCount(int value)75         public abstract Builder setSignalsWrittenCount(int value);
76 
77         /** Sets the number of keys from downloaded JSON for this API call. */
setKeysStoredCount(int value)78         public abstract Builder setKeysStoredCount(int value);
79 
80         /** Sets the number of values from downloaded JSON for this API call. */
setValuesStoredCount(int value)81         public abstract Builder setValuesStoredCount(int value);
82 
83         /** Sets the number of eviction rules for this API call. */
setEvictionRulesCount(int value)84         public abstract Builder setEvictionRulesCount(int value);
85 
86         /** Sets the bucketed size of the buyer who called the APIs signals. */
setPerBuyerSignalSize(@dsRelevanceStatusUtils.Size int value)87         public abstract Builder setPerBuyerSignalSize(@AdsRelevanceStatusUtils.Size int value);
88 
89         /**
90          * Sets the average size, in bytes, of raw protected signals being updated for the buyer
91          * performing the update.
92          */
setMeanRawProtectedSignalsSizeBytes(float value)93         public abstract Builder setMeanRawProtectedSignalsSizeBytes(float value);
94 
95         /** Sets the size, in bytes, of the largest raw protected signal stored by the caller. */
setMaxRawProtectedSignalsSizeBytes(float value)96         public abstract Builder setMaxRawProtectedSignalsSizeBytes(float value);
97 
98         /** Sets the size, in bytes, of the smallest raw protected signal stored by the caller. */
setMinRawProtectedSignalsSizeBytes(float value)99         public abstract Builder setMinRawProtectedSignalsSizeBytes(float value);
100 
101         /** Build the {@link UpdateSignalsProcessReportedStats}. */
build()102         public abstract UpdateSignalsProcessReportedStats build();
103     }
104 }
105