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 Topics encryption during epoch computation. */
22 @AutoValue
23 public abstract class TopicsEncryptionEpochComputationReportedStats {
24     /** Returns number of topics before encryption during epoch computation process. */
getCountOfTopicsBeforeEncryption()25     public abstract int getCountOfTopicsBeforeEncryption();
26 
27     /** Returns number of empty encrypted topics during epoch computation process. */
getCountOfEmptyEncryptedTopics()28     public abstract int getCountOfEmptyEncryptedTopics();
29 
30     /** Returns number of encrypted topics during epoch computation process. */
getCountOfEncryptedTopics()31     public abstract int getCountOfEncryptedTopics();
32 
33     /** Returns the latency in milliseconds of the whole encryption process
34      * during epoch computation. */
getLatencyOfWholeEncryptionProcessMs()35     public abstract int getLatencyOfWholeEncryptionProcessMs();
36 
37     /** Returns the latency in milliseconds of encryption of each topic. */
getLatencyOfEncryptionPerTopicMs()38     public abstract int getLatencyOfEncryptionPerTopicMs();
39 
40     /** Returns the latency in milliseconds of persisting encrypted topics to database
41      * during epoch computation. */
getLatencyOfPersistingEncryptedTopicsToDbMs()42     public abstract int getLatencyOfPersistingEncryptedTopicsToDbMs();
43 
44     /** Returns generic builder. */
builder()45     public static Builder builder() {
46         return new AutoValue_TopicsEncryptionEpochComputationReportedStats.Builder();
47     }
48 
49     /** Builder class for TopicsEncryptionEpochComputationReportedStats. */
50     @AutoValue.Builder
51     public abstract static class Builder {
setCountOfTopicsBeforeEncryption(int value)52         public abstract Builder setCountOfTopicsBeforeEncryption(int value);
53 
setCountOfEmptyEncryptedTopics(int value)54         public abstract Builder setCountOfEmptyEncryptedTopics(int value);
55 
setCountOfEncryptedTopics(int value)56         public abstract Builder setCountOfEncryptedTopics(int value);
57 
setLatencyOfWholeEncryptionProcessMs(int value)58         public abstract Builder setLatencyOfWholeEncryptionProcessMs(int value);
59 
setLatencyOfEncryptionPerTopicMs(int value)60         public abstract Builder setLatencyOfEncryptionPerTopicMs(int value);
61 
setLatencyOfPersistingEncryptedTopicsToDbMs(int value)62         public abstract Builder setLatencyOfPersistingEncryptedTopicsToDbMs(int value);
63 
build()64         public abstract TopicsEncryptionEpochComputationReportedStats build();
65     }
66 }
67