コード例 #1
0
    def __init__(self,
                 log_name: str = 'chunkflow',
                 name: str = 'cloud-watch',
                 verbose: bool = True):
        super().__init__(name=name, verbose=verbose)

        # write to aws cloud watch
        self.aws_cloud_watch = CloudWatch(log_name)
コード例 #2
0
class TestCloudWatch(unittest.TestCase):
    def setUp(self):
        print('test cloud watch...')
        log_name = 'chunkflow-test'
        self.cloud_watch = CloudWatch(log_name)

    def test_put_metric_data(self):
        log = {
            'compute_device': 'X86-64',
            'timer': {
                'cutout': 24,
                'inference': 200,
                'save': 50
            }
        }
        self.cloud_watch.put_metric_data(log)
コード例 #3
0
ファイル: cloud_watch.py プロジェクト: CDScattering/chunkflow
class CloudWatchOperator(OperatorBase):
    """CloudWatchOperator

    watch the performance of each operator using AWS CloudWatch.

    :param log_name: the log used in AWS CloudWatch
    :return: the timer result will be uploaded to AWS CloudWatch 
        and nothing will return here.
    """
    def __init__(self, log_name: str = 'chunkflow', name: str = 'cloud-watch'):
        super().__init__(name=name)

        # write to aws cloud watch
        self.aws_cloud_watch = CloudWatch(log_name)

    def __call__(self, log):
        self.aws_cloud_watch.put_metric_data(log)
        logging.info(f'log submitted to cloud watch: {log}')
コード例 #4
0
 def setUp(self):
     print('test cloud watch...')
     log_name = 'chunkflow-test'
     self.cloud_watch = CloudWatch(log_name)
コード例 #5
0
ファイル: cloud_watch.py プロジェクト: CDScattering/chunkflow
    def __init__(self, log_name: str = 'chunkflow', name: str = 'cloud-watch'):
        super().__init__(name=name)

        # write to aws cloud watch
        self.aws_cloud_watch = CloudWatch(log_name)