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.
remote publication checksum stats (opensearch-project#15957)
* Remote publication checksum stats Signed-off-by: Himshikha Gupta <[email protected]> Co-authored-by: Himshikha Gupta <[email protected]>
- Loading branch information
Showing
5 changed files
with
91 additions
and
4 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
36 changes: 36 additions & 0 deletions
36
server/src/main/java/org/opensearch/gateway/remote/RemoteDownloadStats.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,36 @@ | ||
/* | ||
* 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; | ||
|
||
/** | ||
* Download stats for remote state | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class RemoteDownloadStats extends PersistedStateStats { | ||
static final String CHECKSUM_VALIDATION_FAILED_COUNT = "checksum_validation_failed_count"; | ||
private AtomicLong checksumValidationFailedCount = new AtomicLong(0); | ||
|
||
public RemoteDownloadStats(String statsName) { | ||
super(statsName); | ||
addToExtendedFields(CHECKSUM_VALIDATION_FAILED_COUNT, checksumValidationFailedCount); | ||
} | ||
|
||
public void checksumValidationFailedCount() { | ||
checksumValidationFailedCount.incrementAndGet(); | ||
} | ||
|
||
public long getChecksumValidationFailedCount() { | ||
return checksumValidationFailedCount.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