forked from opensearch-project/index-management
-
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.
Fixed Build Issues, Added new metric : Cumulative Latency
Signed-off-by: harycash <[email protected]>
- Loading branch information
harycash
committed
Jul 1, 2024
1 parent
96736b9
commit 55ff6dd
Showing
11 changed files
with
352 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...arch.indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/AliasActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class AliasActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.ALIAS_ACTION | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Alias Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Alias Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Alias Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: AliasActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = AliasActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/AllocationActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class AllocationActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.ALLOCATION | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Allocation Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Allocation Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Allocation Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: AllocationActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = AllocationActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...arch.indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/CloseActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class CloseActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.CLOSE | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Close Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Close Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Close Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: CloseActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = CloseActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...dexmanagement.spi/indexstatemanagement/metrics/actionmetrics/CreateRollupActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class CreateRollupActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.CREATE_ROLLUP | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Create Rollup Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Create Rollup Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Create Rollup Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: CreateRollupActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = CreateRollupActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...management.spi/indexstatemanagement/metrics/actionmetrics/CreateTransformActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class CreateTransformActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.CREATE_TRANSFORM | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Create Transform Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Create Transform Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Create Transform Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: CreateTransformActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = CreateTransformActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
....indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/MoveShardActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class MoveShardActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.MOVE_SHARD | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Move Shard Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Move Shard Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Move Shard Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: MoveShardActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = MoveShardActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...earch.indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/OpenActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class OpenActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.OPEN | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Open Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Open Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Open Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: OpenActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = OpenActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...anagement.spi/indexstatemanagement/metrics/actionmetrics/SetIndexPriorityActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class SetIndexPriorityActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.SET_INDEX_PRIORITY | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Set Index Priority Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Set Index Priority Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Set Index Priority Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: SetIndexPriorityActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = SetIndexPriorityActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...ndexmanagement.spi/indexstatemanagement/metrics/actionmetrics/SetReadOnlyActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class SetReadOnlyActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.SET_READ_ONLY | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Set Read Only Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Set Read Only Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Set Read Only Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: SetReadOnlyActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = SetReadOnlyActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...rch.indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/ShrinkActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class ShrinkActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.SHRINK | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Shrink Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Shrink Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Shrink Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: ShrinkActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = ShrinkActionMetrics() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...h.indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/SnapshotActionMetrics.kt
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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.actionmetrics | ||
|
||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.ActionMetrics | ||
import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics | ||
import org.opensearch.telemetry.metrics.Counter | ||
import org.opensearch.telemetry.metrics.MetricsRegistry | ||
|
||
class SnapshotActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.SNAPSHOT | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
lateinit var cumulativeLatency: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Snapshot Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Snapshot Action Failures", "count") | ||
cumulativeLatency = metricsRegistry.createCounter("${actionName}_cumulative_latency", "Cumulative Latency of Snapshot Actions", "milliseconds") | ||
} | ||
|
||
companion object { | ||
val instance: SnapshotActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = SnapshotActionMetrics() | ||
} | ||
} |