yandex_cloud/
yandex.cloud.loadtesting.api.v1.test.rs

1/// Agent selection criterion.
2///
3/// The structure is used by service to determine on which agents a specific test should be executed.
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct AgentSelector {
7    #[prost(oneof = "agent_selector::Agent", tags = "1, 2, 3")]
8    pub agent: ::core::option::Option<agent_selector::Agent>,
9}
10/// Nested message and enum types in `AgentSelector`.
11pub mod agent_selector {
12    #[allow(clippy::derive_partial_eq_without_eq)]
13    #[derive(Clone, PartialEq, ::prost::Oneof)]
14    pub enum Agent {
15        /// Selection by agent ID.
16        #[prost(string, tag = "1")]
17        AgentId(::prost::alloc::string::String),
18        /// Selection by filter string.
19        #[prost(string, tag = "2")]
20        MatchByFilter(::prost::alloc::string::String),
21        /// Select anonymoud (i.e. not registered) agents.
22        #[prost(bool, tag = "3")]
23        AnonymousAgent(bool),
24    }
25}
26/// Artifact upload settings.
27///
28/// Defines where to upload test artifacts and which files should be included.
29#[allow(clippy::derive_partial_eq_without_eq)]
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct ArtifactSettings {
32    /// Setting which defines whether artifact files should be archived prior to uploading.
33    #[prost(bool, tag = "6")]
34    pub is_archive: bool,
35    /// Filter strings defining which files should be included to artifacts. GLOB format.
36    ///
37    /// Example:
38    /// - \['*'\] - all files will be uploaded.
39    /// - ['*.log', '*.yaml] - all `.log` and `.yaml` files will be uploaded.
40    #[prost(string, repeated, tag = "7")]
41    pub filter_include: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
42    /// Filter strings defining which files should be excluded from artifacts. GLOB format.
43    ///
44    /// Example:
45    /// - filter_include=\['*'\], filter_exclude=\['phout.log'\] - upload all `.log` files excluding `phout.log`.
46    #[prost(string, repeated, tag = "8")]
47    pub filter_exclude: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
48    #[prost(oneof = "artifact_settings::UploadTo", tags = "1")]
49    pub upload_to: ::core::option::Option<artifact_settings::UploadTo>,
50}
51/// Nested message and enum types in `ArtifactSettings`.
52pub mod artifact_settings {
53    #[allow(clippy::derive_partial_eq_without_eq)]
54    #[derive(Clone, PartialEq, ::prost::Oneof)]
55    pub enum UploadTo {
56        /// Name of output object storage bucket in test's folder.
57        #[prost(string, tag = "1")]
58        ObjectStorageBucket(::prost::alloc::string::String),
59    }
60}
61/// Test meta information.
62#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct Details {
65    /// Name of the test.
66    #[prost(string, tag = "1")]
67    pub name: ::prost::alloc::string::String,
68    /// Description of the test.
69    #[prost(string, tag = "2")]
70    pub description: ::prost::alloc::string::String,
71    /// Tags assigned to the test.
72    #[prost(message, repeated, tag = "3")]
73    pub tags: ::prost::alloc::vec::Vec<super::common::Tag>,
74    /// ID of the logging group to which test artifacts are uploaded.
75    #[prost(string, tag = "4")]
76    pub logging_log_group_id: ::prost::alloc::string::String,
77    /// Settings which define where to upload test artifacts and which files should be included.
78    #[prost(message, optional, tag = "5")]
79    pub artifact_settings: ::core::option::Option<ArtifactSettings>,
80}
81/// Reference to a file stored in Object Storage.
82#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct ObjectStorage {
85    /// Bucket name.
86    #[prost(string, tag = "1")]
87    pub bucket: ::prost::alloc::string::String,
88    /// File name.
89    #[prost(string, tag = "2")]
90    pub name: ::prost::alloc::string::String,
91}
92/// Variant-like structure for referencing files in different sources.
93#[allow(clippy::derive_partial_eq_without_eq)]
94#[derive(Clone, PartialEq, ::prost::Message)]
95pub struct FilePointer {
96    #[prost(oneof = "file_pointer::FilePointer", tags = "1")]
97    pub file_pointer: ::core::option::Option<file_pointer::FilePointer>,
98}
99/// Nested message and enum types in `FilePointer`.
100pub mod file_pointer {
101    #[allow(clippy::derive_partial_eq_without_eq)]
102    #[derive(Clone, PartialEq, ::prost::Oneof)]
103    pub enum FilePointer {
104        /// Reference to a file in Object Storage.
105        #[prost(message, tag = "1")]
106        ObjectStorage(super::ObjectStorage),
107    }
108}
109/// Test imbalance point.
110#[allow(clippy::derive_partial_eq_without_eq)]
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct ImbalancePoint {
113    /// Imbalance moment timestamp.
114    #[prost(message, optional, tag = "1")]
115    pub at: ::core::option::Option<::prost_types::Timestamp>,
116    /// Imbalance moment RPS.
117    #[prost(int64, tag = "2")]
118    pub rps: i64,
119    /// Imbalance reason comment.
120    #[prost(string, tag = "3")]
121    pub comment: ::prost::alloc::string::String,
122}
123/// Configuration of a test.
124#[allow(clippy::derive_partial_eq_without_eq)]
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct SingleAgentConfiguration {
127    /// ID of the config.
128    #[prost(string, tag = "1")]
129    pub config_id: ::prost::alloc::string::String,
130    /// Agent selection criterion.
131    #[prost(message, optional, tag = "2")]
132    pub agent_selector: ::core::option::Option<AgentSelector>,
133    /// Additional files to be used during test execution, represented as `rel_path:file` pairs.
134    ///
135    /// `rel_path` can be either a simple file name, a relative path, or absolute path. Files are
136    /// downloaded by the agent to appropriate location.
137    ///
138    /// Use cases include:
139    /// - [Test Data files](/docs/load-testing/concepts/payload).
140    /// - Custom Pandora executable.
141    /// - JMeter executable or ".jmx" scenario.
142    /// - etc.
143    #[prost(map = "string, message", tag = "3")]
144    pub files: ::std::collections::HashMap<::prost::alloc::string::String, FilePointer>,
145}
146#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
147#[repr(i32)]
148pub enum Status {
149    /// Status is unspecified.
150    Unspecified = 0,
151    /// Test has been created, but not started by any agent.
152    Created = 1,
153    /// Execution stage: initialization.
154    Initiated = 2,
155    /// Execution stage: data preparation and warm-up.
156    Preparing = 3,
157    /// Execution stage: load generation.
158    Running = 4,
159    /// Execution stage: termination.
160    Finishing = 5,
161    /// Test is done.
162    Done = 6,
163    /// Execution stage: results post-processing.
164    PostProcessing = 7,
165    /// Test has failed due to some error.
166    Failed = 8,
167    /// Test is being stopped.
168    Stopping = 9,
169    /// Test has been stopped by user.
170    Stopped = 10,
171    /// Test has been stopped automatically by satisfying autostop condition.
172    Autostopped = 11,
173    /// Execution stage: waiting for a trigger to start.
174    Waiting = 12,
175    /// Test is being deleted.
176    Deleting = 13,
177    /// Test status has not been reported in a while during execution stage.
178    ///
179    /// Means that either an agent is too busy to send it, got offline, or failed without
180    /// reporting a final status.
181    Lost = 14,
182    /// Test has been cancelled.
183    Cancelled = 15,
184}
185impl Status {
186    /// String value of the enum field names used in the ProtoBuf definition.
187    ///
188    /// The values are not transformed in any way and thus are considered stable
189    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
190    pub fn as_str_name(&self) -> &'static str {
191        match self {
192            Status::Unspecified => "STATUS_UNSPECIFIED",
193            Status::Created => "CREATED",
194            Status::Initiated => "INITIATED",
195            Status::Preparing => "PREPARING",
196            Status::Running => "RUNNING",
197            Status::Finishing => "FINISHING",
198            Status::Done => "DONE",
199            Status::PostProcessing => "POST_PROCESSING",
200            Status::Failed => "FAILED",
201            Status::Stopping => "STOPPING",
202            Status::Stopped => "STOPPED",
203            Status::Autostopped => "AUTOSTOPPED",
204            Status::Waiting => "WAITING",
205            Status::Deleting => "DELETING",
206            Status::Lost => "LOST",
207            Status::Cancelled => "CANCELLED",
208        }
209    }
210    /// Creates an enum from field names used in the ProtoBuf definition.
211    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
212        match value {
213            "STATUS_UNSPECIFIED" => Some(Self::Unspecified),
214            "CREATED" => Some(Self::Created),
215            "INITIATED" => Some(Self::Initiated),
216            "PREPARING" => Some(Self::Preparing),
217            "RUNNING" => Some(Self::Running),
218            "FINISHING" => Some(Self::Finishing),
219            "DONE" => Some(Self::Done),
220            "POST_PROCESSING" => Some(Self::PostProcessing),
221            "FAILED" => Some(Self::Failed),
222            "STOPPING" => Some(Self::Stopping),
223            "STOPPED" => Some(Self::Stopped),
224            "AUTOSTOPPED" => Some(Self::Autostopped),
225            "WAITING" => Some(Self::Waiting),
226            "DELETING" => Some(Self::Deleting),
227            "LOST" => Some(Self::Lost),
228            "CANCELLED" => Some(Self::Cancelled),
229            _ => None,
230        }
231    }
232}
233/// Process of test and some results
234#[allow(clippy::derive_partial_eq_without_eq)]
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct Summary {
237    /// Status of the test.
238    #[prost(enumeration = "Status", tag = "1")]
239    pub status: i32,
240    /// Creation timestamp.
241    #[prost(message, optional, tag = "2")]
242    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
243    /// UA or SA that created the test.
244    #[prost(string, tag = "3")]
245    pub created_by: ::prost::alloc::string::String,
246    /// Test start timestamp.
247    ///
248    /// Empty if the test has not been started yet.
249    #[prost(message, optional, tag = "4")]
250    pub started_at: ::core::option::Option<::prost_types::Timestamp>,
251    /// Test finish timestamp.
252    ///
253    /// Empty if the test has not been finished yet.
254    #[prost(message, optional, tag = "5")]
255    pub finished_at: ::core::option::Option<::prost_types::Timestamp>,
256    /// Indicates whether the test is finished.
257    #[prost(bool, tag = "6")]
258    pub is_finished: bool,
259    /// Error message.
260    #[prost(string, tag = "7")]
261    pub error: ::prost::alloc::string::String,
262    /// Detected imbalance point.
263    ///
264    /// Contains information about a state at the moment it has been
265    /// \[auto-stopped\](/docs/load-testing/concepts/auto-stop).
266    ///
267    /// Empty if no auto-stop occured.
268    #[prost(message, optional, tag = "8")]
269    pub imbalance_point: ::core::option::Option<ImbalancePoint>,
270    /// ID of the agent that executed the test.
271    #[prost(string, tag = "9")]
272    pub assigned_agent_id: ::prost::alloc::string::String,
273    /// Test output artifacts.
274    ///
275    /// Link to the artifacts output target containing `.log` and other files collected
276    /// during test execution.
277    #[prost(message, optional, tag = "10")]
278    pub artifacts: ::core::option::Option<FilePointer>,
279}
280/// Load Test.
281///
282/// In context of the service, Test represents a single testing task/job.
283#[allow(clippy::derive_partial_eq_without_eq)]
284#[derive(Clone, PartialEq, ::prost::Message)]
285pub struct Test {
286    /// ID of the test. Generated at creation time.
287    #[prost(string, tag = "1")]
288    pub id: ::prost::alloc::string::String,
289    /// Configuration of the test.
290    ///
291    /// A test can have multiple configurations if it can be
292    /// executed on multiple agents simultaneously. For more information, see
293    /// [Load testing using multiple agents](/docs/load-testing/tutorials/loadtesting-multiply).
294    #[prost(message, repeated, tag = "2")]
295    pub configurations: ::prost::alloc::vec::Vec<SingleAgentConfiguration>,
296    /// Test meta information. Name, description, etc.
297    #[prost(message, optional, tag = "3")]
298    pub details: ::core::option::Option<Details>,
299    /// Test execution information.
300    #[prost(message, optional, tag = "4")]
301    pub summary: ::core::option::Option<Summary>,
302    /// ID of the folder that the test belongs to.
303    #[prost(string, tag = "5")]
304    pub folder_id: ::prost::alloc::string::String,
305}