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.
Additional actions metrics with requested changes from previous commit
Signed-off-by: harycash <[email protected]>
- Loading branch information
harycash
committed
Jun 20, 2024
1 parent
9eaf83a
commit 0c55243
Showing
13 changed files
with
307 additions
and
21 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
25 changes: 25 additions & 0 deletions
25
...rch.indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/DeleteActionMetrics.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,25 @@ | ||
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 DeleteActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.DELETE | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Delete Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Delete Action Failures", "count") | ||
} | ||
|
||
companion object { | ||
val instance: DeleteActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = DeleteActionMetrics() | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/ForceMergeActionMetrics.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,26 @@ | ||
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 ForceMergeActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.FORCE_MERGE | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = | ||
metricsRegistry.createCounter("${actionName}_successes", "Force Merge Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Force Merge Action Failures", "count") | ||
} | ||
|
||
companion object { | ||
val instance: ForceMergeActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = ForceMergeActionMetrics() | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...dexmanagement.spi/indexstatemanagement/metrics/actionmetrics/NotificationActionMetrics.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,25 @@ | ||
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 NotificationActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.NOTIFICATION | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Notification Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Notification Action Failures", "count") | ||
} | ||
|
||
companion object { | ||
val instance: NotificationActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = NotificationActionMetrics() | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...dexmanagement.spi/indexstatemanagement/metrics/actionmetrics/ReplicaCountActionMetrics.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,25 @@ | ||
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 ReplicaCountActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.REPLICA_COUNT | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Replica Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Replica Action Failures", "count") | ||
} | ||
|
||
companion object { | ||
val instance: ReplicaCountActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = ReplicaCountActionMetrics() | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...h.indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/RolloverActionMetrics.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
25 changes: 25 additions & 0 deletions
25
...indexmanagement.spi/indexstatemanagement/metrics/actionmetrics/TransitionActionMetrics.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,25 @@ | ||
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 TransitionActionMetrics private constructor() : ActionMetrics() { | ||
override val actionName: String = IndexManagementActionsMetrics.TRANSITION | ||
lateinit var successes: Counter | ||
lateinit var failures: Counter | ||
|
||
fun initializeCounters(metricsRegistry: MetricsRegistry) { | ||
successes = metricsRegistry.createCounter("${actionName}_successes", "Transition Action Successes", "count") | ||
failures = metricsRegistry.createCounter("${actionName}_failures", "Transition Action Failures", "count") | ||
} | ||
|
||
companion object { | ||
val instance: TransitionActionMetrics by lazy { HOLDER.instance } | ||
} | ||
|
||
private object HOLDER { | ||
val instance = TransitionActionMetrics() | ||
} | ||
} |
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
Oops, something went wrong.