Skip to content

Commit 08861e4

Browse files
committed
refactor: move LiveManagementService.sortMetrics to LiveViewService.sortMetrics
test: sortMetrics & endpoint cpm view
1 parent 9ac1bb4 commit 08861e4

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

src/main/kotlin/spp/protocol/platform/general/util/IDManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ object IDManager {
240240
/**
241241
* Built by [ServiceID.buildId]
242242
*/
243-
private val serviceId: String? = null,
244-
private val endpointName: String? = null
243+
val serviceId: String? = null,
244+
val endpointName: String? = null
245245
)
246246

247247
data class EndpointRelationDefine(

src/main/kotlin/spp/protocol/service/LiveManagementService.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ import io.vertx.core.Vertx
2424
import io.vertx.core.eventbus.DeliveryOptions
2525
import io.vertx.core.impl.ContextInternal
2626
import io.vertx.core.json.JsonObject
27-
import spp.protocol.artifact.metrics.MetricStep
2827
import spp.protocol.platform.auth.*
2928
import spp.protocol.platform.developer.Developer
3029
import spp.protocol.platform.developer.SelfInfo
3130
import spp.protocol.platform.general.*
3231
import spp.protocol.platform.status.InstanceConnection
3332
import spp.protocol.service.SourceServices.LIVE_MANAGEMENT
34-
import java.time.Instant
3533

3634
/**
3735
* Back-end service for general and administrative tasks.
@@ -128,17 +126,6 @@ interface LiveManagementService {
128126
fun getInstances(service: Service): Future<List<ServiceInstance>>
129127
fun getEndpoints(service: Service, limit: Int?): Future<List<ServiceEndpoint>>
130128
fun searchEndpoints(service: Service, keyword: String, limit: Int?): Future<List<ServiceEndpoint>>
131-
fun sortMetrics(
132-
name: String,
133-
parentService: String?,
134-
normal: Boolean?,
135-
scope: Scope?,
136-
topN: Int,
137-
order: Order,
138-
step: MetricStep,
139-
start: Instant,
140-
stop: Instant?
141-
): Future<List<SelectedRecord>>
142129

143130
fun getActiveProbes(): Future<List<InstanceConnection>>
144131
fun getActiveProbe(id: String): Future<InstanceConnection?>

src/main/kotlin/spp/protocol/service/LiveViewService.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ import io.vertx.core.impl.ContextInternal
2727
import io.vertx.core.json.JsonObject
2828
import spp.protocol.artifact.metrics.MetricStep
2929
import spp.protocol.artifact.trace.TraceStack
30+
import spp.protocol.platform.general.Order
31+
import spp.protocol.platform.general.Scope
32+
import spp.protocol.platform.general.SelectedRecord
3033
import spp.protocol.service.SourceServices.LIVE_VIEW
3134
import spp.protocol.view.HistoricalView
3235
import spp.protocol.view.LiveView
@@ -82,6 +85,18 @@ interface LiveViewService {
8285
fun clearLiveViews(): Future<List<LiveView>>
8386
fun getLiveViewStats(): Future<JsonObject>
8487

88+
fun sortMetrics(
89+
name: String,
90+
parentService: String?,
91+
normal: Boolean?,
92+
scope: Scope?,
93+
topN: Int,
94+
order: Order,
95+
step: MetricStep,
96+
start: Instant,
97+
stop: Instant?
98+
): Future<List<SelectedRecord>>
99+
85100
@GenIgnore
86101
fun getHistoricalMetrics(
87102
entityIds: List<String>,

0 commit comments

Comments
 (0)