1 /*
2  * Copyright (C) 2022 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 backgroundFetch process reported stats. */
22 @AutoValue
23 public abstract class BackgroundFetchProcessReportedStats {
24     /** @return latency in milliseconds. */
getLatencyInMillis()25     public abstract int getLatencyInMillis();
26 
27     /** @return num of eligible-to-update CAs. */
getNumOfEligibleToUpdateCas()28     public abstract int getNumOfEligibleToUpdateCas();
29 
30     /** @return background fetch process result code. */
getResultCode()31     public abstract int getResultCode();
32 
33     /** @return generic builder. */
builder()34     static Builder builder() {
35         return new AutoValue_BackgroundFetchProcessReportedStats.Builder();
36     }
37 
38     /** Builder class for {@link BackgroundFetchProcessReportedStats} object. */
39     @AutoValue.Builder
40     abstract static class Builder {
41 
setLatencyInMillis(int value)42         abstract Builder setLatencyInMillis(int value);
43 
setNumOfEligibleToUpdateCas(int value)44         abstract Builder setNumOfEligibleToUpdateCas(int value);
45 
setResultCode(int value)46         abstract Builder setResultCode(int value);
47 
build()48         abstract BackgroundFetchProcessReportedStats build();
49     }
50 }
51