#6 save execution time in extra args instead note
Closed 6 years ago by kparal. Opened 6 years ago by kparal.

file modified
+4 -3
@@ -1,6 +1,7 @@ 

  import os

  import subprocess

  import time

+ import math

  

  from rpmUtils.miscutils import splitFilename

  from libtaskotron import check
@@ -23,12 +24,12 @@ 

      # If no arch specific packages are avilable set ABI result as PASSED

      if ((len(os.listdir(stable_rpmsdir)) == 0) and (len(os.listdir(

                                                      update_rpmsdir)) == 0)):

-         detail.output.append("No architetcure specific packages are available\n");

+         detail.output.append("No architecture specific packages are available\n");

          detail.update_outcome("PASSED")

      else:

          detail.output.append("ABI changes report summary for package update id %s"

                               " against latest stable package in koji\n" % koji_build)

-                          

+ 

          padding = str('=' * 103)

          detail.output.append("%s\n\n" % padding)

          for arch in arches:
@@ -39,7 +40,7 @@ 

          log_file.writelines(detail.output)

      detail.artifact = log_path

      time_taken = time.time() - process_start_time

-     detail.note = "Time taken: " "%s" %(formatted_time(time_taken))

+     detail.keyvals['seconds_taken'] = int(math.ceil(time_taken))

      resultyaml = check.export_YAML(detail)

      return resultyaml

  

Note is very visible for the end user and execution time is distracting
and not useful for them. Save it in extra args. As an added benefit, it
can be used to query results, and it can be easily processed (retrieve
results and then sort them by execution time) without parsing.

Looks fine to me!
One question, how can someone query for seconds_taken by a particular abicheck task from taskotron run? Right now, it can be seen easily from web UI (https://taskotron.fedoraproject.org/resultsdb/results?testcases=dist.abicheck)

I'll merge this to develop and let it generate some results on taskotron-dev. Then I'll show you how to run the queries.

I'll merge this to develop and let it generate some results on taskotron-dev. Then I'll show you how to run the queries.

Perfect!

So, now that we have some data, here's how to easily process them.

You can use the resultsdb api directly to download the json objects and process them yourself, but for the basic use case, I prepared a couple of simple scripts in the qa-misc repo:

$ ./resultsdb-fetch.py --host taskotron-dev dist.abicheck 2017-11-04
Downloading http://taskotron-dev.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.abicheck&since=2017-11-04&limit=100&page=0
Downloading http://taskotron-dev.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.abicheck&since=2017-11-04&limit=100&page=1
Downloading http://taskotron-dev.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.abicheck&since=2017-11-04&limit=100&page=2
Downloading http://taskotron-dev.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.abicheck&since=2017-11-04&limit=100&page=3
Downloading http://taskotron-dev.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.abicheck&since=2017-11-04&limit=100&page=4
Downloading http://taskotron-dev.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.abicheck&since=2017-11-04&limit=100&page=5
Downloading http://taskotron-dev.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.abicheck&since=2017-11-04&limit=100&page=6
Saved results as: results.json

I'm using --host taskotron-dev here because this patch is pushed only to dev atm. Once this is pushed to master, you can leave the option out and it will pull from taskotron production instance.

$ ./resultsdb-print.py results.json data/item id data/seconds_taken  | sort -n -k 3 -r | head
gmsh-3.0.6-1.fc26 17584982 3049
lammps-20171023-1.fc26 17562890 947
vacuum-im-1.3.0-0.3.20171028git6b614da.fc28 17566776 787
cockpit-155-1.fc28 17626026 724
psblas3-3.5.0-13.fc28 17607462 653
psblas3-3.5.0-14.fc28 17616116 635
psblas3-3.5.0-12.fc28 17581083 601
lammps-20171023-1.fc25 17570394 488
cockpit-155-1.fc27 17626075 389
llvm-5.0.0-4.fc28 17563649 380

This prints the longest running jobs (third column, time in seconds) with the package name (first column) and result id (second column, so that you can easily identify and access the full result like this).

Does this work for you? OK to merge this to master?

Thanks Kamil for showing resultdb API query example. It worked for me as well.
Good to go into master branch!

Great :) Pushed to master as f882c6bc2d1c.

Pull-Request has been closed by kparal

6 years ago
Metadata