Skip to content

Commit ae7d766

Browse files
committed
Added back logging and removed printing.
1 parent 7afa840 commit ae7d766

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

cas_client/src/adaptive_concurrency/controller.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ impl ConcurrencyControllerState {
6464
/// predicted time and the actual time, and increase the concurrency when this is reliably sublinear and decrease it
6565
/// when it is superlinear. This is clipped to avoid having a single observation weight it too much; failures
6666
/// and retries max out the deviance.
67-
///
68-
///
6967
pub struct AdaptiveConcurrencyController {
7068
// The current state, including tracking information and when previous adjustments were made.
7169
// Also holds related constants
@@ -161,29 +159,19 @@ impl AdaptiveConcurrencyController {
161159
.latency_predictor
162160
.update(n_bytes, actual_completion_time, avg_concurrency);
163161

164-
eprintln!(
165-
"success = {is_success}; n_bytes={n_bytes}, avg_con = {avg_concurrency}, t_pred = {t_pred}; t_actual = {t_actual}; dev_ratio = {dev_ratio}"
166-
);
167-
168162
dev_ratio
169163
} else {
170-
eprintln!("failure, bytes known.");
171-
172164
// If it's not a success, then update the deviance with the penalty factor.
173165
max_dev
174166
}
175167
} else {
176168
// This would be a failure case, so update the
177169
debug_assert!(!is_success);
178170

179-
eprintln!("failure, bytes unknown.");
180-
181171
max_dev
182172
}
183173
};
184174

185-
eprintln!("dev_ratio = {}; ln = {}", deviance_ratio, deviance_ratio.ln());
186-
187175
// Update the deviance with this value; we're tracking the log of the ratio due
188176
// to the additive averaging.
189177
state_lg.deviance_tracking.update(deviance_ratio.clamp(min_dev, max_dev).ln()); // deviance_ratio.ln());
@@ -197,7 +185,7 @@ impl AdaptiveConcurrencyController {
197185
self.concurrency_semaphore.increment_total_permits();
198186
state_lg.last_adjustment_time = Instant::now();
199187

200-
eprintln!(
188+
debug!(
201189
"Concurrency control for {}: Increased concurrency to {}; latency deviance = {cur_deviance}.",
202190
self.logging_tag,
203191
self.concurrency_semaphore.total_permits()
@@ -209,7 +197,7 @@ impl AdaptiveConcurrencyController {
209197
self.concurrency_semaphore.decrement_total_permits();
210198
state_lg.last_adjustment_time = Instant::now();
211199

212-
eprintln!(
200+
debug!(
213201
"Concurrency control for {}: Lowered concurrency to {}; latency deviance = {cur_deviance}.",
214202
self.logging_tag,
215203
self.concurrency_semaphore.total_permits()
@@ -218,7 +206,7 @@ impl AdaptiveConcurrencyController {
218206
}
219207

220208
if state_lg.last_logging_time.elapsed() > Duration::from_millis(*CONCURRENCY_CONTROL_LOGGING_INTERVAL_MS) {
221-
eprintln!(
209+
info!(
222210
"Concurrency control for {}: Current concurrency = {}; predicted bandwidth = {}; deviance = {}",
223211
self.logging_tag,
224212
self.concurrency_semaphore.total_permits(),

cas_client/src/adaptive_concurrency/latency_prediction.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,6 @@ impl LatencyPredictor {
113113
// re-fit under nonneg constraints
114114
self.refit_nonneg();
115115

116-
eprintln!(
117-
"On Update: sw={}, base_time_sec={}, slope={}, bandwidth={}",
118-
self.sw,
119-
self.base_time_secs,
120-
self.inv_throughput_secs_per_mib,
121-
self.predicted_bandwidth().unwrap_or_default()
122-
);
123-
124116
self.last_update = now;
125117
}
126118

0 commit comments

Comments
 (0)