Changeset d11c01c for router


Ignore:
Timestamp:
Apr 3, 2018 4:21:01 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
94c7d84
Parents:
1a7e71c
Message:

Stats: Clean up per-tunnel bandwidth stat name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    r1a7e71c rd11c01c  
    1212import java.util.TreeSet;
    1313
     14import net.i2p.data.DataHelper;
    1415import net.i2p.data.Hash;
    1516import net.i2p.data.Lease;
     
    6667        _started = System.currentTimeMillis();
    6768        _lastRateUpdate = _started;
    68         _rateName = "tunnel.Bps." +
    69                     (_settings.isExploratory() ? "exploratory" : _settings.getDestinationNickname()) +
     69        String name;
     70        if (_settings.isExploratory()) {
     71            name = "exploratory";
     72        } else {
     73            name = _settings.getDestinationNickname();
     74            // just strip HTML here rather than escape it everywhere in the console
     75            if (name != null)
     76                name = DataHelper.stripHTML(name);
     77            else
     78                name = _settings.getDestination().toBase32() + ".b32.i2p";
     79        }
     80        _rateName = "tunnel.Bps." + name +
    7081                    (_settings.isInbound() ? ".in" : ".out");
    7182        refreshSettings();
Note: See TracChangeset for help on using the changeset viewer.