Example #1
0
 def test_unique(self):
     l = lt.session_stats_metrics()
     self.assertTrue(len(l) > 40)
     idx = set()
     for m in l:
         self.assertTrue(m.value_index not in idx)
         idx.add(m.value_index)
Example #2
0
 def test_unique(self):
     l = lt.session_stats_metrics()
     self.assertTrue(len(l) > 40)
     idx = set()
     for m in l:
         self.assertTrue(m.value_index not in idx)
         idx.add(m.value_index)
Example #3
0
def main():
    d = Path(__file__).parent

    metrics = dict(
        sorted([(x.name, x.type.name)
                for x in libtorrent.session_stats_metrics()]))

    j = {
        'version': libtorrent.__version__,
        'metrics': metrics,
    }

    with (d / 'libtorrent_metrics.json').open('w') as f:
        json.dump(j, f, indent=2)
def main():
    d = Path(__file__).parent

    metrics = dict(
        sorted([(x.name, x.type.name)
                for x in libtorrent.session_stats_metrics()]))

    j = {
        "version": libtorrent.__version__,
        "metrics": metrics,
    }

    with (d / "libtorrent_metrics.json").open("w") as f:
        json.dump(j, f, indent=2)
Example #5
0
 def test_metrics(self):
     metrics = lt.session_stats_metrics()
     for m in metrics:
         sys.stdout.write('%s %s ' % (m.name, m.type))