Example #1
0
def carbon_list():
    parser = common_parser('List the metrics this carbon node contains')

    parser.add_argument('-d',
                        '--storage-dir',
                        default='/opt/graphite/storage/whisper',
                        help='Storage dir')

    args = parser.parse_args()

    try:
        for m in listMetrics(args.storage_dir):
            print m
    except IOError as e:
        if e.errno == errno.EPIPE:
            pass  # we got killed, lol
        else:
            raise SystemExit(e)
    except KeyboardInterrupt:
        sys.exit(1)
Example #2
0
 def test_list_with_trailing_slash(self):
     res = sorted(list(listMetrics(self.rootdir + '/')))
     self.assertEqual(res, self.expected_metrics)
Example #3
0
 def test_list(self):
     res = sorted(list(listMetrics(self.rootdir)))
     self.assertEqual(res, self.expected_metrics)
Example #4
0
 def test_list_withsym(self):
     res = sorted(list(listMetrics(self.rootdir, True)))
     self.assertEqual(res, self.expected_metrics_withsym)
Example #5
0
 def test_list_with_trailing_slash(self):
     res = sorted(list(listMetrics(self.rootdir + "/")))
     self.assertEqual(res, self.expected_metrics)
Example #6
0
 def test_list(self):
     res = sorted(list(listMetrics(self.rootdir)))
     self.assertEqual(res, self.expected_metrics)
Example #7
0
 def test_list_withsym(self):
     res = sorted(list(listMetrics(self.rootdir, True)))
     self.assertEqual(res, self.expected_metrics_withsym)