forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
[Remote Publication] Add remote download stats (opensearch-project#15291
) --------- Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> (cherry picked from commit b54e867)
1 parent
5653ed6
commit 38d0a82
Showing
15 changed files
with
416 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
server/src/main/java/org/opensearch/gateway/remote/RemoteUploadStats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.gateway.remote; | ||
|
||
import org.opensearch.cluster.coordination.PersistedStateStats; | ||
|
||
import java.util.concurrent.atomic.AtomicLong; | ||
|
||
/** | ||
* Upload stats for remote state | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class RemoteUploadStats extends PersistedStateStats { | ||
static final String CLEANUP_ATTEMPT_FAILED_COUNT = "cleanup_attempt_failed_count"; | ||
static final String INDEX_ROUTING_FILES_CLEANUP_ATTEMPT_FAILED_COUNT = "index_routing_files_cleanup_attempt_failed_count"; | ||
static final String INDICES_ROUTING_DIFF_FILES_CLEANUP_ATTEMPT_FAILED_COUNT = "indices_routing_diff_files_cleanup_attempt_failed_count"; | ||
static final String REMOTE_UPLOAD = "remote_upload"; | ||
private AtomicLong cleanupAttemptFailedCount = new AtomicLong(0); | ||
private AtomicLong indexRoutingFilesCleanupAttemptFailedCount = new AtomicLong(0); | ||
private AtomicLong indicesRoutingDiffFilesCleanupAttemptFailedCount = new AtomicLong(0); | ||
|
||
public RemoteUploadStats() { | ||
super(REMOTE_UPLOAD); | ||
addToExtendedFields(CLEANUP_ATTEMPT_FAILED_COUNT, cleanupAttemptFailedCount); | ||
addToExtendedFields(INDEX_ROUTING_FILES_CLEANUP_ATTEMPT_FAILED_COUNT, indexRoutingFilesCleanupAttemptFailedCount); | ||
addToExtendedFields(INDICES_ROUTING_DIFF_FILES_CLEANUP_ATTEMPT_FAILED_COUNT, indicesRoutingDiffFilesCleanupAttemptFailedCount); | ||
} | ||
|
||
public void cleanUpAttemptFailed() { | ||
cleanupAttemptFailedCount.incrementAndGet(); | ||
} | ||
|
||
public long getCleanupAttemptFailedCount() { | ||
return cleanupAttemptFailedCount.get(); | ||
} | ||
|
||
public void indexRoutingFilesCleanupAttemptFailed() { | ||
indexRoutingFilesCleanupAttemptFailedCount.incrementAndGet(); | ||
} | ||
|
||
public long getIndexRoutingFilesCleanupAttemptFailedCount() { | ||
return indexRoutingFilesCleanupAttemptFailedCount.get(); | ||
} | ||
|
||
public void indicesRoutingDiffFileCleanupAttemptFailed() { | ||
indicesRoutingDiffFilesCleanupAttemptFailedCount.incrementAndGet(); | ||
} | ||
|
||
public long getIndicesRoutingDiffFileCleanupAttemptFailedCount() { | ||
return indicesRoutingDiffFilesCleanupAttemptFailedCount.get(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters