Skip to content

Commit a6207ec

Browse files
committed
Extended statistics
1 parent 34f15c0 commit a6207ec

File tree

11 files changed

+298
-167
lines changed

11 files changed

+298
-167
lines changed

ide-common/src/main/kotlin/org/digma/intellij/plugin/analytics/InsightStatsChangedEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface InsightStatsChangedEvent {
1616
fun insightStatsChanged(
1717
scope: JsonNode?,
1818
analyticsInsightsCount: Int,
19-
issuesInsightsCount: Int,
19+
totalQueryResultCount: Int,
2020
unreadInsightsCount: Int,
2121
criticalInsightsCount: Int,
2222
allIssuesCount: Int

ide-common/src/main/kotlin/org/digma/intellij/plugin/scope/ScopeManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class ScopeManager(private val project: Project) {
125125
private fun showHomeView(scope: SpanScope, insightsStats: InsightsStatsResult?) {
126126
val contentViewSwitcher = MainContentViewSwitcher.getInstance(project)
127127
if (insightsStats != null) {
128-
if (insightsStats.analyticsInsightsCount > 0 && insightsStats.issuesInsightsCount == 0) {
128+
if (insightsStats.analyticsInsightsCount > 0 && insightsStats.totalQueryResultCount == 0) {
129129
contentViewSwitcher.showAnalytics()
130130
return
131131
}

model/src/main/kotlin/org/digma/intellij/plugin/model/rest/insights/InsightsStatsResult.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ data class InsightsStatsResult
99
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
1010
@ConstructorProperties(
1111
"dismissedCount",
12-
"issuesInsightsCount",
12+
"totalQueryResultCount",
1313
"analyticsInsightsCount",
1414
"unreadInsightsCount",
1515
"criticalInsightsCount",
1616
"allIssuesCount"
1717
)
1818
constructor(
1919
val dismissedCount: Number,
20-
val issuesInsightsCount: Int,
20+
val totalQueryResultCount: Int,
2121
val analyticsInsightsCount: Int,
2222
val unreadInsightsCount: Int,
2323
val criticalInsightsCount: Int,

src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseMessageRouterHandler.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ abstract class BaseMessageRouterHandler(protected val project: Project) : Common
254254
.insightStatsChanged(
255255
null,
256256
stats.analyticsInsightsCount,
257-
stats.issuesInsightsCount,
257+
stats.totalQueryResultCount,
258258
stats.unreadInsightsCount,
259259
stats.criticalInsightsCount,
260260
stats.allIssuesCount
@@ -266,7 +266,7 @@ abstract class BaseMessageRouterHandler(protected val project: Project) : Common
266266
.insightStatsChanged(
267267
scopeNode,
268268
stats.analyticsInsightsCount,
269-
stats.issuesInsightsCount,
269+
stats.totalQueryResultCount,
270270
stats.unreadInsightsCount,
271271
stats.criticalInsightsCount,
272272
stats.allIssuesCount
@@ -363,7 +363,7 @@ abstract class BaseMessageRouterHandler(protected val project: Project) : Common
363363
CodeLocation(listOf(), listOf()),
364364
false,
365365
insightsStats?.analyticsInsightsCount ?: 0,
366-
insightsStats?.issuesInsightsCount ?: 0,
366+
insightsStats?.totalQueryResultCount ?: 0,
367367
insightsStats?.unreadInsightsCount ?: 0
368368
)
369369
}

src/main/kotlin/org/digma/intellij/plugin/ui/jcef/JCefComponent.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private constructor(
232232
codeLocation,
233233
hasErrors,
234234
insightsStats?.analyticsInsightsCount ?: 0,
235-
insightsStats?.issuesInsightsCount ?: 0,
235+
insightsStats?.totalQueryResultCount ?: 0,
236236
insightsStats?.unreadInsightsCount ?: 0
237237
)
238238
} catch (e: Throwable) {
@@ -259,7 +259,7 @@ private constructor(
259259
override fun insightStatsChanged(
260260
scope: JsonNode?,
261261
analyticsInsightsCount: Int,
262-
issuesInsightsCount: Int,
262+
totalQueryResultCount: Int,
263263
unreadInsightsCount: Int,
264264
criticalInsightsCount: Int,
265265
allIssuesCount: Int
@@ -269,7 +269,7 @@ private constructor(
269269
jbCefBrowser.cefBrowser,
270270
scope,
271271
analyticsInsightsCount,
272-
issuesInsightsCount,
272+
totalQueryResultCount,
273273
unreadInsightsCount,
274274
criticalInsightsCount,
275275
allIssuesCount

src/main/kotlin/org/digma/intellij/plugin/ui/jcef/JCefMessagesUtils.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,12 @@ fun sendScopeChangedMessage(
198198
codeLocation: CodeLocation,
199199
hasErrors: Boolean,
200200
analyticsInsightsCount: Number,
201-
issuesInsightsCount: Number,
201+
totalQueryResultCount: Number,
202202
unreadInsightsCount: Number
203203
) {
204204
serializeAndExecuteWindowPostMessageJavaScript(
205-
cefBrowser, SetScopeMessage(SetScopeMessagePayload(scope, codeLocation, hasErrors, analyticsInsightsCount, issuesInsightsCount, unreadInsightsCount))
205+
cefBrowser,
206+
SetScopeMessage(SetScopeMessagePayload(scope, codeLocation, hasErrors, analyticsInsightsCount, totalQueryResultCount, unreadInsightsCount))
206207
)
207208
}
208209

@@ -230,7 +231,7 @@ fun sendSetInsightStatsMessage(
230231
cefBrowser: CefBrowser,
231232
scope: JsonNode?,
232233
analyticsInsightsCount: Number,
233-
issuesInsightsCount: Number,
234+
totalQueryResultCount: Number,
234235
unreadInsightsCount: Number,
235236
criticalInsightsCount: Number,
236237
allIssuesCount: Number
@@ -241,7 +242,7 @@ fun sendSetInsightStatsMessage(
241242
SetInsightStatsMessagePayload(
242243
scope,
243244
analyticsInsightsCount,
244-
issuesInsightsCount,
245+
totalQueryResultCount,
245246
unreadInsightsCount,
246247
criticalInsightsCount,
247248
allIssuesCount

src/main/kotlin/org/digma/intellij/plugin/ui/jcef/model/ScopeMessages.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ data class SetScopeMessagePayload(
1515
val code: CodeLocation,
1616
val hasErrors: Boolean,
1717
val analyticsInsightsCount: Number,
18-
val issuesInsightsCount: Number,
18+
val totalQueryResultCount: Number,
1919
val unreadInsightsCount: Number
2020
)
2121

src/main/kotlin/org/digma/intellij/plugin/ui/jcef/model/SetInsightStatsMessage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ data class SetInsightStatsMessage(val payload: SetInsightStatsMessagePayload) {
1212
data class SetInsightStatsMessagePayload(
1313
val scope: JsonNode?,
1414
val analyticsInsightsCount: Number,
15-
val issuesInsightsCount: Number,
15+
val totalQueryResultCount: Number,
1616
val unreadInsightsCount: Number,
1717
val criticalInsightsCount: Number,
1818
val allIssuesCount: Number

src/main/resources/webview/main/index.js

Lines changed: 173 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/webview/navigation/index.js

Lines changed: 53 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)