Skip to content

[JENKINS-62772] Not able to send data to Influx DB using Groovy Closure #225

Description

@jenkins-infra-bot

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions