From c692304bec25a3eb9b34ca41092fa661249d6d40 Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Wed, 26 Oct 2022 12:50:47 -0700 Subject: [PATCH 01/10] Add schema to router in events Signed-off-by: Kavitha Conjeevaram Mohan --- .../routes/event_analytics/event_analytics_router.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts b/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts index 4040e7e66..3972ae176 100644 --- a/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts +++ b/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts @@ -139,6 +139,11 @@ export const registerEventAnalyticsRouter = ({ description: schema.string(), application_id: schema.maybe(schema.string()), user_configs: schema.string(), + sub_type: schema.string(), + unit_of_measure: schema.maybe(schema.string()), + selected_labels: schema.maybe(schema.object({ + labels: schema.arrayOf(schema.object({}, { unknowns: 'allow' })), + })), }), }), }, @@ -226,6 +231,11 @@ export const registerEventAnalyticsRouter = ({ description: schema.string(), application_id: schema.maybe(schema.string()), user_configs: schema.string(), + sub_type: schema.string(), + unit_of_measure: schema.maybe(schema.string()), + selected_labels: schema.maybe(schema.object({ + labels: schema.arrayOf(schema.object({}, { unknowns: 'allow' })), + })), }), }), }, From f16bd9759d6fe333f4d9d35d3b2849854d58eafe Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Thu, 27 Oct 2022 11:50:27 -0700 Subject: [PATCH 02/10] update Saved Visualization in backend to include metrics Signed-off-by: Kavitha Conjeevaram Mohan --- .../event_analytics/event_analytics_router.ts | 2 +- .../observability/model/SavedVisualization.kt | 36 +++++++++++++++++-- .../model/SavedVisualizationTests.kt | 8 ++++- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts b/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts index 3972ae176..6291fd2a6 100644 --- a/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts +++ b/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts @@ -142,7 +142,7 @@ export const registerEventAnalyticsRouter = ({ sub_type: schema.string(), unit_of_measure: schema.maybe(schema.string()), selected_labels: schema.maybe(schema.object({ - labels: schema.arrayOf(schema.object({}, { unknowns: 'allow' })), + label: schema.arrayOf(schema.object({}, { unknowns: 'allow' })), })), }), }), diff --git a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt index 2c65d0471..e4a43a07d 100644 --- a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt +++ b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt @@ -43,7 +43,13 @@ import org.opensearch.observability.util.logger * "name": "Logs between dates", * "description": "some descriptions related to this query", * "application_id": "KE1Ie34BbsTr-CsB4G6Y", - * "user_configs": "{\"dataConfig\":\"{}\",\"layoutConfig\": \"{}\"}" + * "user_configs": "{\"dataConfig\":\"{}\",\"layoutConfig\": \"{}\"}", + * "sub_type": "metric", + * "units_of_measure: "hours (h)", + * "selected_labels": [ + * {"label":"avg"}, + * {"label":"count"}, + * ] * } * } */ @@ -58,6 +64,9 @@ internal data class SavedVisualization( val selectedFields: SavedQuery.SelectedFields?, val applicationId: String? = null, val userConfigs: String? = null, + val subType: String?, + val unitsOfMeasure: String? = null, + val selectedLabels: SavedQuery.SelectedLabels? = null, ) : BaseObjectData { internal companion object { @@ -71,6 +80,9 @@ internal data class SavedVisualization( private const val SELECTED_FIELDS_TAG = "selected_fields" private const val APPLICATION_ID_TAG = "application_id" private const val USER_CONFIGS_TAG = "user_configs" + private const val SUB_TYPE_TAG = "sub_type" + private const val UNITS_OF_MEASURE_TAG = "units_of_measure" + private const val SELECTED_LABELS_TAG = "selected_labels" /** * reader to create instance of class from writable. @@ -97,6 +109,9 @@ internal data class SavedVisualization( var selectedFields: SavedQuery.SelectedFields? = null var applicationId: String? = null var userConfigs: String? = null + var subType: String? + var unitsOfMeasure: String? = null + var selectedLabels: SavedQuery.SelectedLabels? = null XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser) while (XContentParser.Token.END_OBJECT != parser.nextToken()) { val fieldName = parser.currentName() @@ -111,6 +126,9 @@ internal data class SavedVisualization( SELECTED_FIELDS_TAG -> selectedFields = SavedQuery.SelectedFields.parse(parser) APPLICATION_ID_TAG -> applicationId = parser.text() USER_CONFIGS_TAG -> userConfigs = parser.text() + SUB_TYPE_TAG -> subType = parser.text() + UNITS_OF_MEASURE_TAG -> unitsOfMeasure = parser.text() + SELECTED_LABELS_TAG -> selectedLabels = SavedQuery.SelectedFields.parse(parser) else -> { parser.skipChildren() log.info("$LOG_PREFIX:SavedVisualization Skipping Unknown field $fieldName") @@ -126,7 +144,10 @@ internal data class SavedVisualization( selectedTimestamp, selectedFields, applicationId, - userConfigs + userConfigs, + subType, + unitsOfMeasure, + selectedLabels ) } } @@ -153,7 +174,10 @@ internal data class SavedVisualization( selectedTimestamp = input.readOptionalWriteable(SavedQuery.Token.reader), selectedFields = input.readOptionalWriteable(SavedQuery.SelectedFields.reader), applicationId = input.readOptionalString(), - userConfigs = input.readOptionalString() + userConfigs = input.readOptionalString(), + subType = input.readString(), + unitsOfMeasure = input.readOptionalString(), + selectedLabels = input.readOptionalString(), ) /** @@ -169,6 +193,9 @@ internal data class SavedVisualization( output.writeOptionalWriteable(selectedFields) output.writeOptionalString(applicationId) output.writeOptionalString(userConfigs) + output.writeString(subType) + output.writeOptionalString(unitsOfMeasure) + output.writeOptionalString(selectedLabels) } /** @@ -186,6 +213,9 @@ internal data class SavedVisualization( .fieldIfNotNull(SELECTED_FIELDS_TAG, selectedFields) .fieldIfNotNull(APPLICATION_ID_TAG, applicationId) .fieldIfNotNull(USER_CONFIGS_TAG, userConfigs) + .fieldIfNotNull(SUB_TYPE_TAG, subType) + .fieldIfNotNull(UNITS_OF_MEASURE_TAG, unitsOfMeasure) + .fieldIfNotNull(SELECTED_LABELS_TAG, selectedLabels) return builder.endObject() } } diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt index 8129aad70..f5bb609b6 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt @@ -30,7 +30,13 @@ internal class SavedVisualizationTests { listOf(SavedQuery.Token("utc_time", "timestamp")) ), "KE1Ie34BbsTr-CsB4G6Y", - "{\"dataConfig\":\"{}\",\"layoutConfig\":\"{}\"}" + "{\"dataConfig\":\"{}\",\"layoutConfig\":\"{}\"}", + "metric", + "hours (h)", + SavedQuery.SelectedLabels( + "| fields clientip, bytes, memory, host", + listOf(SavedQuery.Label("utc_time", "timestamp")) + ) ) @Test From 7de42d678c5012c44c8c6001c98b0ac974438740 Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Thu, 27 Oct 2022 16:17:55 -0700 Subject: [PATCH 03/10] add SelectedLabels class Signed-off-by: Kavitha Conjeevaram Mohan --- .../observability/model/SavedVisualization.kt | 80 +++++++++++++++++-- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt index e4a43a07d..c9dde88a3 100644 --- a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt +++ b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt @@ -66,7 +66,7 @@ internal data class SavedVisualization( val userConfigs: String? = null, val subType: String?, val unitsOfMeasure: String? = null, - val selectedLabels: SavedQuery.SelectedLabels? = null, + val selectedLabels: SelectedLabels? = null, ) : BaseObjectData { internal companion object { @@ -109,9 +109,9 @@ internal data class SavedVisualization( var selectedFields: SavedQuery.SelectedFields? = null var applicationId: String? = null var userConfigs: String? = null - var subType: String? + var subType: String? = null var unitsOfMeasure: String? = null - var selectedLabels: SavedQuery.SelectedLabels? = null + var selectedLabels: SelectedLabels? = null XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser) while (XContentParser.Token.END_OBJECT != parser.nextToken()) { val fieldName = parser.currentName() @@ -128,7 +128,7 @@ internal data class SavedVisualization( USER_CONFIGS_TAG -> userConfigs = parser.text() SUB_TYPE_TAG -> subType = parser.text() UNITS_OF_MEASURE_TAG -> unitsOfMeasure = parser.text() - SELECTED_LABELS_TAG -> selectedLabels = SavedQuery.SelectedFields.parse(parser) + SELECTED_LABELS_TAG -> selectedLabels = SelectedLabels.parse(parser) else -> { parser.skipChildren() log.info("$LOG_PREFIX:SavedVisualization Skipping Unknown field $fieldName") @@ -177,7 +177,7 @@ internal data class SavedVisualization( userConfigs = input.readOptionalString(), subType = input.readString(), unitsOfMeasure = input.readOptionalString(), - selectedLabels = input.readOptionalString(), + selectedLabels = input.readOptionalWriteable(SelectedLabels.reader), ) /** @@ -195,7 +195,7 @@ internal data class SavedVisualization( output.writeOptionalString(userConfigs) output.writeString(subType) output.writeOptionalString(unitsOfMeasure) - output.writeOptionalString(selectedLabels) + output.writeOptionalWriteable(selectedLabels) } /** @@ -218,4 +218,72 @@ internal data class SavedVisualization( .fieldIfNotNull(SELECTED_LABELS_TAG, selectedLabels) return builder.endObject() } + + internal data class SelectedLabels( + val label: String, + ) : BaseModel { + internal companion object { + private const val LABEL_TAG = "label" + + /** + * reader to create instance of class from writable. + */ + val reader = Writeable.Reader { SelectedLabels(it) } + + /** + * Parser to parse xContent + */ + val xParser = XParser { parse(it) } + + /** + * Parse the data from parser and create Trigger object + * @param parser data referenced at parser + * @return created Trigger object + */ + fun parse(parser: XContentParser): SelectedLabels { + var label: String? = null + XContentParserUtils.ensureExpectedToken( + XContentParser.Token.START_OBJECT, + parser.currentToken(), + parser + ) + while (XContentParser.Token.END_OBJECT != parser.nextToken()) { + val fieldName = parser.currentName() + parser.nextToken() + when (fieldName) { + LABEL_TAG -> label = parser.text() + else -> log.info("$LOG_PREFIX: Trigger Skipping Unknown field $fieldName") + } + } + label ?: throw IllegalArgumentException("$LABEL_TAG field absent") + return SelectedLabels(label) + } + } + + /** + * Constructor used in transport action communication. + * @param input StreamInput stream to deserialize data from. + */ + constructor(input: StreamInput) : this( + label = input.readString(), + ) + + /** + * {@inheritDoc} + */ + override fun writeTo(output: StreamOutput) { + output.writeString(label) + } + + /** + * {@inheritDoc} + */ + override fun toXContent(builder: XContentBuilder?, params: ToXContent.Params?): XContentBuilder { + builder!! + builder.startObject() + .field(LABEL_TAG, label) + builder.endObject() + return builder + } + } } From 5b217922e5bfb3c14c05d86da45e3032c3d5ff66 Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Fri, 28 Oct 2022 15:11:30 -0700 Subject: [PATCH 04/10] Add Token class in saved visualization Signed-off-by: Kavitha Conjeevaram Mohan --- .../observability/model/SavedVisualization.kt | 94 ++++++++++++++++++- .../model/SavedVisualizationTests.kt | 6 +- 2 files changed, 92 insertions(+), 8 deletions(-) diff --git a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt index c9dde88a3..d34be7f23 100644 --- a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt +++ b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt @@ -99,6 +99,7 @@ internal data class SavedVisualization( * @param parser data referenced at parser * @return created SavedVisualization object */ + @Suppress("ComplexMethod") fun parse(parser: XContentParser): SavedVisualization { var name: String? = null var description: String? = null @@ -219,7 +220,7 @@ internal data class SavedVisualization( return builder.endObject() } - internal data class SelectedLabels( + internal data class Token( val label: String, ) : BaseModel { internal companion object { @@ -228,7 +229,7 @@ internal data class SavedVisualization( /** * reader to create instance of class from writable. */ - val reader = Writeable.Reader { SelectedLabels(it) } + val reader = Writeable.Reader { Token(it) } /** * Parser to parse xContent @@ -240,7 +241,7 @@ internal data class SavedVisualization( * @param parser data referenced at parser * @return created Trigger object */ - fun parse(parser: XContentParser): SelectedLabels { + fun parse(parser: XContentParser): Token { var label: String? = null XContentParserUtils.ensureExpectedToken( XContentParser.Token.START_OBJECT, @@ -256,7 +257,7 @@ internal data class SavedVisualization( } } label ?: throw IllegalArgumentException("$LABEL_TAG field absent") - return SelectedLabels(label) + return Token(label) } } @@ -286,4 +287,89 @@ internal data class SavedVisualization( return builder } } + + internal data class SelectedLabels( + val labels: List?, + ) : BaseModel { + internal companion object { + private const val LABELS_TAG = "labels" + + /** + * reader to create instance of class from writable. + */ + val reader = Writeable.Reader { SelectedLabels(it) } + + /** + * Parser to parse xContent + */ + val xParser = XParser { parse(it) } + + /** + * Parse the item list from parser + * @param parser data referenced at parser + * @return created list of items + */ + private fun parseItemList(parser: XContentParser): List { + val retList: MutableList = mutableListOf() + XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_ARRAY, parser.currentToken(), parser) + while (parser.nextToken() != XContentParser.Token.END_ARRAY) { + retList.add(Token.parse(parser)) + } + return retList + } + + /** + * Parse the data from parser and create Trigger object + * @param parser data referenced at parser + * @return created Trigger object + */ + fun parse(parser: XContentParser): SelectedLabels { + var labels: List? = null + XContentParserUtils.ensureExpectedToken( + XContentParser.Token.START_OBJECT, + parser.currentToken(), + parser + ) + while (XContentParser.Token.END_OBJECT != parser.nextToken()) { + val fieldName = parser.currentName() + parser.nextToken() + when (fieldName) { + LABELS_TAG -> labels = parseItemList(parser) + else -> log.info("$LOG_PREFIX: Trigger Skipping Unknown field $fieldName") + } + } + labels ?: throw IllegalArgumentException("$LABELS_TAG field absent") + return SelectedLabels(labels) + } + } + + /** + * Constructor used in transport action communication. + * @param input StreamInput stream to deserialize data from. + */ + constructor(input: StreamInput) : this( + labels = input.readList(Token.reader) + ) + + /** + * {@inheritDoc} + */ + override fun writeTo(output: StreamOutput) { + output.writeCollection(labels) + } + + /** + * {@inheritDoc} + */ + override fun toXContent(builder: XContentBuilder?, params: ToXContent.Params?): XContentBuilder { + builder!! + if (labels != null) { + builder.startArray(LABELS_TAG) + labels.forEach { it.toXContent(builder, params) } + builder.endArray() + } + builder.endObject() + return builder + } + } } diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt index f5bb609b6..dfaf8f7d2 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt @@ -33,10 +33,8 @@ internal class SavedVisualizationTests { "{\"dataConfig\":\"{}\",\"layoutConfig\":\"{}\"}", "metric", "hours (h)", - SavedQuery.SelectedLabels( - "| fields clientip, bytes, memory, host", - listOf(SavedQuery.Label("utc_time", "timestamp")) - ) + SavedVisualization.SelectedLabels( + listOf(SavedVisualization.Token("avg", "count"))) ) @Test From 1c5dbdae176ad261c9f953e99982eff22d2fe6f8 Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Mon, 31 Oct 2022 12:50:31 -0700 Subject: [PATCH 05/10] update test Signed-off-by: Kavitha Conjeevaram Mohan --- opensearch-observability/build.gradle | 2 +- .../observability/model/SavedVisualization.kt | 9 +++++---- .../observability/model/SavedVisualizationTests.kt | 11 ++++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/opensearch-observability/build.gradle b/opensearch-observability/build.gradle index 92935fd3a..47fd7d2b5 100644 --- a/opensearch-observability/build.gradle +++ b/opensearch-observability/build.gradle @@ -10,7 +10,7 @@ import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask buildscript { ext { isSnapshot = "true" == System.getProperty("build.snapshot", "true") - opensearch_version = System.getProperty("opensearch.version", "2.2.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "2.4.0-SNAPSHOT") buildVersionQualifier = System.getProperty("build.version_qualifier", "") version_tokens = opensearch_version.tokenize('-') opensearch_build = version_tokens[0] + '.0' diff --git a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt index d34be7f23..608546c5c 100644 --- a/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt +++ b/opensearch-observability/src/main/kotlin/org/opensearch/observability/model/SavedVisualization.kt @@ -46,7 +46,7 @@ import org.opensearch.observability.util.logger * "user_configs": "{\"dataConfig\":\"{}\",\"layoutConfig\": \"{}\"}", * "sub_type": "metric", * "units_of_measure: "hours (h)", - * "selected_labels": [ + * "labels": [ * {"label":"avg"}, * {"label":"count"}, * ] @@ -289,7 +289,7 @@ internal data class SavedVisualization( } internal data class SelectedLabels( - val labels: List?, + val labels: List?, ) : BaseModel { internal companion object { private const val LABELS_TAG = "labels" @@ -326,11 +326,11 @@ internal data class SavedVisualization( fun parse(parser: XContentParser): SelectedLabels { var labels: List? = null XContentParserUtils.ensureExpectedToken( - XContentParser.Token.START_OBJECT, + XContentParser.Token.START_ARRAY, parser.currentToken(), parser ) - while (XContentParser.Token.END_OBJECT != parser.nextToken()) { + while (XContentParser.Token.END_ARRAY != parser.nextToken()) { val fieldName = parser.currentName() parser.nextToken() when (fieldName) { @@ -363,6 +363,7 @@ internal data class SavedVisualization( */ override fun toXContent(builder: XContentBuilder?, params: ToXContent.Params?): XContentBuilder { builder!! + builder.startObject() if (labels != null) { builder.startArray(LABELS_TAG) labels.forEach { it.toXContent(builder, params) } diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt index dfaf8f7d2..1d40e2e94 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt @@ -12,8 +12,10 @@ import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.recreateObject import org.opensearch.observability.createObjectFromJsonString import org.opensearch.observability.getJsonString +// import org.opensearch.commons.utils.logger internal class SavedVisualizationTests { + // private val log by logger(SavedVisualizationTests::class.java) private val sampleSavedVisualization = SavedVisualization( "test-saved-visualization", "test description", @@ -34,7 +36,8 @@ internal class SavedVisualizationTests { "metric", "hours (h)", SavedVisualization.SelectedLabels( - listOf(SavedVisualization.Token("avg", "count"))) + listOf(SavedVisualization.Token("avg")) + ) ) @Test @@ -47,13 +50,15 @@ internal class SavedVisualizationTests { fun `SavedVisualization serialize and deserialize using json object should be equal`() { val jsonString = getJsonString(sampleSavedVisualization) val recreatedObject = createObjectFromJsonString(jsonString) { SavedVisualization.parse(it) } + // log.info("sampleSavedVisualization: $sampleSavedVisualization") + // println("recreatedObject: $recreatedObject") assertEquals(sampleSavedVisualization, recreatedObject) } @Test fun `SavedVisualization should deserialize json object using parser`() { val jsonString = - "{\"name\":\"test-saved-visualization\",\"description\":\"test description\",\"query\":\"source=index | where utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\",\"type\":\"bar\",\"selected_date_range\":{\"start\":\"now/15m\",\"end\":\"now\",\"text\":\"utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\"},\"selected_timestamp\":{\"name\":\"utc_time\",\"type\":\"timestamp\"},\"selected_fields\":{\"text\":\"| fields clientip, bytes, memory, host\",\"tokens\":[{\"name\":\"utc_time\",\"type\":\"timestamp\"}]},\"application_id\":\"KE1Ie34BbsTr-CsB4G6Y\",\"user_configs\":\"{\\\"dataConfig\\\":\\\"{}\\\",\\\"layoutConfig\\\":\\\"{}\\\"}\"}" + "{\"name\":\"test-saved-visualization\",\"description\":\"test description\",\"query\":\"source=index | where utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\",\"type\":\"bar\",\"selected_date_range\":{\"start\":\"now/15m\",\"end\":\"now\",\"text\":\"utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\"},\"selected_timestamp\":{\"name\":\"utc_time\",\"type\":\"timestamp\"},\"selected_fields\":{\"text\":\"| fields clientip, bytes, memory, host\",\"tokens\":[{\"name\":\"utc_time\",\"type\":\"timestamp\"}]},\"application_id\":\"KE1Ie34BbsTr-CsB4G6Y\",\"user_configs\":\"{\\\"dataConfig\\\":\\\"{}\\\",\\\"layoutConfig\\\":\\\"{}\\\"}\",\"sub_type\":\"metric\",\"units_of_measure\":\"hours (h)\",\"labels\":[{\"label\":\"avg\"}]}" val recreatedObject = createObjectFromJsonString(jsonString) { SavedVisualization.parse(it) } assertEquals(sampleSavedVisualization, recreatedObject) } @@ -69,7 +74,7 @@ internal class SavedVisualizationTests { @Test fun `SavedVisualization should safely ignore extra field in json object`() { val jsonString = - "{\"name\":\"test-saved-visualization\",\"description\":\"test description\",\"query\":\"source=index | where utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\",\"type\":\"bar\",\"selected_date_range\":{\"start\":\"now/15m\",\"end\":\"now\",\"text\":\"utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\"},\"selected_timestamp\":{\"name\":\"utc_time\",\"type\":\"timestamp\"},\"selected_fields\":{\"text\":\"| fields clientip, bytes, memory, host\",\"tokens\":[{\"name\":\"utc_time\",\"type\":\"timestamp\"}]},\"application_id\":\"KE1Ie34BbsTr-CsB4G6Y\",\"user_configs\":\"{\\\"dataConfig\\\":\\\"{}\\\",\\\"layoutConfig\\\":\\\"{}\\\"}\"}" + "{\"name\":\"test-saved-visualization\",\"description\":\"test description\",\"query\":\"source=index | where utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\",\"type\":\"bar\",\"selected_date_range\":{\"start\":\"now/15m\",\"end\":\"now\",\"text\":\"utc_time > timestamp('2021-07-01 00:00:00') and utc_time < timestamp('2021-07-02 00:00:00')\"},\"selected_timestamp\":{\"name\":\"utc_time\",\"type\":\"timestamp\"},\"selected_fields\":{\"text\":\"| fields clientip, bytes, memory, host\",\"tokens\":[{\"name\":\"utc_time\",\"type\":\"timestamp\"}]},\"application_id\":\"KE1Ie34BbsTr-CsB4G6Y\",\"user_configs\":\"{\\\"dataConfig\\\":\\\"{}\\\",\\\"layoutConfig\\\":\\\"{}\\\"}\",\"sub_type\":\"metric\",\"units_of_measure\":\"hours (h)\",\"labels\":[{\"label\":\"avg\"}]}" val recreatedObject = createObjectFromJsonString(jsonString) { SavedVisualization.parse(it) } assertEquals(sampleSavedVisualization, recreatedObject) } From 20a9f873f54be804b11624fc8ea906d38f4f7a4a Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Tue, 1 Nov 2022 02:49:49 -0700 Subject: [PATCH 06/10] fix frontend API data Signed-off-by: Kavitha Conjeevaram Mohan --- .../components/common/search/search.test.tsx | 6 ++++++ .../components/common/search/search.tsx | 7 +++++++ .../event_analytics/explorer/explorer.tsx | 21 ++++++++++++++++++- .../save_panel/__tests__/save_panel.test.tsx | 8 ++++++- .../explorer/save_panel/save_panel.tsx | 16 ++++++++++++++ .../event_analytics/saved_objects.ts | 18 ++++++++++++++++ 6 files changed, 74 insertions(+), 2 deletions(-) diff --git a/dashboards-observability/public/components/common/search/search.test.tsx b/dashboards-observability/public/components/common/search/search.test.tsx index 6a7543fec..f204369c4 100644 --- a/dashboards-observability/public/components/common/search/search.test.tsx +++ b/dashboards-observability/public/components/common/search/search.test.tsx @@ -33,6 +33,7 @@ describe('Search bar', () => { const popoverItems = jest.fn(); const isLiveTailOn = jest.fn(); const countDistribution = jest.fn(); + const setMetricLabel = jest.fn(); const utils = render( { popoverItems={popoverItems} isLiveTailOn={isLiveTailOn} countDistribution={countDistribution} + curVisId={'line'} + spanValue={false} + setSubType={'metric'} + setMetricMeasure={'hours (h)'} + setMetricLabel={setMetricLabel} /> ); diff --git a/dashboards-observability/public/components/common/search/search.tsx b/dashboards-observability/public/components/common/search/search.tsx index a714dfa94..d726c9b80 100644 --- a/dashboards-observability/public/components/common/search/search.tsx +++ b/dashboards-observability/public/components/common/search/search.tsx @@ -85,6 +85,9 @@ export const Search = (props: any) => { searchError = null, curVisId, spanValue, + setSubType, + setMetricMeasure, + setMetricLabel, } = props; const appLogEvents = tabId.match(APP_ANALYTICS_TAB_ID_REGEX); @@ -216,9 +219,13 @@ export const Search = (props: any) => { showOptionList={ showSavePanelOptionsList && searchBarConfigs[selectedSubTabId]?.showSavePanelOptionsList + } curVisId={curVisId} spanValue={spanValue} + setSubType={setSubType} + setMetricMeasure={setMetricMeasure} + setMetricLabel={setMetricLabel} /> diff --git a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx index d63dee0c3..7d3f2cf6e 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx @@ -150,13 +150,16 @@ export const Explorer = ({ const [liveTailTabId, setLiveTailTabId] = useState(TAB_EVENT_ID); const [liveTailName, setLiveTailName] = useState('Live'); const [liveHits, setLiveHits] = useState(0); - const [browserTabFocus, setBrowserTabFocus] = useState(true); + const [browserTabFocus, setBrowserTabFocus] = useState(''); const [liveTimestamp, setLiveTimestamp] = useState(DATE_PICKER_FORMAT); const [triggerAvailability, setTriggerAvailability] = useState(false); const [isValidDataConfigOptionSelected, setIsValidDataConfigOptionSelected] = useState( false ); const [spanValue, setSpanValue] = useState(false); + const [subType, setSubType] = useState(''); + const [metricMeasure, setMetricMeasure] = useState(''); + const [metricLabel, setMetricLabel] = useState([]); const queryRef = useRef(); const appBasedRef = useRef(''); appBasedRef.current = appBaseQuery; @@ -1094,6 +1097,9 @@ export const Explorer = ({ const vizDescription = userVizConfigs[curVisId]?.dataConfig?.panelOptions?.description || ''; const isTabMatchingSavedType = isEqual(currQuery![SAVED_OBJECT_TYPE], SAVED_VISUALIZATION); if (!isEmpty(currQuery![SAVED_OBJECT_ID]) && isTabMatchingSavedType) { + console.log("subType viz: ", subType); + console.log("metricMeasure viz: ", metricMeasure); + console.log("metricLabel viz: ", metricLabel); savingVisRes = await savedObjects .updateSavedVisualizationById({ query: buildQuery(appBaseQuery, currQuery![RAW_QUERY]), @@ -1107,6 +1113,9 @@ export const Explorer = ({ ? JSON.stringify(userVizConfigs[curVisId]) : JSON.stringify({}), description: vizDescription, + subType: subType, + unitsOfMeasure: metricMeasure, + selectedLabels: metricLabel }) .then((res: any) => { setToast( @@ -1128,6 +1137,9 @@ export const Explorer = ({ }); } else { // create new saved visualization + console.log("subType viz: ", subType); + console.log("metricMeasure viz: ", metricMeasure); + console.log("metricLabel viz: ", metricLabel); savingVisRes = await savedObjects .createSavedVisualization({ query: buildQuery(appBaseQuery, currQuery![RAW_QUERY]), @@ -1141,6 +1153,9 @@ export const Explorer = ({ ? JSON.stringify(userVizConfigs[curVisId]) : JSON.stringify({}), description: vizDescription, + subType: subType, + unitsOfMeasure: metricMeasure, + selectedLabels: metricLabel }) .then((res: any) => { batch(() => { @@ -1284,6 +1299,7 @@ export const Explorer = ({ const statsTokens = queryManager.queryParser().parse(tempQuery).getStats(); const updatedDataConfig = getUpdatedDataConfig(statsTokens); setSpanValue(!isEqual(typeof updatedDataConfig.span, 'undefined')); + // console.log("span value: ", (!isEqual(typeof updatedDataConfig.span, 'undefined'))); }, [tempQuery, query, selectedContentTabId]); return ( @@ -1342,6 +1358,9 @@ export const Explorer = ({ searchError={explorerVisualizations} curVisId={curVisId} spanValue={spanValue} + setSubType={setSubType} + setMetricMeasure={setMetricMeasure} + setMetricLabel={setMetricLabel} /> { it('Renders saved query table', async () => { const handleNameChange = jest.fn(); const handleOptionChange = jest.fn(); + const setMetricLabel = jest.fn(); const savedObjects = new SavedObjects(httpClientMock); const wrapper = mount( @@ -28,7 +29,12 @@ describe('Saved query table component', () => { savedObjects={savedObjects} savePanelName={'Count by depature'} showOptionList={true} - /> + curVisId={'line'} + spanValue={false} + setSubType={'metric'} + setMetricMeasure={'hours (h)'} + setMetricLabel={setMetricLabel} + /> ); wrapper.update(); diff --git a/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx b/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx index e8c8f5b8e..931d98505 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx @@ -27,6 +27,9 @@ interface ISavedPanelProps { showOptionList: boolean; curVisId: string; spanValue: boolean; + setSubType: any; + setMetricMeasure: any; + setMetricLabel: any; } interface CustomPanelOptions { @@ -45,6 +48,9 @@ export const SavePanel = ({ showOptionList, curVisId, spanValue, + setSubType, + setMetricMeasure, + setMetricLabel, }: ISavedPanelProps) => { const [options, setOptions] = useState([]); const [checked, setChecked] = useState(false); @@ -67,14 +73,24 @@ export const SavePanel = ({ const onToggleChange = (e: { target: { checked: React.SetStateAction } }) => { setChecked(e.target.checked); + // console.log("e.target.checked: ",e.target.checked); + if (e.target.checked) { + setSubType("metric") + } else { + setSubType("visualization") + } }; const onMeasureChange = (selectedMeasures: React.SetStateAction) => { setMeasure(selectedMeasures); + // const obj = JSON.parse(selectedMeasures); + // console.log("selectedMeasures in options: ", selectedMeasures[0].label); + setMetricMeasure(selectedMeasures[0].label); }; const onLabelChange = (selectedLabels: React.SetStateAction) => { setLabel(selectedLabels); + setMetricLabel(selectedLabels); }; return ( diff --git a/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts b/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts index 880aad65c..a673f9ff7 100644 --- a/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts +++ b/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts @@ -57,6 +57,9 @@ export default class SavedObjects { description = '', applicationId = '', userConfigs = '', + subType = '', + unitsOfMeasure = '', + selectedLabels, }: any) { const objRequest: any = { object: { @@ -76,6 +79,7 @@ export default class SavedObjects { }, name: name || '', description: description || '', + subType, }, }; @@ -91,6 +95,14 @@ export default class SavedObjects { objRequest.object.user_configs = userConfigs; } + if (!isEmpty(unitsOfMeasure)) { + objRequest.object.unit_of_measure = unitsOfMeasure; + } + + if (!isEmpty(selectedLabels)) { + objRequest.object.selected_labels = selectedLabels; + } + return objRequest; } @@ -167,6 +179,9 @@ export default class SavedObjects { timestamp: params.timestamp, userConfigs: params.userConfigs, description: params.description, + subType: params.subType, + unitsOfMeasure: params.unitsOfMeasure, + selectedLabels: params.selectedLabels }); finalParams.object_id = params.objectId; @@ -227,6 +242,9 @@ export default class SavedObjects { applicationId: params.applicationId, userConfigs: params.userConfigs, description: params.description, + subType: params.subType, + unitsOfMeasure: params.unitsOfMeasure, + selectedLabels: params.selectedLabels }); return await this.http.post( From e36c73b046e0e3036859cb0067f3d1b278814810 Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Tue, 1 Nov 2022 02:58:19 -0700 Subject: [PATCH 07/10] update default subtype state to viz Signed-off-by: Kavitha Conjeevaram Mohan --- .../public/components/event_analytics/explorer/explorer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx index 7d3f2cf6e..797807f65 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx @@ -157,7 +157,7 @@ export const Explorer = ({ false ); const [spanValue, setSpanValue] = useState(false); - const [subType, setSubType] = useState(''); + const [subType, setSubType] = useState('visualization'); const [metricMeasure, setMetricMeasure] = useState(''); const [metricLabel, setMetricLabel] = useState([]); const queryRef = useRef(); From 322b929bfd9c3ddaccbbb68fc694f69dba90cce4 Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Tue, 1 Nov 2022 11:51:04 -0700 Subject: [PATCH 08/10] disabling labels on front end Signed-off-by: Kavitha Conjeevaram Mohan --- .../components/event_analytics/explorer/explorer.tsx | 4 ++-- .../event_analytics/explorer/save_panel/save_panel.tsx | 8 ++++---- .../saved_objects/event_analytics/saved_objects.ts | 9 ++++++--- .../routes/event_analytics/event_analytics_router.ts | 4 ++-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx index 797807f65..5292bd18f 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx @@ -1115,7 +1115,7 @@ export const Explorer = ({ description: vizDescription, subType: subType, unitsOfMeasure: metricMeasure, - selectedLabels: metricLabel + // selectedLabels: metricLabel }) .then((res: any) => { setToast( @@ -1155,7 +1155,7 @@ export const Explorer = ({ description: vizDescription, subType: subType, unitsOfMeasure: metricMeasure, - selectedLabels: metricLabel + // selectedLabels: metricLabel }) .then((res: any) => { batch(() => { diff --git a/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx b/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx index 931d98505..24b184175 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx @@ -165,11 +165,11 @@ export const SavePanel = ({ data-test-subj="eventExplorer__metricMeasureSaveComboBox" /> - + {/*

{'Labels'}

-
- + */} + {/* - + */} )} diff --git a/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts b/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts index a673f9ff7..0f207ab79 100644 --- a/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts +++ b/dashboards-observability/public/services/saved_objects/event_analytics/saved_objects.ts @@ -79,7 +79,6 @@ export default class SavedObjects { }, name: name || '', description: description || '', - subType, }, }; @@ -95,14 +94,18 @@ export default class SavedObjects { objRequest.object.user_configs = userConfigs; } + if (!isEmpty(subType)) { + objRequest.object.sub_type = subType; + } + if (!isEmpty(unitsOfMeasure)) { - objRequest.object.unit_of_measure = unitsOfMeasure; + objRequest.object.units_of_measure = unitsOfMeasure; } if (!isEmpty(selectedLabels)) { objRequest.object.selected_labels = selectedLabels; } - + return objRequest; } diff --git a/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts b/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts index 6291fd2a6..c2fd7c2d2 100644 --- a/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts +++ b/dashboards-observability/server/routes/event_analytics/event_analytics_router.ts @@ -140,7 +140,7 @@ export const registerEventAnalyticsRouter = ({ application_id: schema.maybe(schema.string()), user_configs: schema.string(), sub_type: schema.string(), - unit_of_measure: schema.maybe(schema.string()), + units_of_measure: schema.maybe(schema.string()), selected_labels: schema.maybe(schema.object({ label: schema.arrayOf(schema.object({}, { unknowns: 'allow' })), })), @@ -232,7 +232,7 @@ export const registerEventAnalyticsRouter = ({ application_id: schema.maybe(schema.string()), user_configs: schema.string(), sub_type: schema.string(), - unit_of_measure: schema.maybe(schema.string()), + units_of_measure: schema.maybe(schema.string()), selected_labels: schema.maybe(schema.object({ labels: schema.arrayOf(schema.object({}, { unknowns: 'allow' })), })), From 1dfbda313b155e29ad7432b05aba54ebbd2ef519 Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Tue, 1 Nov 2022 11:56:15 -0700 Subject: [PATCH 09/10] remove console.log comments Signed-off-by: Kavitha Conjeevaram Mohan --- .../components/event_analytics/explorer/explorer.tsx | 9 +-------- .../event_analytics/explorer/save_panel/save_panel.tsx | 3 --- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx index 5292bd18f..d2c3ff241 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx @@ -150,7 +150,7 @@ export const Explorer = ({ const [liveTailTabId, setLiveTailTabId] = useState(TAB_EVENT_ID); const [liveTailName, setLiveTailName] = useState('Live'); const [liveHits, setLiveHits] = useState(0); - const [browserTabFocus, setBrowserTabFocus] = useState(''); + const [browserTabFocus, setBrowserTabFocus] = useState(true); const [liveTimestamp, setLiveTimestamp] = useState(DATE_PICKER_FORMAT); const [triggerAvailability, setTriggerAvailability] = useState(false); const [isValidDataConfigOptionSelected, setIsValidDataConfigOptionSelected] = useState( @@ -1097,9 +1097,6 @@ export const Explorer = ({ const vizDescription = userVizConfigs[curVisId]?.dataConfig?.panelOptions?.description || ''; const isTabMatchingSavedType = isEqual(currQuery![SAVED_OBJECT_TYPE], SAVED_VISUALIZATION); if (!isEmpty(currQuery![SAVED_OBJECT_ID]) && isTabMatchingSavedType) { - console.log("subType viz: ", subType); - console.log("metricMeasure viz: ", metricMeasure); - console.log("metricLabel viz: ", metricLabel); savingVisRes = await savedObjects .updateSavedVisualizationById({ query: buildQuery(appBaseQuery, currQuery![RAW_QUERY]), @@ -1137,9 +1134,6 @@ export const Explorer = ({ }); } else { // create new saved visualization - console.log("subType viz: ", subType); - console.log("metricMeasure viz: ", metricMeasure); - console.log("metricLabel viz: ", metricLabel); savingVisRes = await savedObjects .createSavedVisualization({ query: buildQuery(appBaseQuery, currQuery![RAW_QUERY]), @@ -1299,7 +1293,6 @@ export const Explorer = ({ const statsTokens = queryManager.queryParser().parse(tempQuery).getStats(); const updatedDataConfig = getUpdatedDataConfig(statsTokens); setSpanValue(!isEqual(typeof updatedDataConfig.span, 'undefined')); - // console.log("span value: ", (!isEqual(typeof updatedDataConfig.span, 'undefined'))); }, [tempQuery, query, selectedContentTabId]); return ( diff --git a/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx b/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx index 24b184175..5f132bab9 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/save_panel/save_panel.tsx @@ -73,7 +73,6 @@ export const SavePanel = ({ const onToggleChange = (e: { target: { checked: React.SetStateAction } }) => { setChecked(e.target.checked); - // console.log("e.target.checked: ",e.target.checked); if (e.target.checked) { setSubType("metric") } else { @@ -83,8 +82,6 @@ export const SavePanel = ({ const onMeasureChange = (selectedMeasures: React.SetStateAction) => { setMeasure(selectedMeasures); - // const obj = JSON.parse(selectedMeasures); - // console.log("selectedMeasures in options: ", selectedMeasures[0].label); setMetricMeasure(selectedMeasures[0].label); }; From 9b899a752722e3ebd2331c8e5365e9fe31c231ee Mon Sep 17 00:00:00 2001 From: Kavitha Conjeevaram Mohan Date: Tue, 1 Nov 2022 11:57:37 -0700 Subject: [PATCH 10/10] remove logger comments Signed-off-by: Kavitha Conjeevaram Mohan --- .../opensearch/observability/model/SavedVisualizationTests.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt index 1d40e2e94..568ac15cd 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/model/SavedVisualizationTests.kt @@ -12,10 +12,8 @@ import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.recreateObject import org.opensearch.observability.createObjectFromJsonString import org.opensearch.observability.getJsonString -// import org.opensearch.commons.utils.logger internal class SavedVisualizationTests { - // private val log by logger(SavedVisualizationTests::class.java) private val sampleSavedVisualization = SavedVisualization( "test-saved-visualization", "test description", @@ -50,8 +48,6 @@ internal class SavedVisualizationTests { fun `SavedVisualization serialize and deserialize using json object should be equal`() { val jsonString = getJsonString(sampleSavedVisualization) val recreatedObject = createObjectFromJsonString(jsonString) { SavedVisualization.parse(it) } - // log.info("sampleSavedVisualization: $sampleSavedVisualization") - // println("recreatedObject: $recreatedObject") assertEquals(sampleSavedVisualization, recreatedObject) }