Skip to content

Commit 85a98fc

Browse files
committed
Remove redundant snapshot prefix in metric fields
1 parent 0a19687 commit 85a98fc

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

server/src/main/java/org/elasticsearch/repositories/SnapshotMetrics.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ public record SnapshotMetrics(
2525
LongCounter snapshotsStartedCounter,
2626
LongCounter snapshotsCompletedCounter,
2727
DoubleHistogram snapshotsDurationHistogram,
28-
LongCounter snapshotsShardsStartedCounter,
29-
LongCounter snapshotsShardsCompletedCounter,
30-
DoubleHistogram snapshotShardsDurationHistogram,
31-
LongCounter snapshotBlobsUploadedCounter,
32-
LongCounter snapshotBytesUploadedCounter,
33-
LongCounter snapshotUploadDurationCounter,
34-
LongCounter snapshotUploadReadDurationCounter,
35-
LongCounter snapshotCreateThrottleDurationCounter,
36-
LongCounter snapshotRestoreThrottleDurationCounter,
28+
LongCounter shardsStartedCounter,
29+
LongCounter shardsCompletedCounter,
30+
DoubleHistogram shardsDurationHistogram,
31+
LongCounter blobsUploadedCounter,
32+
LongCounter bytesUploadedCounter,
33+
LongCounter uploadDurationCounter,
34+
LongCounter uploadReadDurationCounter,
35+
LongCounter createThrottleDurationCounter,
36+
LongCounter restoreThrottleDurationCounter,
3737
MeterRegistry meterRegistry
3838
) {
3939

server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreSnapshotMetrics.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public BlobStoreSnapshotMetrics(@Nullable ProjectId projectId, RepositoryMetadat
4141
}
4242

4343
public void incrementSnapshotRateLimitingTimeInNanos(long throttleTimeNanos) {
44-
snapshotMetrics.snapshotCreateThrottleDurationCounter().incrementBy(throttleTimeNanos, metricAttributes);
44+
snapshotMetrics.createThrottleDurationCounter().incrementBy(throttleTimeNanos, metricAttributes);
4545
snapshotRateLimitingTimeInNanos.inc(throttleTimeNanos);
4646
}
4747

@@ -50,7 +50,7 @@ public long snapshotRateLimitingTimeInNanos() {
5050
}
5151

5252
public void incrementRestoreRateLimitingTimeInNanos(long throttleTimeNanos) {
53-
snapshotMetrics.snapshotRestoreThrottleDurationCounter().incrementBy(throttleTimeNanos, metricAttributes);
53+
snapshotMetrics.restoreThrottleDurationCounter().incrementBy(throttleTimeNanos, metricAttributes);
5454
restoreRateLimitingTimeInNanos.inc(throttleTimeNanos);
5555
}
5656

@@ -59,33 +59,33 @@ public long restoreRateLimitingTimeInNanos() {
5959
}
6060

6161
public void incrementCountersForPartUpload(long partSizeInBytes, long partWriteTimeNanos) {
62-
snapshotMetrics.snapshotBytesUploadedCounter().incrementBy(partSizeInBytes, metricAttributes);
63-
snapshotMetrics.snapshotUploadDurationCounter().incrementBy(partWriteTimeNanos, metricAttributes);
62+
snapshotMetrics.bytesUploadedCounter().incrementBy(partSizeInBytes, metricAttributes);
63+
snapshotMetrics.uploadDurationCounter().incrementBy(partWriteTimeNanos, metricAttributes);
6464
numberOfBytesUploaded.inc(partSizeInBytes);
6565
uploadTimeInNanos.inc(partWriteTimeNanos);
6666
}
6767

6868
public void incrementNumberOfBlobsUploaded() {
69-
snapshotMetrics.snapshotBlobsUploadedCounter().incrementBy(1, metricAttributes);
69+
snapshotMetrics.blobsUploadedCounter().incrementBy(1, metricAttributes);
7070
numberOfBlobsUploaded.inc();
7171
}
7272

7373
public void shardSnapshotStarted() {
74-
snapshotMetrics.snapshotsShardsStartedCounter().incrementBy(1, metricAttributes);
74+
snapshotMetrics.shardsStartedCounter().incrementBy(1, metricAttributes);
7575
numberOfShardSnapshotsStarted.inc();
7676
shardSnapshotsInProgress.inc();
7777
}
7878

7979
public void shardSnapshotCompleted(IndexShardSnapshotStatus status) {
8080
final Map<String, Object> attrsWithStage = Maps.copyMapWithAddedEntry(metricAttributes, "stage", status.getStage().name());
81-
snapshotMetrics.snapshotsShardsCompletedCounter().incrementBy(1, attrsWithStage);
82-
snapshotMetrics.snapshotShardsDurationHistogram().record(status.getTotalTime() / 1_000f, attrsWithStage);
81+
snapshotMetrics.shardsCompletedCounter().incrementBy(1, attrsWithStage);
82+
snapshotMetrics.shardsDurationHistogram().record(status.getTotalTime() / 1_000f, attrsWithStage);
8383
numberOfShardSnapshotsCompleted.inc();
8484
shardSnapshotsInProgress.dec();
8585
}
8686

8787
public void incrementUploadReadTime(long readTimeInNanos) {
88-
snapshotMetrics.snapshotUploadReadDurationCounter().incrementBy(readTimeInNanos, metricAttributes);
88+
snapshotMetrics.uploadReadDurationCounter().incrementBy(readTimeInNanos, metricAttributes);
8989
uploadReadTimeInNanos.inc(readTimeInNanos);
9090
}
9191

0 commit comments

Comments
 (0)