Add span for parsing player stats
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
6612e020ff
commit
196b8cef41
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
use eyre::eyre;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use tracing::{Level, span};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SkillInfo {
|
||||
|
@ -77,6 +78,9 @@ pub async fn get_player_stats(rsn: &str) -> eyre::Result<Vec<SkillInfo>> {
|
|||
return Err(eyre!("Player not found"));
|
||||
}
|
||||
|
||||
let parsing_span = span!(Level::INFO, "Parsing player stats", rsn);
|
||||
let parsing_span_run = parsing_span.enter();
|
||||
|
||||
let raw = resp.text().await?;
|
||||
|
||||
let mut n = SKILLS.into_iter();
|
||||
|
@ -98,6 +102,8 @@ pub async fn get_player_stats(rsn: &str) -> eyre::Result<Vec<SkillInfo>> {
|
|||
})
|
||||
.collect();
|
||||
|
||||
drop(parsing_span_run);
|
||||
|
||||
Ok(skills)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue