influxdb_interface.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:gpu_monitor 作者: msalvaris 项目源码 文件源码
def create_influxdb_writer(influxdb_client, series_name="gpu_measurements", **tags):
    """ Returns function which writes to influxdb

    Parameters
    ----------
    influxdb_client:
    series_name: (str)
    tags: Extra tags to be added to the measurements
    """
    to_influxdb = _influxdb_writer_for(influxdb_client, series_name)

    if tags:
        logger.debug('Creating writer with tags')
        write_to_db = compose(to_influxdb,
                              _add_tags(tags),
                              _to_json_dict,
                              parse_line)
    else:
        logger.debug('Creating writer')
        write_to_db = compose(to_influxdb,
                              _to_json_dict,
                              parse_line)

    return _call_when(write_to_db, lambda x: x is not None and '#' not in x)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号