| 1 |
// Copyright 2024 Google LLC |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
syntax = "proto3"; |
| 16 |
|
| 17 |
package google.pubsub.loadtest; |
| 18 |
|
| 19 |
import "google/protobuf/duration.proto"; |
| 20 |
import "google/protobuf/timestamp.proto"; |
| 21 |
|
| 22 |
option go_package = "cloud.google.com/go/pubsub/loadtest/pb;google_pubsub_loadtest"; |
| 23 |
|
| 24 |
service LoadtestWorker { |
| 25 |
// Starts a worker |
| 26 |
rpc Start (StartRequest) returns (StartResponse); |
| 27 |
|
| 28 |
// Check the status of a load test worker. |
| 29 |
rpc Check (CheckRequest) returns (CheckResponse); |
| 30 |
} |
| 31 |
|
| 32 |
message StartRequest { |
| 33 |
// The GCP project. |
| 34 |
string project = 1; |
| 35 |
|
| 36 |
// The Pub/Sub topic name. |
| 37 |
string topic = 2; |
| 38 |
|
| 39 |
// The time at which the load test should start. If this is less than the current time, we start immediately. |
| 40 |
google.protobuf.Timestamp start_time = 3; |
| 41 |
|
| 42 |
// The duration the load test should run for. |
| 43 |
google.protobuf.Duration test_duration = 4; |
| 44 |
|
| 45 |
// Whether to include ids in check responses. |
| 46 |
bool include_ids = 5; |
| 47 |
|
| 48 |
oneof options { |
| 49 |
PubsubOptions pubsub_options = 6; |
| 50 |
} |
| 51 |
|
| 52 |
oneof client_options { |
| 53 |
PublisherOptions publisher_options = 8; |
| 54 |
SubscriberOptions subscriber_options = 9; |
| 55 |
} |
| 56 |
|
| 57 |
// The cpu scaling of the worker. A multiple of the number of logical processors |
| 58 |
// on the machine. The number of threads for the worker is calculated by |
| 59 |
// max((numCpus * cpu_scaling), 1) for languages which use thread parallelism. |
| 60 |
// Languages which use process parallelism ignore this setting. |
| 61 |
int32 cpu_scaling = 10; |
| 62 |
} |
| 63 |
|
| 64 |
message StartResponse { |
| 65 |
} |
| 66 |
|
| 67 |
message PublisherOptions { |
| 68 |
// The max messages-per-second publishing rate. If unset, no rate limit will |
| 69 |
// be imposed. |
| 70 |
float rate = 1; |
| 71 |
// The max duration for coalescing a batch of published messages. |
| 72 |
google.protobuf.Duration batch_duration = 2; |
| 73 |
// The number of user messages of size message_size to publish together. |
| 74 |
int32 batch_size = 3; |
| 75 |
// The size in bytes of messages to publish |
| 76 |
int32 message_size = 4; |
| 77 |
} |
| 78 |
|
| 79 |
message SubscriberOptions { |
| 80 |
} |
| 81 |
|
| 82 |
message PubsubOptions { |
| 83 |
// The Cloud Pub/Sub subscription name |
| 84 |
string subscription = 1; |
| 85 |
} |
| 86 |
|
| 87 |
message MessageIdentifier { |
| 88 |
// The unique id of the client that published the message. |
| 89 |
int64 publisher_client_id = 1; |
| 90 |
|
| 91 |
// Sequence number of the published message with the given publish_client_id. |
| 92 |
int32 sequence_number = 2; |
| 93 |
} |
| 94 |
|
| 95 |
// Request a statistics update. |
| 96 |
message CheckRequest {} |
| 97 |
|
| 98 |
message CheckResponse { |
| 99 |
// Histogram of latencies, each one a delta from the previous CheckResponse sent. |
| 100 |
// The bounds of the nth bucket (starting from the 0th bucket) are |
| 101 |
// [1.5^(n-1), 1.5^n) milliseconds. The lower bound of the 0th bucket is 0 seconds. |
| 102 |
repeated int64 bucket_values = 1; |
| 103 |
|
| 104 |
// The duration from the start of the loadtest to its completion or now if is_finished is false. |
| 105 |
google.protobuf.Duration running_duration = 2; |
| 106 |
|
| 107 |
// True if the load test has finished running. |
| 108 |
bool is_finished = 3; |
| 109 |
|
| 110 |
// MessageIdentifiers of all messages since the last Check. |
| 111 |
repeated MessageIdentifier received_messages = 4; |
| 112 |
|
| 113 |
// Number of failed messages since the last check. |
| 114 |
int64 failed = 5; |
| 115 |
} |
| 116 |
|