aqa-tests icon indicating copy to clipboard operation
aqa-tests copied to clipboard

Generic logic to get get and store benchmark metric

Open llxia opened this issue 4 months ago • 1 comments
trafficstars

Extend based on https://github.com/adoptium/aqa-tests/pull/6339/, make checkDacapoH2Metric() and archiveDacapoH2Metric() generic.

On second thought, it may be better to have a separate script (i.e., Python - benchmarkMetric,py) to handle this.

  • In benchmarkMetric.py, it contains a generic function checkMetric(). checkMetric() takes job console output and reads benchmarkMetric.json and runs each regex, and stores into one JSON output.

benchmarkMetric.json example:

[
    {
        "Benchmark": "dacapo-eclipse",
        "metrics": 
        {
          "dacapo-eclipse" : [
            {"regex": "DaCapo.*eclipse\\sPASSED\\sin\\s(\\d*\\.?\\d*)\\smsec"},
            {"higherbetter": true},
            {"units": "msec"}
        ]
      }
    },
{
        "Benchmark": "dacapo-h2",
        "metrics": 
        {
          "dacapo-h2" : [
            {"regex": "DaCapo.*h2\\sPASSED\\sin\\s(\\d*\\.?\\d*)\\smsec"},
            {"higherbetter": true},
            {"units": "msec"}
        ]
      }
    }
]

Note: Backslashes must be double-escaped (\\) in JSON strings.

Output: JSON file as specified in https://github.com/adoptium/aqa-tests/issues/6327. For example:

[
    {
        "Benchmark": "dacapo-eclipse",
        "metrics": 
        {
          "dacapo-eclipse" : [ 
            {"value": "123456"},
            {"higherbetter": true},
            {"units": "msec"}
        ]
      }
    },
{
        "Benchmark": "dacapo-h2",
        "metrics": 
        {
          "dacapo-h2" : [
            {"value": "4689"},
            {"higherbetter": true},
            {"units": "msec"}
        ]
      }
    }
]

related: https://github.com/adoptium/aqa-tests/issues/6327

top level issue: https://github.com/adoptium/aqa-tests/issues/6268

@smlambert @LongyuZhang if I missed anything, please feel free to update.

llxia avatar Jun 23 '25 13:06 llxia

For getting console output, try myjob.getRawBuild().getLog()

https://stackoverflow.com/questions/31521030/output-the-console-text-of-a-jenkins-job-that-my-job-is-running https://stackoverflow.com/questions/42510489/console-output-in-pipelinejenkins

llxia avatar Jun 27 '25 14:06 llxia

Hi, may I work on this?

MattyWeee123 avatar Jul 03 '25 16:07 MattyWeee123

In RHEL9 (LABEL: ci.role.test&&hw.arch.x86&&sw.os.linux&&sw.os.rhel.9), python is installed.

00:00:03.191  + python --version
00:00:03.191  Python 3.9.21

Internal job

There is no RHEL9 at Adoptium. @smlambert do you happen to know which machine has python installed by default?

llxia avatar Jul 03 '25 17:07 llxia

There is no RHEL9 at Adoptium. @smlambert do you happen to know which machine has python installed by default?

Possibly this one (which I think is recently added and still needs to have an updated label to suit our labeling schema)? test-rhibmcloud-rhel9-x64-1

smlambert avatar Jul 04 '25 03:07 smlambert

@smlambert could I have permission to use currentBuild.rawBuild.getLog()

Image

MattyWeee123 avatar Jul 08 '25 15:07 MattyWeee123

In script approval is done now for getLog() if you want to try again @MattyWeee123 !

smlambert avatar Jul 08 '25 15:07 smlambert