-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathmodel.rs
More file actions
28 lines (26 loc) · 849 Bytes
/
model.rs
File metadata and controls
28 lines (26 loc) · 849 Bytes
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
use chrono::{DateTime, Utc};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "PascalCase")]
pub(crate) struct AboutData {
pub run_id: i32,
pub start_time: DateTime<Utc>,
pub startup_request_count: i32,
pub current_request_count: i32,
/// The time of the most recent request.
///
/// This can be `None` if `/about` is the first request made.
pub last_request_time: Option<DateTime<Utc>>,
pub version: String,
}
/// Immutable startup info.
///
/// It is used in the `/about` endpoint.
#[derive(Clone)]
pub(crate) struct StartupInfo {
pub(crate) run_id: i32,
pub(crate) start_time: DateTime<Utc>,
/// The request count at the time of the server startup.
pub(crate) request_count: i32,
}