Example #1
0
    def setUp(self):
        super(TestMaxProjectVolume, self).setUp()
        require_map_reduce(self.conn)

        self.counters = []
        for i in range(3):
            c = counter.Counter('volume.size',
                                'gauge',
                                'GiB',
                                5 + i,
                                'user-id',
                                'project1',
                                'resource-id-%s' % i,
                                timestamp=datetime.datetime(
                                    2012, 9, 25, 10 + i, 30 + i),
                                resource_metadata={
                                    'display_name': 'test-volume',
                                    'tag': 'self.counter',
                                })
            self.counters.append(c)
            msg = meter.meter_message_from_counter(
                c,
                cfg.CONF.metering_secret,
                'source1',
            )
            self.conn.record_metering_data(msg)
Example #2
0
    def setUp(self):
        super(TestMaxProjectVolume, self).setUp()
        require_map_reduce(self.conn)

        self.counters = []
        for i in range(3):
            c = counter.Counter(
                'volume.size',
                'gauge',
                'GiB',
                5 + i,
                'user-id',
                'project1',
                'resource-id-%s' % i,
                timestamp=datetime.datetime(2012, 9, 25, 10 + i, 30 + i),
                resource_metadata={'display_name': 'test-volume',
                                   'tag': 'self.counter',
                                   }
            )
            self.counters.append(c)
            msg = meter.meter_message_from_counter(c,
                                                   cfg.CONF.metering_secret,
                                                   'source1',
                                                   )
            self.conn.record_metering_data(msg)
Example #3
0
    def setUp(self):
        super(TestSumResourceVolume, self).setUp()
        # TODO(gordc): remove when we drop mim
        if isinstance(self.conn, mongo_conn):
            require_map_reduce(self.conn)

        self.counters = []
        for i in range(3):
            c = counter.Counter(
                'volume.size',
                'gauge',
                'GiB',
                5 + i,
                'user-id',
                'project1',
                'resource-id',
                timestamp=datetime.datetime(2012, 9, 25, 10 + i, 30 + i),
                resource_metadata={'display_name': 'test-volume',
                                   'tag': 'self.counter',
                                   }
            )
            self.counters.append(c)
            msg = rpc.meter_message_from_counter(
                c,
                cfg.CONF.publisher_rpc.metering_secret,
                'source1',
            )
            self.conn.record_metering_data(msg)
Example #4
0
 def setUp(self):
     super(StatisticsTest, self).setUp()
     require_map_reduce(self.conn)
Example #5
0
 def setUp(self):
     super(StatisticsTest, self).setUp()
     require_map_reduce(self.conn)
 def setUp(self):
     super(TestGetEventInterval, self).setUp()
     require_map_reduce(self.conn)