Commit 67997a3
committed
Remove Guava Stopwatch from Kafka consumer.poll() loop
Replace Stopwatch (backed by System.nanoTime()) with lightweight
System.currentTimeMillis() for timeout tracking in the hot consumer.poll()
loop. The Stopwatch was adding more latency than it measured when Kafka
had prefetched records ready to return immediately.
This change keeps the updateSuccessfulRpcMetrics() calls and all shared
metric infrastructure (KafkaMetrics, KafkaSinkMetrics) intact.1 parent f47f81c commit 67997a3
2 files changed
Lines changed: 5 additions & 14 deletions
File tree
- sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
411 | 410 | | |
412 | 411 | | |
413 | 412 | | |
414 | | - | |
415 | 413 | | |
416 | 414 | | |
417 | 415 | | |
| |||
580 | 578 | | |
581 | 579 | | |
582 | 580 | | |
583 | | - | |
| 581 | + | |
584 | 582 | | |
585 | | - | |
| 583 | + | |
586 | 584 | | |
587 | 585 | | |
588 | | - | |
589 | | - | |
| 586 | + | |
590 | 587 | | |
591 | 588 | | |
592 | 589 | | |
| |||
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| |||
567 | 566 | | |
568 | 567 | | |
569 | 568 | | |
570 | | - | |
571 | 569 | | |
572 | 570 | | |
573 | 571 | | |
574 | 572 | | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
| 573 | + | |
580 | 574 | | |
581 | 575 | | |
582 | | - | |
| 576 | + | |
583 | 577 | | |
584 | 578 | | |
585 | 579 | | |
| |||
0 commit comments