示例#1
0
    def test_track_tp_end_offsets(
        self, monitor: PrometheusMonitor, metrics: FaustMetrics
    ) -> None:
        monitor.track_tp_end_offset(TP("foo", 0), 4004)

        self.assert_has_sample_value(
            metrics.topic_partition_end_offset,
            "test_topic_partition_end_offset",
            {"topic": "foo", "partition": "0"},
            4004,
        )
示例#2
0
 def _handle_event(
     self,
     monitor: PrometheusMonitor,
     topic_partition: TP,
     stream: StreamT,
     event: EventT,
     offset: int,
 ) -> None:
     monitor.track_tp_end_offset(topic_partition, offset + 5)
     monitor.on_message_in(topic_partition, offset, event.message)
     monitor.on_stream_event_in(topic_partition, offset, stream, event)
     monitor.on_tp_commit({topic_partition: offset})