コード例 #1
0
ファイル: tests.py プロジェクト: cmiller8/rainmon
 def setUp(self):
     cfg = getconfig()
     self.tmpdir = cfg["tmpdir"][3:]
     self.cacheloc = os.path.join(self.tmpdir, "cache", "unittest-cache")
     self.pipe = get_default_pipeline()
     self.pipe.set_skipstages(["KalmanStage","DrawStage"])
     output = self.pipe.run(get_compress_input())
     ca = Cache(self.cacheloc)
     ca.write(output)
コード例 #2
0
ファイル: tests.py プロジェクト: nebgor/rainmon
 def setUp(self):
     cfg = getconfig()
     self.tmpdir = cfg["tmpdir"][3:]
     self.cacheloc = os.path.join(self.tmpdir, "cache", "unittest-cache")
     self.pipe = get_default_pipeline()
     self.pipe.set_skipstages(["KalmanStage", "DrawStage"])
     output = self.pipe.run(get_compress_input())
     ca = Cache(self.cacheloc)
     ca.write(output)
コード例 #3
0
ファイル: tests.py プロジェクト: nebgor/rainmon
 def test_cache(self):
     ca = Cache(self.cacheloc)
     self.assertIsNone(ca.getstatus())
     content = set(ca.getcontents())
     for i in xrange(3):
         self.assertIn("hv.%d" % i, content)
     for i in xrange(1, 30):
         for base in [("cloud%d.iostat.disk.write_requests" % i),
                      ("cloud%d.iostat.disk.read_requests" % i)]:
             self.assertIn(base + ".spikes", content)
             self.assertIn(base + ".smooth", content)
コード例 #4
0
ファイル: tests.py プロジェクト: cmiller8/rainmon
 def test_cache(self):
     ca = Cache(self.cacheloc)
     self.assertIsNone(ca.getstatus())
     content = set(ca.getcontents())
     for i in xrange(3):
         self.assertIn("hv.%d" % i, content)
     for i in xrange(1, 30):
         for base in [
             ("cloud%d.iostat.disk.write_requests" % i),
             ("cloud%d.iostat.disk.read_requests" % i)]:
             self.assertIn(base + ".spikes", content)
             self.assertIn(base + ".smooth", content)
コード例 #5
0
ファイル: run_abilene.py プロジェクト: cmiller8/rainmon
        narr = str(n[0][0]).split("-")
        tsnames.append(narr[1] + "." + narr[0])
    input['ts_names'] = tsnames

    output = pipeline.run(input)

    W = output['projection']
    num_hvs = output['maxhvs']
    index = 0

    #dumpoutput = [[[],[],[],darr] for darr in output['data'].T]
    dumpoutput = output['data']
    origoutput = output['data']
    output['data'] = dumpoutput
    outdir = "../etc/tmp/cache/abilene"
    cache = Cache(outdir)
    cache.write(output)

    output['data'] = origoutput

    #plot all timeseries
    #for i in numpy.arange(num_nodes):
    #    pylab.clf()
    #    pylab.plot(numpy.arange(X[:,i].size)+1,X[:,i])
    #     pylab.title("Plot of node flow " + str(i))
    #     pylab.savefig(os.path.join('../etc/tmp/abilene_scatter',str(i)+".png"))

    fig = pylab.figure()
    fig.subplots_adjust(left=0.15)
    ax = fig.add_subplot(111)
    MSIZE = 7
コード例 #6
0
        narr = str(n[0][0]).split("-")
        tsnames.append(narr[1] + "." + narr[0])
    input['ts_names'] = tsnames

    output = pipeline.run(input)

    W = output['projection']
    num_hvs = output['maxhvs']
    index = 0

    #dumpoutput = [[[],[],[],darr] for darr in output['data'].T]
    dumpoutput = output['data']
    origoutput = output['data']
    output['data'] = dumpoutput
    outdir = "../etc/tmp/cache/abilene"
    cache = Cache(outdir)
    cache.write(output)

    output['data'] = origoutput

    #plot all timeseries
    #for i in numpy.arange(num_nodes):
    #    pylab.clf()
    #    pylab.plot(numpy.arange(X[:,i].size)+1,X[:,i])
    #     pylab.title("Plot of node flow " + str(i))
    #     pylab.savefig(os.path.join('../etc/tmp/abilene_scatter',str(i)+".png"))

    fig = pylab.figure()
    fig.subplots_adjust(left=0.15)
    ax = fig.add_subplot(111)
    MSIZE = 7
コード例 #7
0
ファイル: run_cmudotnet.py プロジェクト: nebgor/rainmon
        sys.path.append(os.path.abspath("ganglia"))
        from cmuserver import start_rrdserve
        from cmurrd import get_cmu

        def startserver(serverref,*args):
            #start the RRD server
            start_rrdserve(get_cmu(),serverref=serverref)
        t = Thread(None, startserver, "Server", (serverref,None))
        t.start()

        #potentially flaky. Won't work on Windows, but neither will rrdtool at the moment
        myip = commands.getoutput("ifconfig").split("\n")[1].split()[1].split(":")[1]
        pipe = get_default_pipeline(host=myip)
    except:
        traceback.print_exc()
        #note: if RRDtool is not available on this machine this can be pointed to a remote host
        pipe = get_default_pipeline(host="172.19.149.159")

    input = dict()
    input["hosts"] = ["CMU-West", "LocalMachine", "NewYork", "PSU", "QatarExternal", "Qatar"]
    input["start"] = "2011/12/28-15:00:00"
    input["end"] = "2012/1/18-18:50:00"
    input["metrics"] = ["median"]
    output = pipe.run(input)
    cache = Cache("../etc/tmp/cache/cmu-dot-net")
    cache.write(output)

    server = serverref["server"]
    if server is not None:
        server.shutdown()
    sys.exit(1)