Skip to content

Commit 675aae9

Browse files
committed
history: adjust display for StructuredHistory to "request" terminology
1 parent ff85ad0 commit 675aae9

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

scylla/src/observability/history.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ impl From<&HistoryCollectorData> for StructuredHistory {
400400
/// StructuredHistory should be used for printing query history.
401401
impl Display for StructuredHistory {
402402
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
403-
writeln!(f, "Queries History:")?;
403+
writeln!(f, "Requests History:")?;
404404
for (i, query) in self.requests.iter().enumerate() {
405-
writeln!(f, "=== Query #{} ===", i)?;
405+
writeln!(f, "=== Request #{} ===", i)?;
406406
writeln!(f, "| start_time: {}", query.start_time)?;
407407
writeln!(f, "| Non-speculative attempts:")?;
408408
write_fiber_attempts(&query.non_speculative_fiber, f)?;
@@ -416,13 +416,13 @@ impl Display for StructuredHistory {
416416
writeln!(f, "|")?;
417417
match &query.result {
418418
Some(RequestHistoryResult::Success(succ_time)) => {
419-
writeln!(f, "| Query successful at {}", succ_time)?;
419+
writeln!(f, "| Request successful at {}", succ_time)?;
420420
}
421421
Some(RequestHistoryResult::Error(err_time, error)) => {
422-
writeln!(f, "| Query failed at {}", err_time)?;
422+
writeln!(f, "| Request failed at {}", err_time)?;
423423
writeln!(f, "| Error: {}", error)?;
424424
}
425-
None => writeln!(f, "| Query still running - no final result yet")?,
425+
None => writeln!(f, "| Request still running - no final result yet")?,
426426
};
427427
writeln!(f, "=================")?;
428428
}
@@ -546,7 +546,7 @@ mod tests {
546546

547547
assert!(history.requests.is_empty());
548548

549-
let displayed = "Queries History:
549+
let displayed = "Requests History:
550550
";
551551
assert_eq!(displayed, format!("{}", history));
552552
}
@@ -567,12 +567,12 @@ mod tests {
567567
.is_empty());
568568
assert!(history.requests[0].speculative_fibers.is_empty());
569569

570-
let displayed = "Queries History:
571-
=== Query #0 ===
570+
let displayed = "Requests History:
571+
=== Request #0 ===
572572
| start_time: 2022-02-22 20:22:22 UTC
573573
| Non-speculative attempts:
574574
|
575-
| Query still running - no final result yet
575+
| Request still running - no final result yet
576576
=================
577577
";
578578

@@ -600,15 +600,15 @@ mod tests {
600600
Some(AttemptResult::Success(_))
601601
);
602602

603-
let displayed = "Queries History:
604-
=== Query #0 ===
603+
let displayed = "Requests History:
604+
=== Request #0 ===
605605
| start_time: 2022-02-22 20:22:22 UTC
606606
| Non-speculative attempts:
607607
| - Attempt #0 sent to 127.0.0.1:19042
608608
| request send time: 2022-02-22 20:22:22 UTC
609609
| Success at 2022-02-22 20:22:22 UTC
610610
|
611-
| Query successful at 2022-02-22 20:22:22 UTC
611+
| Request successful at 2022-02-22 20:22:22 UTC
612612
=================
613613
";
614614
assert_eq!(displayed, format!("{}", set_one_time(history)));
@@ -645,8 +645,8 @@ mod tests {
645645
let history: StructuredHistory = history_collector.clone_structured_history();
646646

647647
let displayed =
648-
"Queries History:
649-
=== Query #0 ===
648+
"Requests History:
649+
=== Request #0 ===
650650
| start_time: 2022-02-22 20:22:22 UTC
651651
| Non-speculative attempts:
652652
| - Attempt #0 sent to 127.0.0.1:19042
@@ -661,7 +661,7 @@ mod tests {
661661
| Error: Database returned an error: Not enough nodes are alive to satisfy required consistency level (consistency: Quorum, required: 2, alive: 1), Error message: Not enough nodes to satisfy consistency
662662
| Retry decision: DontRetry
663663
|
664-
| Query failed at 2022-02-22 20:22:22 UTC
664+
| Request failed at 2022-02-22 20:22:22 UTC
665665
| Error: Database returned an error: Not enough nodes are alive to satisfy required consistency level (consistency: Quorum, required: 2, alive: 1), Error message: Not enough nodes to satisfy consistency
666666
=================
667667
";
@@ -696,8 +696,8 @@ mod tests {
696696
.attempts
697697
.is_empty());
698698

699-
let displayed = "Queries History:
700-
=== Query #0 ===
699+
let displayed = "Requests History:
700+
=== Request #0 ===
701701
| start_time: 2022-02-22 20:22:22 UTC
702702
| Non-speculative attempts:
703703
|
@@ -713,7 +713,7 @@ mod tests {
713713
| > Speculative fiber #2
714714
| fiber start time: 2022-02-22 20:22:22 UTC
715715
|
716-
| Query still running - no final result yet
716+
| Request still running - no final result yet
717717
=================
718718
";
719719
assert_eq!(displayed, format!("{}", set_one_time(history)));
@@ -772,8 +772,8 @@ mod tests {
772772

773773
let history: StructuredHistory = history_collector.clone_structured_history();
774774

775-
let displayed = "Queries History:
776-
=== Query #0 ===
775+
let displayed = "Requests History:
776+
=== Request #0 ===
777777
| start_time: 2022-02-22 20:22:22 UTC
778778
| Non-speculative attempts:
779779
| - Attempt #0 sent to 127.0.0.1:19042
@@ -819,7 +819,7 @@ mod tests {
819819
| request send time: 2022-02-22 20:22:22 UTC
820820
| No result yet
821821
|
822-
| Query successful at 2022-02-22 20:22:22 UTC
822+
| Request successful at 2022-02-22 20:22:22 UTC
823823
=================
824824
";
825825
assert_eq!(displayed, format!("{}", set_one_time(history)));
@@ -851,8 +851,8 @@ mod tests {
851851

852852
let history: StructuredHistory = history_collector.clone_structured_history();
853853

854-
let displayed = "Queries History:
855-
=== Query #0 ===
854+
let displayed = "Requests History:
855+
=== Request #0 ===
856856
| start_time: 2022-02-22 20:22:22 UTC
857857
| Non-speculative attempts:
858858
| - Attempt #0 sent to 127.0.0.1:19042
@@ -865,16 +865,16 @@ mod tests {
865865
| request send time: 2022-02-22 20:22:22 UTC
866866
| Success at 2022-02-22 20:22:22 UTC
867867
|
868-
| Query successful at 2022-02-22 20:22:22 UTC
868+
| Request successful at 2022-02-22 20:22:22 UTC
869869
=================
870-
=== Query #1 ===
870+
=== Request #1 ===
871871
| start_time: 2022-02-22 20:22:22 UTC
872872
| Non-speculative attempts:
873873
| - Attempt #0 sent to 127.0.0.1:19042
874874
| request send time: 2022-02-22 20:22:22 UTC
875875
| Success at 2022-02-22 20:22:22 UTC
876876
|
877-
| Query successful at 2022-02-22 20:22:22 UTC
877+
| Request successful at 2022-02-22 20:22:22 UTC
878878
=================
879879
";
880880
assert_eq!(displayed, format!("{}", set_one_time(history)));

scylla/tests/integration/history.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ async fn successful_query_history() {
119119

120120
let history: StructuredHistory = history_collector.clone_structured_history();
121121

122-
let displayed = "Queries History:
123-
=== Query #0 ===
122+
let displayed = "Requests History:
123+
=== Request #0 ===
124124
| start_time: 2022-02-22 20:22:22 UTC
125125
| Non-speculative attempts:
126126
| - Attempt #0 sent to 127.0.0.1:19042
127127
| request send time: 2022-02-22 20:22:22 UTC
128128
| Success at 2022-02-22 20:22:22 UTC
129129
|
130-
| Query successful at 2022-02-22 20:22:22 UTC
130+
| Request successful at 2022-02-22 20:22:22 UTC
131131
=================
132132
";
133133
assert_eq!(
@@ -144,24 +144,24 @@ async fn successful_query_history() {
144144

145145
let history2: StructuredHistory = history_collector.clone_structured_history();
146146

147-
let displayed2 = "Queries History:
148-
=== Query #0 ===
147+
let displayed2 = "Requests History:
148+
=== Request #0 ===
149149
| start_time: 2022-02-22 20:22:22 UTC
150150
| Non-speculative attempts:
151151
| - Attempt #0 sent to 127.0.0.1:19042
152152
| request send time: 2022-02-22 20:22:22 UTC
153153
| Success at 2022-02-22 20:22:22 UTC
154154
|
155-
| Query successful at 2022-02-22 20:22:22 UTC
155+
| Request successful at 2022-02-22 20:22:22 UTC
156156
=================
157-
=== Query #1 ===
157+
=== Request #1 ===
158158
| start_time: 2022-02-22 20:22:22 UTC
159159
| Non-speculative attempts:
160160
| - Attempt #0 sent to 127.0.0.1:19042
161161
| request send time: 2022-02-22 20:22:22 UTC
162162
| Success at 2022-02-22 20:22:22 UTC
163163
|
164-
| Query successful at 2022-02-22 20:22:22 UTC
164+
| Request successful at 2022-02-22 20:22:22 UTC
165165
=================
166166
";
167167
assert_eq!(
@@ -187,8 +187,8 @@ async fn failed_query_history() {
187187
let history: StructuredHistory = history_collector.clone_structured_history();
188188

189189
let displayed =
190-
"Queries History:
191-
=== Query #0 ===
190+
"Requests History:
191+
=== Request #0 ===
192192
| start_time: 2022-02-22 20:22:22 UTC
193193
| Non-speculative attempts:
194194
| - Attempt #0 sent to 127.0.0.1:19042
@@ -197,7 +197,7 @@ async fn failed_query_history() {
197197
| Error: Database returned an error: The submitted query has a syntax error, Error message: Error message from database
198198
| Retry decision: DontRetry
199199
|
200-
| Query failed at 2022-02-22 20:22:22 UTC
200+
| Request failed at 2022-02-22 20:22:22 UTC
201201
| Error: Database returned an error: The submitted query has a syntax error, Error message: Error message from database
202202
=================
203203
";
@@ -251,42 +251,42 @@ async fn iterator_query_history() {
251251

252252
assert!(history.requests.len() >= 4);
253253

254-
let displayed_prefix = "Queries History:
255-
=== Query #0 ===
254+
let displayed_prefix = "Requests History:
255+
=== Request #0 ===
256256
| start_time: 2022-02-22 20:22:22 UTC
257257
| Non-speculative attempts:
258258
| - Attempt #0 sent to 127.0.0.1:19042
259259
| request send time: 2022-02-22 20:22:22 UTC
260260
| Success at 2022-02-22 20:22:22 UTC
261261
|
262-
| Query successful at 2022-02-22 20:22:22 UTC
262+
| Request successful at 2022-02-22 20:22:22 UTC
263263
=================
264-
=== Query #1 ===
264+
=== Request #1 ===
265265
| start_time: 2022-02-22 20:22:22 UTC
266266
| Non-speculative attempts:
267267
| - Attempt #0 sent to 127.0.0.1:19042
268268
| request send time: 2022-02-22 20:22:22 UTC
269269
| Success at 2022-02-22 20:22:22 UTC
270270
|
271-
| Query successful at 2022-02-22 20:22:22 UTC
271+
| Request successful at 2022-02-22 20:22:22 UTC
272272
=================
273-
=== Query #2 ===
273+
=== Request #2 ===
274274
| start_time: 2022-02-22 20:22:22 UTC
275275
| Non-speculative attempts:
276276
| - Attempt #0 sent to 127.0.0.1:19042
277277
| request send time: 2022-02-22 20:22:22 UTC
278278
| Success at 2022-02-22 20:22:22 UTC
279279
|
280-
| Query successful at 2022-02-22 20:22:22 UTC
280+
| Request successful at 2022-02-22 20:22:22 UTC
281281
=================
282-
=== Query #3 ===
282+
=== Request #3 ===
283283
| start_time: 2022-02-22 20:22:22 UTC
284284
| Non-speculative attempts:
285285
| - Attempt #0 sent to 127.0.0.1:19042
286286
| request send time: 2022-02-22 20:22:22 UTC
287287
| Success at 2022-02-22 20:22:22 UTC
288288
|
289-
| Query successful at 2022-02-22 20:22:22 UTC
289+
| Request successful at 2022-02-22 20:22:22 UTC
290290
=================
291291
";
292292
let displayed_str = format!(

0 commit comments

Comments
 (0)