I am trying to send the data from a groovy map in iterations to influx DB. The data is collected using
def testCaseDuration = ''
def testCaseDetails = [:]
def xmlText = new XmlSlurper().parseText(xml)
xmlText.testsuite.testcase.each { testcase ->
testCaseDuration = testcase['@time'].toString()
testCaseDuration = testCaseDuration.substring(testCaseDuration.lastIndexOf(":") + 1)
testCaseDetails[testcase.@name] = testCaseDuration
}
testCaseDetails.each { testcase, duration ->
println "testCaseDetails in loop: TestCase Name: ${testcase} = TestCase Duratiom ${duration}"
def testField = [:]
def testTag = [:]
def testDataMeasurementFields = [:]
def testDataMeasurementTags = [:]
testField['total'] = testcase
testField['passed'] = duration
testTag['infra'] = 'aws'
testTag['space'] = 'dev'
testDataMeasurementFields['apitest1'] = testField
testDataMeasurementTags['apitest1'] = testTag
influxDbPublisher(selectedTarget: 'jenkins', customDataMap: testDataMeasurementFields,
customDataMapTags: testDataMeasurementTags)
}
The first insertion to influx DB happens and following which it gives the below error
20:14:29 in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@5fe1b10b*20:14:29* Caused: java.io.NotSerializableException: groovy.util.slurpersupport.NodeChild
How do i push the data to influxDB using the loop or closure in jenkins pipeline
Originally reported by karthik_hg, imported from: Not able to send data to Influx DB using Groovy Closure
- assignee: vjuranek
- status: Open
- priority: Blocker
- component(s): groovy-plugin, influxdb-plugin
- resolution: Unresolved
- votes: 0
- watchers: 2
- imported: 20260604-161841
Raw content of original issue
I am trying to send the data from a groovy map in iterations to influx DB. The data is collected using
def testCaseDuration = ''
def testCaseDetails = [:]
def xmlText = new XmlSlurper().parseText(xml)
xmlText.testsuite.testcase.each { testcase ->
testCaseDuration = testcase['@time'].toString()
testCaseDuration = testCaseDuration.substring(testCaseDuration.lastIndexOf(":") + 1)
testCaseDetails[testcase.@name] = testCaseDuration
}
testCaseDetails.each { testcase, duration ->
println "testCaseDetails in loop: TestCase Name: ${testcase} = TestCase Duratiom ${duration}"
def testField = [:]
def testTag = [:]
def testDataMeasurementFields = [:]
def testDataMeasurementTags = [:]
testField['total'] = testcase
testField['passed'] = duration
testTag['infra'] = 'aws'
testTag['space'] = 'dev'
testDataMeasurementFields['apitest1'] = testField
testDataMeasurementTags['apitest1'] = testTag
influxDbPublisher(selectedTarget: 'jenkins', customDataMap: testDataMeasurementFields,
customDataMapTags: testDataMeasurementTags)
}
The first insertion to influx DB happens and following which it gives the below error
20:14:29 in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@5fe1b10b*20:14:29* Caused: java.io.NotSerializableException: groovy.util.slurpersupport.NodeChild
How do i push the data to influxDB using the loop or closure in jenkins pipeline
I am trying to send the data from a groovy map in iterations to influx DB. The data is collected using
The first insertion to influx DB happens and following which it gives the below error
20:14:29 in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@5fe1b10b*20:14:29* Caused: java.io.NotSerializableException: groovy.util.slurpersupport.NodeChild
How do i push the data to influxDB using the loop or closure in jenkins pipeline
Originally reported by karthik_hg, imported from: Not able to send data to Influx DB using Groovy Closure
Raw content of original issue