@@ -34,6 +34,7 @@ import spp.protocol.service.SourceServices.Subscribe.toLiveViewSubscriberAddress
3434import spp.protocol.view.LiveView
3535import spp.protocol.view.LiveViewConfig
3636import spp.protocol.view.LiveViewEvent
37+ import spp.protocol.view.rule.LiveViewRule
3738import java.io.ByteArrayOutputStream
3839import java.io.ObjectOutputStream
3940import java.io.Serializable
@@ -63,13 +64,26 @@ class MeterGaugeTest : ProbeIntegrationTest() {
6364 MetricValue (MetricValueType .NUMBER_SUPPLIER , encodedSupplier),
6465 location = LiveSourceLocation (
6566 MeterGaugeTest ::class .qualifiedName!! ,
66- 47 ,
67+ 48 ,
6768 " spp-test-probe"
6869 ),
6970 id = meterId,
7071 applyImmediately = true
7172 )
7273
74+ viewService.saveRuleIfAbsent(
75+ LiveViewRule (
76+ name = liveMeter.toMetricIdWithoutPrefix(),
77+ exp = buildString {
78+ append(" (" )
79+ append(liveMeter.toMetricIdWithoutPrefix())
80+ append(" .downsampling(LATEST)" )
81+ append(" )" )
82+ append(" .instance(['service'], ['instance'], Layer.GENERAL)" )
83+ }
84+ )
85+ ).await()
86+
7387 val subscriptionId = viewService.addLiveView(
7488 LiveView (
7589 entityIds = mutableSetOf (liveMeter.toMetricId()),
@@ -79,7 +93,7 @@ class MeterGaugeTest : ProbeIntegrationTest() {
7993 ),
8094 artifactLocation = LiveSourceLocation (
8195 MeterGaugeTest ::class .qualifiedName!! ,
82- 47
96+ 48
8397 ),
8498 viewConfig = LiveViewConfig (
8599 " test" ,
@@ -128,13 +142,26 @@ class MeterGaugeTest : ProbeIntegrationTest() {
128142 MetricValue (MetricValueType .NUMBER_EXPRESSION , " localVariables[i]" ),
129143 location = LiveSourceLocation (
130144 MeterGaugeTest ::class .qualifiedName!! ,
131- 47 ,
145+ 48 ,
132146 " spp-test-probe"
133147 ),
134148 id = meterId,
135149 applyImmediately = true
136150 )
137151
152+ viewService.saveRuleIfAbsent(
153+ LiveViewRule (
154+ name = liveMeter.toMetricIdWithoutPrefix(),
155+ exp = buildString {
156+ append(" (" )
157+ append(liveMeter.toMetricIdWithoutPrefix())
158+ append(" .downsampling(LATEST)" )
159+ append(" )" )
160+ append(" .instance(['service'], ['instance'], Layer.GENERAL)" )
161+ }
162+ )
163+ ).await()
164+
138165 val subscriptionId = viewService.addLiveView(
139166 LiveView (
140167 entityIds = mutableSetOf (liveMeter.toMetricId()),
@@ -144,7 +171,7 @@ class MeterGaugeTest : ProbeIntegrationTest() {
144171 ),
145172 artifactLocation = LiveSourceLocation (
146173 MeterGaugeTest ::class .qualifiedName!! ,
147- 47
174+ 48
148175 ),
149176 viewConfig = LiveViewConfig (
150177 " test" ,
0 commit comments