sapling/mercurial/metrics.py
Phil Cohen 20f4e198ee metrics: create simple metrics framework
Summary: A stub class in metrics.py can be overwritten by dedicated implementations.

Reviewed By: quark-zju

Differential Revision: D7673553

fbshipit-source-id: f713abb3203d393e356f96fb834111ec2c37498a
2018-04-18 20:08:01 -07:00

23 lines
622 B
Python

# metrics.py - generic metrics framework
#
# Copyright Mercurial Contributors
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
class metrics(object):
"""Abstract base class for metrics"""
def __init__(self, ui):
self.ui = ui
def gauge(self, entity, key, value):
pass
def client(ui):
"""Returns the appropriate metrics module"""
# @fb-only: from .fb import fbmetrics
# @fb-only: return fbmetrics.facebookmetrics(ui)
return metrics(ui) # @oss-only