def __init__(self, schema, timeout, time_to_sleep_in_seconds):
     self.schema = schema
     conf_reader = ConfigServerConfigurationReaderSingleton().config_reader
     self._sensor_type = conf_reader.read(
         ADAPTER_HOUR_IS_READY_SENSOR_TYPE_CONF_KEY,
         ADAPTER_HOUR_IS_READY_SENSOR_TYPE_DEFAULT_VALUE)
     self._sensor_command = conf_reader.read(
         ADAPTER_HOUR_IS_READY_SENSOR_COMMAND_CONF_KEY,
         ADAPTER_HOUR_IS_READY_SENSOR_COMMAND_DEFAULT_VALUE)
     self.timeout = timeout
     self.time_to_sleep_in_seconds = time_to_sleep_in_seconds
Пример #2
0
import logging
import sys
import json

from airflow.operators.python_operator import PythonOperator
from presidio.builders.maintenance.maintenance_dag_builder import MaintenanceDagBuilder
from elasticsearch import Elasticsearch
from presidio.utils.configuration.config_server_configuration_reader_singleton import \
    ConfigServerConfigurationReaderSingleton

config_reader = ConfigServerConfigurationReaderSingleton().config_reader
elasticsearch_host = config_reader.read("elasticsearch.host", "localhost")
elasticsearch_port = config_reader.read("elasticsearch.restPort", "9200")


class PresidioMetircsCleanupDagBuilder(MaintenanceDagBuilder):

    DEFAULT_MAX_APP_METRICS_AGE_IN_DAYS = 30
    DEFAULT_MAX_SYS_METRICS_AGE_IN_DAYS = 15

    def build(self, dag):

        clean_application_metrics_operator = PythonOperator(
            task_id='clean_presidio_application_metrics',
            python_callable=PresidioMetircsCleanupDagBuilder.
            cleanup_app_metrics_function,
            provide_context=True,
            dag=dag)

        clean_system_metrics_operator = PythonOperator(
            task_id='clean_presidio_system_metrics',
Пример #3
0
 def __init__(self):
     conf_reader = ConfigServerConfigurationReaderSingleton().config_reader
     self._retention_command = conf_reader.read(
         RetentionDagBuilder.RETENTION_COMMAND_CONFIG_PATH,
         RetentionDagBuilder.RETENTION_COMMAND_DEFAULT_VALUE)