3737
3838import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .OBJECT_UPLOAD ;
3939import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .OBJECT_UPLOAD_BYTES ;
40- import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_COPY ;
41- import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_COPY_BYTES ;
42- import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_COPY_ERRORS ;
4340import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_COPY_TIME ;
4441import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_DELETE ;
4542import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_DELETE_BYTES ;
4643import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_DELETE_ERRORS ;
4744import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_DELETE_TIME ;
48- import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_FETCH ;
4945import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .SEGMENT_FETCH_REQUESTED_BYTES ;
5046import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .objectTypeTags ;
5147import static io .aiven .kafka .tieredstorage .metrics .MetricsRegistry .sensorName ;
@@ -79,51 +75,6 @@ public Metrics(final Time time, final MetricConfig metricConfig) {
7975 metricsRegistry = new MetricsRegistry ();
8076 }
8177
82- public void recordSegmentCopy (final TopicPartition topicPartition , final long bytes ) {
83- recordSegmentCopyRequests (topicPartition );
84- recordSegmentCopyBytes (topicPartition , bytes );
85- }
86-
87- private void recordSegmentCopyBytes (final TopicPartition topicPartition , final long bytes ) {
88- new SensorProvider (metrics , sensorName (SEGMENT_COPY_BYTES ))
89- .with (metricsRegistry .segmentCopyBytesRate , new Rate ())
90- .with (metricsRegistry .segmentCopyBytesTotal , new CumulativeSum ())
91- .get ()
92- .record (bytes );
93- new SensorProvider (metrics , sensorNameByTopic (topicPartition , SEGMENT_COPY_BYTES ),
94- () -> topicTags (topicPartition ))
95- .with (metricsRegistry .segmentCopyBytesRateByTopic , new Rate ())
96- .with (metricsRegistry .segmentCopyBytesTotalByTopic , new CumulativeSum ())
97- .get ()
98- .record (bytes );
99- new SensorProvider (metrics , sensorNameByTopicPartition (topicPartition , SEGMENT_COPY_BYTES ),
100- () -> topicPartitionTags (topicPartition ), Sensor .RecordingLevel .DEBUG )
101- .with (metricsRegistry .segmentCopyBytesRateByTopicPartition , new Rate ())
102- .with (metricsRegistry .segmentCopyBytesTotalByTopicPartition , new CumulativeSum ())
103- .get ()
104- .record (bytes );
105- }
106-
107- private void recordSegmentCopyRequests (final TopicPartition topicPartition ) {
108- new SensorProvider (metrics , sensorName (SEGMENT_COPY ))
109- .with (metricsRegistry .segmentCopyRequestsRate , new Rate ())
110- .with (metricsRegistry .segmentCopyRequestsTotal , new CumulativeCount ())
111- .get ()
112- .record ();
113- new SensorProvider (metrics , sensorNameByTopic (topicPartition , SEGMENT_COPY ),
114- () -> topicTags (topicPartition ))
115- .with (metricsRegistry .segmentCopyRequestsRateByTopic , new Rate ())
116- .with (metricsRegistry .segmentCopyRequestsTotalByTopic , new CumulativeCount ())
117- .get ()
118- .record ();
119- new SensorProvider (metrics , sensorNameByTopicPartition (topicPartition , SEGMENT_COPY ),
120- () -> topicPartitionTags (topicPartition ), Sensor .RecordingLevel .DEBUG )
121- .with (metricsRegistry .segmentCopyRequestsRateByTopicPartition , new Rate ())
122- .with (metricsRegistry .segmentCopyRequestsTotalByTopicPartition , new CumulativeCount ())
123- .get ()
124- .record ();
125- }
126-
12778 public void recordSegmentCopyTime (final TopicPartition topicPartition , final long startMs , final long endMs ) {
12879 final var time = endMs - startMs ;
12980 new SensorProvider (metrics , sensorName (SEGMENT_COPY_TIME ))
@@ -145,26 +96,6 @@ public void recordSegmentCopyTime(final TopicPartition topicPartition, final lon
14596 .record (time );
14697 }
14798
148- public void recordSegmentCopyError (final TopicPartition topicPartition ) {
149- new SensorProvider (metrics , sensorName (SEGMENT_COPY_ERRORS ))
150- .with (metricsRegistry .segmentCopyErrorsRate , new Rate ())
151- .with (metricsRegistry .segmentCopyErrorsTotal , new CumulativeCount ())
152- .get ()
153- .record ();
154- new SensorProvider (metrics , sensorNameByTopic (topicPartition , SEGMENT_COPY_ERRORS ),
155- () -> topicTags (topicPartition ))
156- .with (metricsRegistry .segmentCopyErrorsRateByTopic , new Rate ())
157- .with (metricsRegistry .segmentCopyErrorsTotalByTopic , new CumulativeCount ())
158- .get ()
159- .record ();
160- new SensorProvider (metrics , sensorNameByTopicPartition (topicPartition , SEGMENT_COPY_ERRORS ),
161- () -> topicPartitionTags (topicPartition ), Sensor .RecordingLevel .DEBUG )
162- .with (metricsRegistry .segmentCopyErrorsRateByTopicPartition , new Rate ())
163- .with (metricsRegistry .segmentCopyErrorsTotalByTopicPartition , new CumulativeCount ())
164- .get ()
165- .record ();
166- }
167-
16899 public void recordSegmentDelete (final TopicPartition topicPartition , final long bytes ) {
169100 recordSegmentDeleteRequests (topicPartition );
170101 recordSegmentDeleteBytes (topicPartition , bytes );
@@ -256,7 +187,6 @@ public void recordSegmentDeleteError(final TopicPartition topicPartition) {
256187 }
257188
258189 public void recordSegmentFetch (final TopicPartition topicPartition , final long bytes ) {
259- recordSegmentFetchRequests (topicPartition );
260190 recordSegmentFetchRequestedBytes (topicPartition , bytes );
261191 }
262192
@@ -280,26 +210,6 @@ private void recordSegmentFetchRequestedBytes(final TopicPartition topicPartitio
280210 .record (bytes );
281211 }
282212
283- private void recordSegmentFetchRequests (final TopicPartition topicPartition ) {
284- new SensorProvider (metrics , sensorName (SEGMENT_FETCH ))
285- .with (metricsRegistry .segmentFetchRequestsRate , new Rate ())
286- .with (metricsRegistry .segmentFetchRequestsTotal , new CumulativeCount ())
287- .get ()
288- .record ();
289- new SensorProvider (metrics , sensorNameByTopic (topicPartition , SEGMENT_FETCH ),
290- () -> topicTags (topicPartition ))
291- .with (metricsRegistry .segmentFetchRequestsRateByTopic , new Rate ())
292- .with (metricsRegistry .segmentFetchRequestsTotalByTopic , new CumulativeCount ())
293- .get ()
294- .record ();
295- new SensorProvider (metrics , sensorNameByTopicPartition (topicPartition , SEGMENT_FETCH ),
296- () -> topicPartitionTags (topicPartition ), Sensor .RecordingLevel .DEBUG )
297- .with (metricsRegistry .segmentFetchRequestsRateByTopicPartition , new Rate ())
298- .with (metricsRegistry .segmentFetchRequestsTotalByTopicPartition , new CumulativeCount ())
299- .get ()
300- .record ();
301- }
302-
303213 public void recordObjectUpload (final TopicPartition topicPartition , final ObjectKey .Suffix suffix ,
304214 final long bytes ) {
305215 recordObjectUploadRequests (topicPartition , suffix );
0 commit comments