diff --git a/src/main.rs b/src/main.rs index c36d8d5..ef27951 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,14 +81,14 @@ struct VrcInstance { /// World ID. world: Option, /// Custom name for the instance. + #[serde(skip)] name: Option } #[derive(Clone, Debug, Deserialize)] struct VrcInstanceData { - capacity: Option, - n_users: Option, - userCount: Option, + #[serde(rename = "userCount")] + user_count: Option, } #[derive(Clone, Debug, Deserialize)] @@ -173,7 +173,7 @@ async fn metrics(config: Config) -> Result, WsError> { let req = client .get(url) - .header(USER_AGENT, "vr-event-tracker") + .header(USER_AGENT, "vr-event-tracker(git.gmem.ca/arch/vr-event-tracker)") .header("Cookie", &auth_cookie) .send() .await?; @@ -182,7 +182,7 @@ async fn metrics(config: Config) -> Result, WsError> { let name = instance.name.unwrap_or(instance_id.clone()); PLAYER_COUNT .with_label_values(&[&world_id, &instance_id, &name]) - .set(data.userCount.unwrap_or(0 as f64)); + .set(data.user_count.unwrap_or(0 as f64)); } let vrcdn_url = format!(