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.kanon;
18 
19 import com.google.auto.value.AutoValue;
20 
21 @AutoValue
22 public abstract class KAnonJoinStatusStats {
23     /** A boolean representing if the sign call was successful. */
getWasSuccessful()24     public abstract boolean getWasSuccessful();
25 
26     /** Total number of messages that were processed. */
getTotalMessages()27     public abstract int getTotalMessages();
28 
29     /** Total number of failed messages. */
getNumberOfFailedMessages()30     public abstract int getNumberOfFailedMessages();
31 
32     /** Latency for the KAnon join method. */
getLatencyInMs()33     public abstract int getLatencyInMs();
34 
35     /** Returns a {@link Builder} class for {@link KAnonJoinStatusStats}. */
builder()36     public static Builder builder() {
37         return new AutoValue_KAnonJoinStatusStats.Builder().setLatencyInMs(100);
38     }
39 
40     @AutoValue.Builder
41     public abstract static class Builder {
42 
43         /** Sets the wasSuccessful field. */
setWasSuccessful(boolean wasSuccessful)44         public abstract Builder setWasSuccessful(boolean wasSuccessful);
45 
46         /** Sets the totalMessages field. */
setTotalMessages(int totalMessages)47         public abstract Builder setTotalMessages(int totalMessages);
48 
49         /** Sets the numberOfFailedMessages field. */
setNumberOfFailedMessages(int numberOfFailedMessages)50         public abstract Builder setNumberOfFailedMessages(int numberOfFailedMessages);
51 
52         /** Sets the latency for the kanon method. */
setLatencyInMs(int latencyInMs)53         public abstract Builder setLatencyInMs(int latencyInMs);
54 
55         /** Creates and returns a {@link KAnonJoinStatusStats} object. */
build()56         public abstract KAnonJoinStatusStats build();
57     }
58 }
59