-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
- Loading branch information
1 parent
3db2525
commit 5d1f7cb
Showing
13 changed files
with
274 additions
and
105 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
32 changes: 32 additions & 0 deletions
32
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,32 @@ | ||
/* | ||
* 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; | ||
|
||
public class RemoteDownloadStats extends PersistedStateStats { | ||
static final String TIMEOUT_COUNT = "timeout_count"; | ||
static final String REMOTE_DOWNLOAD = "remote_download"; | ||
private AtomicLong timeoutCount = new AtomicLong(0); | ||
|
||
public RemoteDownloadStats() { | ||
super(REMOTE_DOWNLOAD); | ||
addToExtendedFields(TIMEOUT_COUNT, timeoutCount); | ||
} | ||
|
||
public void stateDownloadTimeout() { | ||
timeoutCount.incrementAndGet(); | ||
} | ||
|
||
public long getStateDownloadTimeout() { | ||
return timeoutCount.get(); | ||
} | ||
} |
Oops, something went wrong.