Compare commits

...

4 Commits

Author SHA1 Message Date
Anna Khanova
396d939f3e Upd 2024-06-06 14:38:04 +02:00
Anna Khanova
00d65b4ea3 Upd 2024-06-06 14:23:26 +02:00
Anna Khanova
d1270f2571 Added logging 2024-06-06 14:06:03 +02:00
Anna Khanova
34b52467f0 Add comments 2024-06-04 20:45:30 +02:00
4 changed files with 16 additions and 1 deletions

View File

@@ -509,7 +509,7 @@ impl<K: Hash + Eq + Clone> ApiLocks<K> {
self.metrics
.semaphore_acquire_seconds
.observe(now.elapsed().as_secs_f64());
info!("acquired permit {:?}", now.elapsed().as_secs_f64());
Ok(WakeComputePermit { permit: permit? })
}

View File

@@ -328,6 +328,13 @@ async fn parse_body<T: for<'a> serde::Deserialize<'a>>(
info!("request succeeded, processing the body");
return Ok(response.json().await?);
}
info!("response_error: {:?}", response);
let s = response.text().await?;
info!("response_error: {:?}", s);
return Err(ApiError::Console {
status,
text: s.into(),
});
// Don't throw an error here because it's not as important
// as the fact that the request itself has failed.

View File

@@ -92,6 +92,12 @@ impl LimiterInner {
}
fn take(&mut self, ready: &Notify) -> Option<()> {
tracing::info!(
"available: {}, in_flight: {}, limit: {}",
self.available,
self.in_flight,
self.limit
);
if self.available >= 1 {
self.available -= 1;
self.in_flight += 1;

View File

@@ -28,6 +28,8 @@ pub struct Aimd {
impl LimitAlgorithm for Aimd {
fn update(&self, old_limit: usize, sample: Sample) -> usize {
use Outcome::*;
tracing::info!(old_limit, "updating limit");
tracing::info!(sample.in_flight, "in flight");
match sample.outcome {
Success => {
let utilisation = sample.in_flight as f32 / old_limit as f32;