Ejemplo n.º 1
0
 def _publish_visualizations(self):
     for visualization in self._kibana_visualizations:
         url = urlparse.urljoin(
             base_elastic_url,
             '/.kibana/visualization/{}'.format(visualization.id))
         logger.debug("publishing visualization '{}'".format(url))
         shared_utils.publish_json(visualization, es_user, es_passwd, url)
Ejemplo n.º 2
0
def publish_difference(mongo_data, elastic_data, output_destination, es_user, es_passwd):
    for elastic_entry in elastic_data:
        if elastic_entry in mongo_data:
            mongo_data.remove(elastic_entry)

    logger.info('number of parsed test results: {}'.format(len(mongo_data)))

    for parsed_test_result in mongo_data:
        shared_utils.publish_json(parsed_test_result, es_user, es_passwd, output_destination)
Ejemplo n.º 3
0
def publish_difference(mongo_data, elastic_data, output_destination, es_user,
                       es_passwd):
    for elastic_entry in elastic_data:
        if elastic_entry in mongo_data:
            mongo_data.remove(elastic_entry)

    logger.info('number of parsed test results: {}'.format(len(mongo_data)))

    for parsed_test_result in mongo_data:
        shared_utils.publish_json(parsed_test_result, es_user, es_passwd,
                                  output_destination)
Ejemplo n.º 4
0
def publish_mongo_data(output_destination):
    tmp_filename = 'mongo-{}.log'.format(uuid.uuid4())
    try:
        subprocess.check_call(['mongoexport', '--db', 'test_results_collection', '-c', 'test_results', '--out',
                               tmp_filename])
        with open(tmp_filename) as fobj:
            for mongo_json_line in fobj:
                test_result = json.loads(mongo_json_line)
                if modify_mongo_entry(test_result):
                    shared_utils.publish_json(test_result, output_destination, es_user, es_passwd)
    finally:
        if os.path.exists(tmp_filename):
            os.remove(tmp_filename)
Ejemplo n.º 5
0
def publish_mongo_data(output_destination):
    tmp_filename = 'mongo-{}.log'.format(uuid.uuid4())
    try:
        subprocess.check_call([
            'mongoexport', '--db', 'test_results_collection', '-c',
            'test_results', '--out', tmp_filename
        ])
        with open(tmp_filename) as fobj:
            for mongo_json_line in fobj:
                test_result = json.loads(mongo_json_line)
                if modify_mongo_entry(test_result):
                    shared_utils.publish_json(test_result, output_destination,
                                              es_user, es_passwd)
    finally:
        if os.path.exists(tmp_filename):
            os.remove(tmp_filename)
Ejemplo n.º 6
0
 def _publish(self):
     url = urlparse.urljoin(base_elastic_url,
                            '/.kibana/dashboard/{}'.format(self.id))
     logger.debug("publishing dashboard '{}'".format(url))
     shared_utils.publish_json(self, es_user, es_passwd, url)
 def _publish(self):
     url = urlparse.urljoin(base_elastic_url, '/.kibana/dashboard/{}'.format(self.id))
     logger.debug("publishing dashboard '{}'".format(url))
     shared_utils.publish_json(self, es_user, es_passwd, url)
 def _publish_visualizations(self):
     for visualization in self._kibana_visualizations:
         url = urlparse.urljoin(base_elastic_url, '/.kibana/visualization/{}'.format(visualization.id))
         logger.debug("publishing visualization '{}'".format(url))
         shared_utils.publish_json(visualization, es_user, es_passwd, url)