# Path: collectors/lib/docker_engine/metric.py
# class Metric(object):
#     def __init__(self, name, etime, value, tags=None):
#         self.name = name
#         self.value = value
#         self.event_time = etime
#         if tags is None:
#             self.dims = set([])
#         else:
#             self.dims = set(tags)
#         self.dims.update(set(DEFAULT_DIMS))
# 
#     def add_dims(self, dims):
#         self.dims.update(set(dims))
# 
#     def get_metric_lines(self):
#         """ return in OpenTSDB format
#         <name> <time_epoch> <value> [key=val] [key1=val1]...
#         """
#         m = "%s %s %s" % (self.name, int(time.mktime(self.event_time)), self.value)
#         return "%s %s" % (m, " ".join(sorted(list(self.dims))))


import unittest
import time
from unittest import TestCase
from collectors.lib.docker_engine.metric import Metric
#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2010-2013  The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.  This program is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.  You should have received a copy
# of the GNU Lesser General Public License along with this program.  If not,
# see <http://www.gnu.org/licenses/>.





class TestMetric(TestCase):

    def setUp(self):
        self.now = time.gmtime()

# Path: collectors/lib/docker_engine/metric.py
# class Metric(object):
#     def __init__(self, name, etime, value, tags=None):
#         self.name = name
#         self.value = value
#         self.event_time = etime
#         if tags is None:
#             self.dims = set([])
#         else:
#             self.dims = set(tags)
#         self.dims.update(set(DEFAULT_DIMS))
# 
#     def add_dims(self, dims):
#         self.dims.update(set(dims))
# 
#     def get_metric_lines(self):
#         """ return in OpenTSDB format
#         <name> <time_epoch> <value> [key=val] [key1=val1]...
#         """
#         m = "%s %s %s" % (self.name, int(time.mktime(self.event_time)), self.value)
#         return "%s %s" % (m, " ".join(sorted(list(self.dims))))


# Path: collectors/test/docker_engine/test_metric.py
import unittest
import time
from unittest import TestCase
from collectors.lib.docker_engine.metric import Metric

#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2010-2013  The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.  This program is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.  You should have received a copy
# of the GNU Lesser General Public License along with this program.  If not,
# see <http://www.gnu.org/licenses/>.





class TestMetric(TestCase):

    def setUp(self):
        self.now = time.gmtime()

        self.metric = Metric("metric", self.now, 10)