tvansteenburgh: Unrelated to your change, but I don't think the `in_relation_hook()` guard on __init__.py:133 is correct. Benchmark.start() is usually called in an action, not a relation, and we want the action_uuid to be set on the relation regardless of when Benchmark.start() is called.
diff --git a/charms/benchmark/__init__.py b/charms/benchmark/__init__.py
index 9a5458e..f0c15c5 100644
--- a/charms/benchmark/__init__.py
+++ b/charms/benchmark/__init__.py
@@ -130,14 +130,14 @@ class Benchmark(object):
         charm_dir = os.environ.get('CHARM_DIR')
         action_uuid = os.environ.get('JUJU_ACTION_UUID')
 
-        if in_relation_hook() and charm_dir and action_uuid:
+        if charm_dir and action_uuid:
             """
             If the cabs-collector charm is installed, take a snapshot
             of the current profile data.
             """
             # Do profile data collection immediately on this unit
             if os.path.exists(COLLECT_PROFILE_DATA):
-                subprocess.check_output([COLLECT_PROFILE_DATA])
+                subprocess.check_output([COLLECT_PROFILE_DATA, action_uuid])
 
             with open(
                 os.path.join(

Action UUID needs to be set explicitly to the collect-profile-data script
diff --git a/tests/test_charms-benchmark.py b/tests/test_charms-benchmark.py
index 3b78034..8528993 100644
--- a/tests/test_charms-benchmark.py
+++ b/tests/test_charms-benchmark.py
@@ -146,7 +146,7 @@ class TestBenchmark(TestCase):
 
         COLLECT_PROFILE_DATA = '/usr/local/bin/collect-profile-data'
         exists.assert_any_call(COLLECT_PROFILE_DATA)
-        check_output.assert_any_call([COLLECT_PROFILE_DATA])
+        check_output.assert_any_call([COLLECT_PROFILE_DATA, 'my_action'])
 
     @mock.patch('charms.benchmark.action_set')
     def test_benchmark_finish(self, action_set):

pip install -e .[dev]
parse_log_pytest
requirements.txt
nose coverage testtools pep8 mock cherrypy pyyaml six pytest
apt-get update apt-get install -y gcc
3.9
test-requires.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
autocommand==2.2.2
backports.tarfile==1.2.0
charmhelpers==1.2.1
-e git+https://github.com/juju-solutions/charms.benchmark.git@df2acf8736cce39d905990fd5008d6afa57863c3#egg=charms.benchmark
cheroot==10.0.1
CherryPy==18.10.0
coverage==7.8.0
exceptiongroup==1.2.2
iniconfig==2.1.0
jaraco.collections==5.1.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
jaraco.text==4.0.0
Jinja2==3.1.6
MarkupSafe==3.0.2
mock==5.2.0
more-itertools==10.6.0
netaddr==1.3.0
nose==1.3.7
packaging==24.2
pbr==6.1.1
pep8==1.7.1
pluggy==1.5.0
portend==3.2.0
pytest==8.3.5
python-dateutil==2.9.0.post0
PyYAML==6.0.2
six==1.17.0
tempora==5.8.0
testtools==2.7.2
tomli==2.2.1
zc.lockfile==3.0.post1

name: charms.benchmark
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - autocommand==2.2.2
      - backports-tarfile==1.2.0
      - charmhelpers==1.2.1
      - cheroot==10.0.1
      - cherrypy==18.10.0
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - jaraco-collections==5.1.0
      - jaraco-context==6.0.1
      - jaraco-functools==4.1.0
      - jaraco-text==4.0.0
      - jinja2==3.1.6
      - markupsafe==3.0.2
      - mock==5.2.0
      - more-itertools==10.6.0
      - netaddr==1.3.0
      - nose==1.3.7
      - packaging==24.2
      - pbr==6.1.1
      - pep8==1.7.1
      - pluggy==1.5.0
      - portend==3.2.0
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.2
      - six==1.17.0
      - tempora==5.8.0
      - testtools==2.7.2
      - tomli==2.2.1
      - zc-lockfile==3.0.post1
prefix: /opt/conda/envs/charms.benchmark

tests/test_charms-benchmark.py::TestBenchmark::test_benchmark_start
tests/test_charms-benchmark.py::TestBenchmark::test_benchmark_finish tests/test_charms-benchmark.py::TestBenchmark::test_benchmark_finish_oserror tests/test_charms-benchmark.py::TestBenchmark::test_benchmark_init tests/test_charms-benchmark.py::TestBenchmark::test_benchmark_meta tests/test_charms-benchmark.py::TestBenchmark::test_benchmark_set_composite_score tests/test_charms-benchmark.py::TestBenchmark::test_benchmark_start_oserror tests/test_charms-benchmark.py::TestBenchmark::test_set_data
charms/benchmark/__init__.py
charms/benchmark/__init__.py