Skip to content

Commit 8a6bf07

Browse files
committed
Refactor LiveView implementation and Service object structure
1 parent 6959ef5 commit 8a6bf07

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

insight/src/main/kotlin/spp/jetbrains/insight/contributor/FunctionDurationContributor.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ class FunctionDurationContributor(private val remoteInsightsAvailable: Boolean)
9999
val vertx = UserData.vertx(guideMark.project)
100100
viewService.addLiveView(
101101
LiveView(
102-
null,
103102
mutableSetOf(guideMark.getUserData(EndpointDetector.DETECTED_ENDPOINTS)!!.firstNotNullOf { it.name }),
104-
guideMark.artifactQualifiedName,
105-
LiveSourceLocation(guideMark.artifactQualifiedName.identifier, -1, service),
106-
LiveViewConfig(FUNCTION_DURATION.name, listenMetrics, 1000)
103+
LiveViewConfig(FUNCTION_DURATION.name, listenMetrics, 1000),
104+
service = service
107105
)
108106
).onSuccess {
109107
val subscriptionId = it.subscriptionId!!

plugin/src/main/kotlin/spp/jetbrains/sourcemarker/command/status/LiveStatusBarManagerImpl.kt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ import spp.jetbrains.marker.source.mark.api.component.swing.SwingSourceMarkCompo
4343
import spp.jetbrains.marker.source.mark.inlay.InlayMark
4444
import spp.jetbrains.sourcemarker.SourceMarkerPlugin
4545
import spp.jetbrains.sourcemarker.command.status.ui.*
46-
import spp.protocol.artifact.ArtifactQualifiedName
47-
import spp.protocol.artifact.ArtifactType
4846
import spp.protocol.instrument.*
4947
import spp.protocol.instrument.location.LiveSourceLocation
5048
import spp.protocol.instrument.meter.MeterType
@@ -330,14 +328,9 @@ class LiveStatusBarManagerImpl(val project: Project, val vertx: Vertx) : LiveSta
330328

331329
UserData.liveViewService(project)!!.addLiveView(
332330
LiveView(
333-
null,
334331
mutableSetOf(liveMeter.id!!),
335-
ArtifactQualifiedName(liveMeter.location.source, type = ArtifactType.EXPRESSION),
336-
liveMeter.location,
337-
LiveViewConfig(
338-
"LIVE_METER",
339-
listOf(liveMeter.id!!)
340-
)
332+
LiveViewConfig("LIVE_METER", listOf(liveMeter.id!!)),
333+
service = liveMeter.location.service
341334
)
342335
).onComplete {
343336
if (it.succeeded()) {

plugin/src/main/kotlin/spp/jetbrains/sourcemarker/command/status/ui/LogStatusBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public void accept(@NotNull LiveViewEvent event) {
280280
JsonObject rawMetrics = new JsonObject(event.getMetricsData());
281281
Log logData = new Log(rawMetrics.getJsonObject("log"));
282282
LogResult logResult = new LogResult(
283-
event.getArtifactQualifiedName(),
283+
null,
284284
LogOrderType.NEWEST_LOGS,
285285
logData.getTimestamp(),
286286
Collections.singletonList(logData),

plugin/src/main/kotlin/spp/jetbrains/sourcemarker/view/window/LiveEndpointsWindow.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import spp.jetbrains.view.window.util.EndpointRowView
3636
import spp.protocol.artifact.metrics.MetricType.Companion.Endpoint_CPM
3737
import spp.protocol.artifact.metrics.MetricType.Companion.Endpoint_RespTime_AVG
3838
import spp.protocol.artifact.metrics.MetricType.Companion.Endpoint_SLA
39-
import spp.protocol.instrument.location.LiveSourceLocation
4039
import spp.protocol.platform.general.Service
4140
import spp.protocol.service.LiveViewService
4241
import spp.protocol.service.SourceServices.Subscribe.toLiveViewSubscriberAddress
@@ -109,11 +108,9 @@ class LiveEndpointsWindow(
109108
Endpoint_SLA.metricId
110109
)
111110
val liveView = LiveView(
112-
null,
113111
mutableSetOf(endpoint.endpoint.name),
114-
null,
115-
LiveSourceLocation("", 0, service),
116-
LiveViewConfig("LiveEndpointsWindow", listenMetrics, refreshInterval)
112+
LiveViewConfig("LiveEndpointsWindow", listenMetrics, refreshInterval),
113+
service = service
117114
)
118115
addView(EndpointRowView(project, viewService, liveView, endpoint, model) {
119116
consumerCreator(vertx, it, endpoint)

0 commit comments

Comments
 (0)