File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
services/src/main/java/spp/probe/services Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ kotlin.code.style=official
33probeGroup = spp.probe
44probeVersion = 0.2.0-alpha-1
55
6- protocolVersion =0.2.0-alpha-4
6+ protocolVersion =0.2.0-alpha-5
77
88# SkyWalking 8.8.1-compatible
99vertxVersion = 4.0.2
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ object ContextReceiver {
165165 val meter = ProbeMemory .computeIfAbsent(" spp.base-meter:$meterId " ) {
166166 when (meterType) {
167167 MeterType .COUNT -> return @computeIfAbsent MeterFactory .counter(
168- " counter_ " + meterId.replace(" -" , " _" )
168+ " count_ " + meterId.replace(" -" , " _" )
169169 ).mode(CounterMode .RATE )
170170 .build()
171171 MeterType .GAUGE -> return @computeIfAbsent MeterFactory .gauge(
Original file line number Diff line number Diff line change @@ -8,14 +8,20 @@ class ActiveLiveInstrument @JvmOverloads constructor(
88 val instrument : LiveInstrument ,
99 val expression : Expression ? = null
1010) {
11- val throttle: HitThrottle = HitThrottle (instrument.throttle.limit, instrument.throttle.step)
11+ val throttle: HitThrottle ? = instrument.throttle.let {
12+ if (it != null ) {
13+ HitThrottle (it.limit, it.step)
14+ } else {
15+ null
16+ }
17+ }
1218 var isRemoval = false
1319 var isLive = false
1420
1521 val isFinished: Boolean
1622 get() = if (instrument.expiresAt != null && System .currentTimeMillis() >= instrument.expiresAt!! ) {
1723 true
1824 } else {
19- instrument.hitLimit != - 1 && throttle.totalHitCount >= instrument.hitLimit
25+ instrument.hitLimit != - 1 && ( throttle != null && throttle .totalHitCount >= instrument.hitLimit)
2026 }
2127}
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ object LiveInstrumentService {
278278 @JvmStatic
279279 fun isHit (instrumentId : String ): Boolean {
280280 val instrument = instruments[instrumentId] ? : return false
281- if (instrument.throttle.isRateLimited()) {
281+ if (instrument.throttle? .isRateLimited() == true ) {
282282 ContextReceiver .clear(instrumentId)
283283 return false
284284 }
You can’t perform that action at this time.
0 commit comments