~hloeung/ubuntu-repository-cache/peer-sync-metric-dest-2

« back to all changes in this revision

Viewing changes to lib/ubuntu_repository_cache/mirror.py

  • Committer: mergebot at canonical
  • Author(s): "Haw Loeung"
  • Date: 2022-08-28 23:27:55 UTC
  • mfrom: (386.1.1 ubuntu-repository-cache)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20220828232755-i29c3o2h2uhwzko6
Tags: rev49
Include sync destination in peer failures metric

Reviewed-on: https://code.launchpad.net/~hloeung/ubuntu-repository-cache/peer-sync-metric-dest/+merge/429030
Reviewed-by: Thomas Cuthbert <thomas.cuthbert@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
        LOG('Syncing {} to {} ({}) {}.'.format(source_dir, peer_unit, peer_addr, rsync_dest))
88
88
 
89
89
        metric_name = 'ubuntu_repository_cache_metadata_sync_peers_failures'
90
 
        label = 'peer={}'.format(peer_unit)
 
90
        # Can be /srv/ubuntu-repository-cache/apache/data/ubuntu_2022-08-28_21:48:02_u0/, so strip trailing slash.
 
91
        label = 'peer={},dest={}'.format(peer_unit, os.path.basename(dest_dir.rstrip('/')))
91
92
        failures = 0
92
93
 
93
94
        errmsgs = []