Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: u64 might require special treatment #21

Merged
merged 1 commit into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Add unleash-types to your Cargo file.

### Client metrics

- client_metrics::ClientAppliction struct represents the data expected by an Unleash server in a POST to the `/api/client/register` endpoint
- client_metrics::ClientApplication struct represents the data expected by an Unleash server in a POST to the `/api/client/register` endpoint
- client_metrics::ClientMetrics struct represents the data expected by an Unleash server in a POST to the `/api/client/metrics` endpoint

### Frontend types
Expand Down
12 changes: 6 additions & 6 deletions src/client_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use crate::Merge;
#[cfg_attr(feature = "openapi", derive(ToSchema))]
pub struct ToggleStats {
#[builder(default = "0")]
pub no: u64,
pub no: u32,
#[builder(default = "0")]
pub yes: u64,
pub yes: u32,
#[builder(default = "HashMap::new()")]
#[serde(default)]
pub variants: HashMap<String, u64>,
pub variants: HashMap<String, u32>,
}

impl ToggleStats {
Expand Down Expand Up @@ -109,9 +109,9 @@ pub struct ClientMetricsEnv {
pub app_name: String,
pub environment: String,
pub timestamp: DateTime<Utc>,
pub yes: u64,
pub no: u64,
pub variants: HashMap<String, u64>,
pub yes: u32,
pub no: u32,
pub variants: HashMap<String, u32>,
}

#[derive(Debug, Clone, Deserialize, Serialize, Builder, PartialEq, Eq)]
Expand Down