Skip to content

Commit f0c8d80

Browse files
committed
feat: adding support for multiple tags
1 parent a4fb700 commit f0c8d80

File tree

2 files changed

+4
-3
lines changed
  • src/main

2 files changed

+4
-3
lines changed

src/main/kotlin/at/ac/uibk/dps/cirrina/execution/object/Action.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sealed interface Action {
4545
IncrCtrAction(
4646
description.counter,
4747
description.by ?: "1.0",
48-
Expression.create(description.tag),
48+
description.tags?.mapValues { (_, v) -> Expression.create(v) } ?: emptyMap(),
4949
)
5050

5151
else -> error("unknown action type: ${description.javaClass.simpleName}")
@@ -116,6 +116,7 @@ class TimeoutResetAction internal constructor(val action: String) : Action {
116116
class LogAction internal constructor(val message: Expression) : Action
117117

118118
class IncrCtrAction
119-
internal constructor(val counter: String, val by: String, val tag: Expression?) : Action {
119+
internal constructor(val counter: String, val by: String, val tag: Map<String, Expression>) :
120+
Action {
120121
override fun toString() = "IncrCtrAction(metric='$counter', by='$by', tag='$tag')"
121122
}

src/main/resources/pkl/csm/csml.pkl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ typealias Internal = InternalDescription
195195
class IncrCtrDescription extends ActionDescription {
196196
counter: String
197197
by: String?
198-
tag: Expression?
198+
tags: Mapping<String, Expression>?
199199
}
200200

201201
typealias IncrCtr = IncrCtrDescription

0 commit comments

Comments
 (0)