mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
20f4e198ee
Summary: A stub class in metrics.py can be overwritten by dedicated implementations. Reviewed By: quark-zju Differential Revision: D7673553 fbshipit-source-id: f713abb3203d393e356f96fb834111ec2c37498a
23 lines
622 B
Python
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
|