コード例 #1
0
ファイル: client.py プロジェクト: Hopethisworks/urllib4
    def async_perform(self, request, finish_callback, pipeline=None, progress_callback=None):
        if pipeline is None:
            pipeline = self.pipeline

        if pipeline is None:
            pipeline = get_default_pipeline()

        self.prepare(request, progress_callback)

        def onfinish(client, errno, errmsg):
            self._cleanup()

            response = self.postmortem(request)

            finish_callback(response, errno, errmsg)

        pipeline.add(self, onfinish)
コード例 #2
0
def run_hadoop(horizon):
	pipe = pipeline.get_default_pipeline()
	pipe.get_stages('KalmanStage')[0].lookahead_flag = 0
	pipe.get_stages('KalmanStage')[0].step_size = horizon

	input = {} 
	input['hosts'] = []
	for i in range(1, 65):
	    input['hosts'].append('cloud%d'%(i))

	#compression cache
	#input['start'] = '2011/11/22-15:00:00'
	#input['end'] = '2011/11/24-23:45:00'
	#metrics = ['iostat.disk.read_requests',
	#           'iostat.disk.write_requests',
	#            ]
	#input['metrics'] = metrics

	#cache a6af2b8bca225f6d8f99d832beec6d16
	input['start'] = '2011/10/11-10:00:00'
	input['end'] = '2011/10/16-10:00:00'
	metrics = ['iostat.disk.read_requests',
			   'iostat.disk.write_requests',
			   'iostat.disk.write_sectors',
			   'proc.meminfo.buffers',
			   'proc.meminfo.cached',
			   'proc.stat.cpu,type.system',
			   'proc.stat.cpu,type.user',
			   'proc.stat.cpu,type.iowait',
			   'proc.stat.cpu,type.nice',
			   'proc.net.bytes,direction.in',
			   'proc.net.bytes,direction.out',
			   'proc.net.packets,direction.in',
			   'proc.net.packets,direction.out',
			   'proc.stat.intr'
			   ]
	metrics = ['iostat.disk.read_requests',
	           'iostat.disk.write_requests',
	           'proc.meminfo.buffers',
	           'proc.meminfo.cached']
	input['metrics'] = metrics

	return pipe.run(input)	
コード例 #3
0
def run_hadoop(horizon):
    pipe = pipeline.get_default_pipeline()
    pipe.get_stages('KalmanStage')[0].lookahead_flag = 0
    pipe.get_stages('KalmanStage')[0].step_size = horizon

    input = {}
    input['hosts'] = []
    for i in range(1, 65):
        input['hosts'].append('cloud%d' % (i))

    #compression cache
    #input['start'] = '2011/11/22-15:00:00'
    #input['end'] = '2011/11/24-23:45:00'
    #metrics = ['iostat.disk.read_requests',
    #           'iostat.disk.write_requests',
    #            ]
    #input['metrics'] = metrics

    #cache a6af2b8bca225f6d8f99d832beec6d16
    input['start'] = '2011/10/11-10:00:00'
    input['end'] = '2011/10/16-10:00:00'
    metrics = [
        'iostat.disk.read_requests', 'iostat.disk.write_requests',
        'iostat.disk.write_sectors', 'proc.meminfo.buffers',
        'proc.meminfo.cached', 'proc.stat.cpu,type.system',
        'proc.stat.cpu,type.user', 'proc.stat.cpu,type.iowait',
        'proc.stat.cpu,type.nice', 'proc.net.bytes,direction.in',
        'proc.net.bytes,direction.out', 'proc.net.packets,direction.in',
        'proc.net.packets,direction.out', 'proc.stat.intr'
    ]
    metrics = [
        'iostat.disk.read_requests', 'iostat.disk.write_requests',
        'proc.meminfo.buffers', 'proc.meminfo.cached'
    ]
    input['metrics'] = metrics

    return pipe.run(input)
コード例 #4
0
ファイル: run_kalman.py プロジェクト: nebgor/rainmon
#2. Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#3. Neither the name of the University nor the names of its contributors
#   may be used to endorse or promote products derived from this software
#   without specific prior written permission.

# run_kalman.py

import pipeline
import numpy
import pylab
import os

if __name__ == "__main__":
    pipe = pipeline.get_default_pipeline()

    outdir = '../etc/tmp'

    input = {}
    input['hosts'] = []
    for i in range(1, 65):
        input['hosts'].append('cloud%d' % (i))

    input['start'] = '2011/11/22-15:00:00'
    input['end'] = '2011/11/24-23:45:00'

    metrics = [
        'iostat.disk.read_requests',
        'iostat.disk.write_requests',
    ]
コード例 #5
0
ファイル: run_kalman.py プロジェクト: cmiller8/rainmon
#2. Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#3. Neither the name of the University nor the names of its contributors
#   may be used to endorse or promote products derived from this software
#   without specific prior written permission.

# run_kalman.py

import pipeline
import numpy
import pylab
import os

if __name__ == "__main__":
    pipe = pipeline.get_default_pipeline()

    outdir = '../etc/tmp'

    input = {} 
    input['hosts'] = []
    for i in range(1, 65):
        input['hosts'].append('cloud%d'%(i))

    input['start'] = '2011/11/22-15:00:00'
    input['end'] = '2011/11/24-23:45:00'

    metrics = ['iostat.disk.read_requests',
               'iostat.disk.write_requests',
                ]