File: private_computing_service.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (113 lines) | stat: -rw-r--r-- 4,113 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";
option optimize_for = LITE_RUNTIME;

package private_computing;

// Use-cases for ChromeOS Private Computing Device Active.
enum PrivateComputingUseCase {
  // Should not be used.
  USE_CASE_UNSPECIFIED = 0;
  CROS_FRESNEL_DAILY = 1;
  CROS_FRESNEL_FIRST_ACTIVE = 2;
  CROS_FRESNEL_28DAY_ACTIVE = 3;
  CROS_FRESNEL_CHURN_MONTHLY_COHORT = 4;
  CROS_FRESNEL_CHURN_MONTHLY_OBSERVATION = 5;
}

// The observation statuses for the past three period and it will have
// three observation periods will be overlapped.
// Because the observation period has three months, the current period
// means when the current month is the first month of this observation
// period. For example, if current month is Jan., the current observation
// period is Jan - Mar. And the current period minus 1 is Dec - Feb, the
// current period minus 2 is Nov - Jan.
message ChurnObservationStatus {
  // The period status of current month is the first month of the period.
  optional bool is_active_current_period_minus_0 = 1;
  // The period status of current month is the second month of the period.
  optional bool is_active_current_period_minus_1 = 2;
  // The period  status of current month is the third month of the period.
  optional bool is_active_current_period_minus_2 = 3;

  // Add deduplication field to fix device ping double-counting.
  // This field is used by analysts to determine which observation ping
  // was the first to attach the first active week and last powerwash
  // week on a given device when determining new device churn.
  optional bool is_first_powerwash_in_observation_period = 4;
}

// The preserved file will include the Daily, FirstActive, 28-Day
message ActiveStatus {
  // The use case of ChromeOS device active Private Computing device active.
  optional PrivateComputingUseCase use_case = 1;

  // This field is deprecated and for migration to PDT dates.
  optional string last_ping_utc_date = 2 [deprecated = true];

  oneof ping_date_or_status {
    // The last ping date for current use case.
    // PDT date: YYYYMMDD
    string last_ping_date = 3;
    // This field is only used for Observation Use Case which represents
    // the statuses of the last three observation periods.
    ChurnObservationStatus period_status = 4;
  }

  // The 28 bits value of churn active status for past 18 months.
  // The left 10 bits represent the number of months since Jan. 2020.
  // The right 18 bits represet the device churn cohort active status
  // for the past 18 months (1 is active, 0 is not active).
  optional int32 churn_active_status = 5;
}

message SaveStatusRequest {
  // The list of use case with last ping date.
  repeated ActiveStatus active_status = 1;
}

message SaveStatusResponse {
  // Error message, empty if no error occurred.
  optional string error_message = 1;
}

message GetStatusResponse {
  // This field only has error message, the success value will be
  // in active_status.
  optional string error_message = 1;

  // The list of use case with last ping date.
  repeated ActiveStatus active_status = 2;
}

// The regression test data consists of multiple test cases.
message PrivateComputingClientRegressionTestData {
  enum TestName {
    GET_SUCCESS_SAVE_SUCCESS = 0;
    GET_SUCCESS_SAVE_FAIL = 1;
    GET_FAIL_SAVE_SUCCESS = 2;
    GET_FAIL_SAVE_FAIL = 3;
    GET_SUCCESS_FUTURE_PING_DATE_SAVE_SUCCESS = 4;
    GET_SUCCESS_SAME_PING_DATE_SAVE_SUCCESS = 5;
    GET_SUCCESS_PAST_PING_DATE_SAVE_SUCCESS = 6;
    GET_SUCCESS_UNIX_EPOCH_PING_DATE_SAVE_SUCCESS = 7;
    GET_INVALID_PING_DATE_SAVE_SUCCESS = 8;
  }

  // Data stored for each test case.
  message TestCase {
    // Name of the test case
    required TestName name = 1;

    // Expected GetStatusResponse to be supplied by the client.
    optional GetStatusResponse get_response = 2;

    // Expected SaveStatusResponse to be supplied by the client.
    optional SaveStatusResponse save_response = 4;
  }

  repeated TestCase test_cases = 1;
}