Skip to content

Commit

Permalink
Fix blocking time percentage scale (#176)
Browse files Browse the repository at this point in the history
The blocking time percentage needs to be multiplied by 100 to match the
% unit.
  • Loading branch information
rkusa authored Sep 4, 2022
1 parent 131ffbe commit 4a04655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed error when retrieving mark panels (`WorldService.GetMarkPanels`) when the mark panel was created by a game master / JTAC, or when the player who created the mark panel left. `MarkPanel.initiator` is now optional. ([#156](https://github.com/DCS-gRPC/rust-server/issues/156))
- Fixed scale of blocking time percentage in stats logs.

### Added
- Added `SimulationFps` event that is fired every second and contains simulation fps information since the last event (i.e. for the past ~1sec).
Expand Down
4 changes: 2 additions & 2 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Stats {
.unwrap_or(u64::MAX),
);
let block_time_total_percentage =
block_time_total.as_secs_f64() / elapsed.as_secs_f64();
(block_time_total.as_secs_f64() / elapsed.as_secs_f64()) * 100.0;

// average queue size
let queue_size_average = f64::try_from(interval_stats.queue_size_total)
Expand All @@ -167,7 +167,7 @@ impl Stats {
interval_stats.eps_highest
);
log::info!(
"Blocking time: total={:?} (≙ {:.3}%)",
"Blocking time: total={:?} (≙ {:.2}%)",
block_time_total,
block_time_total_percentage
);
Expand Down

0 comments on commit 4a04655

Please sign in to comment.