Consider supporting custom properties in other types than string
Both the build and task custom properties support only strings, which prevents creating graphics based on them.
unsupported input type for mean aggregate: string
I guess, most naive solution by changing type <String, Any> should work and should be most bacnward compatible: https://github.com/cdsap/Talaiot/blob/master/library/core/talaiot/src/main/kotlin/io/github/cdsap/talaiot/entities/ExecutionReport.kt#L101-L102
My metric looks like:
class MyMetric(): GradleMetric<Long>(
provider = { 42l },
assigner = { report, value -> report.customProperties.buildProperties["mymetric"] = value.toString() }
)
thanks @neworld, next week will take a look
Hi @neworld, I have merged #467 supporting <String,Any> for custom metrics.
In the configuration of the plugin you can define:
customBuildMetrics(
"kotlin" to "1.4",
"java" to "8",
"custom" to 3
)
that will produce (json publisher):
"buildProperties": {
"kotlin": "1.4",
"java": "8",
"custom": 3
},
and also support custom SimpleMetrics like:
class MyMetric(): io.github.cdsap.talaiot.metrics.base.GradleMetric<Long>(
provider = { 42L },
assigner = { report, value -> report.customProperties.buildProperties["mymetric"] = value }
)
generating:
"customProperties": {
"buildProperties": {
"mymetric": 42,
"kotlin": "1.4",
"java": "8",
},
It's available already in the 2.0.10-SNAPSHOT and I have plans to publish a new version this week
Thanks! Can't wait to try it
Version 2.1.0 adds support for different value types in metrics
can I close the issue?