# Path: tensor/sources/linux/basic.py
# class LoadAverage(Source):
# class DiskIO(Source):
# class CPU(Source):
# class Memory(Source):
# class DiskFree(Source):
# class Network(Source):
#     def _parse_loadaverage(self, data):
#     def get(self):
#     def sshGet(self):
#     def __init__(self, *a, **kw):
#     def _parse_stats(self, stats):
#     def sshGet(self):
#     def _getstats(self):
#     def get(self):
#     def __init__(self, *a):
#     def _read_proc_stat(self):
#     def _calculate_metrics(self, stat):
#     def _transpose_metrics(self, metrics):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, mem):
#     def get(self):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, stats):
#     def _readStats(self):
#     def sshGet(self):
#     def get(self):
# 
# Path: tensor/sources/linux/process.py
# class ProcessCount(Source):
# class ProcessStats(Source):
#     def get(self):
#     def get(self):
# 
# Path: tensor/sources/riak.py
# class RiakStats(Source):
#     def _get_stats_from_node(self):
#     def get(self):
# 
# Path: tensor/sources/nginx.py
# class Nginx(Source):
# class NginxLogMetrics(Source):
# class NginxLog(Source):
#     def _parse_nginx_stats(self, stats):
#     def get(self):
#     def __init__(self, *a):
#     def _aggregate_fields(self, row, b, field, fil=None):
#     def dumpEvents(self, ts):
#     def got_line(self, line):
#     def get(self):
#     def __init__(self, *a):
#     def got_eventlog(self, event):
#     def _parser_proxy(self, line):
#     def get(self):
# 
# Path: tensor/sources/network.py
# class HTTP(Source):
# class Ping(Source):
#     def get(self):
#     def get(self):


import json
import socket
from twisted.trial import unittest
from twisted.internet import defer, endpoints, reactor
from twisted.web import server, static
from tensor.sources.linux import basic, process
from tensor.sources import riak, nginx, network



class TestLinuxSources(unittest.TestCase):
    def skip_if_no_hostname(self):
        try:
            socket.gethostbyaddr(socket.gethostname())
        except socket.herror:
            raise unittest.SkipTest('Unable to get local hostname.')

    def _qb(self, result):
        pass

    def test_basic_cpu(self):
        self.skip_if_no_hostname()

# Path: tensor/sources/linux/basic.py
# class LoadAverage(Source):
# class DiskIO(Source):
# class CPU(Source):
# class Memory(Source):
# class DiskFree(Source):
# class Network(Source):
#     def _parse_loadaverage(self, data):
#     def get(self):
#     def sshGet(self):
#     def __init__(self, *a, **kw):
#     def _parse_stats(self, stats):
#     def sshGet(self):
#     def _getstats(self):
#     def get(self):
#     def __init__(self, *a):
#     def _read_proc_stat(self):
#     def _calculate_metrics(self, stat):
#     def _transpose_metrics(self, metrics):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, mem):
#     def get(self):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, stats):
#     def _readStats(self):
#     def sshGet(self):
#     def get(self):
# 
# Path: tensor/sources/linux/process.py
# class ProcessCount(Source):
# class ProcessStats(Source):
#     def get(self):
#     def get(self):
# 
# Path: tensor/sources/riak.py
# class RiakStats(Source):
#     def _get_stats_from_node(self):
#     def get(self):
# 
# Path: tensor/sources/nginx.py
# class Nginx(Source):
# class NginxLogMetrics(Source):
# class NginxLog(Source):
#     def _parse_nginx_stats(self, stats):
#     def get(self):
#     def __init__(self, *a):
#     def _aggregate_fields(self, row, b, field, fil=None):
#     def dumpEvents(self, ts):
#     def got_line(self, line):
#     def get(self):
#     def __init__(self, *a):
#     def got_eventlog(self, event):
#     def _parser_proxy(self, line):
#     def get(self):
# 
# Path: tensor/sources/network.py
# class HTTP(Source):
# class Ping(Source):
#     def get(self):
#     def get(self):


# Path: tensor/tests/test_sources.py
import json
import socket
from twisted.trial import unittest
from twisted.internet import defer, endpoints, reactor
from twisted.web import server, static
from tensor.sources.linux import basic, process
from tensor.sources import riak, nginx, network




class TestLinuxSources(unittest.TestCase):
    def skip_if_no_hostname(self):
        try:
            socket.gethostbyaddr(socket.gethostname())
        except socket.herror:
            raise unittest.SkipTest('Unable to get local hostname.')

    def _qb(self, result):
        pass

    def test_basic_cpu(self):
        self.skip_if_no_hostname()

        s = basic.CPU(