コード例 #1
0
ファイル: rbd-target-gw.py プロジェクト: swipswaps/ceph-iscsi
def prom_metrics():
    """ Collect the stats and send back to the caller"""

    stats = GatewayStats()
    stats.collect()

    return Response(stats.formatted(), content_type="text/plain")
コード例 #2
0
def prom_metrics():
    """ Collect the stats and send back to the caller"""

    stats = GatewayStats()
    try:
        stats.collect()
    except CephiSCSIInval as err:
        return jsonify(message="Could not get metrics: {}".format(err)), 404

    return Response(stats.formatted(), content_type="text/plain")