feature/featuretags: make clientmetrics optional
Saves 57 KB Updates #12614 Change-Id: If7eebec12b3cb30ae6264171d36a258c04b05a70 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
127a967207
commit
3ae7a351b4
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build !ts_omit_clientmetrics
|
||||
|
||||
// Package clientmetric provides client-side metrics whose values
|
||||
// get occasionally logged.
|
||||
package clientmetric
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build ts_omit_clientmetrics
|
||||
|
||||
package clientmetric
|
||||
|
||||
type Metric struct{}
|
||||
|
||||
func (*Metric) Add(int64) {}
|
||||
func (*Metric) Set(int64) {}
|
||||
func (*Metric) Value() int64 { return 0 }
|
||||
func (*Metric) Register(expvarInt any) {}
|
||||
func (*Metric) UnregisterAll() {}
|
||||
|
||||
func HasPublished(string) bool { panic("unreachable") }
|
||||
func EncodeLogTailMetricsDelta() string { return "" }
|
||||
func WritePrometheusExpositionFormat(any) {}
|
||||
|
||||
var zeroMetric Metric
|
||||
|
||||
func NewCounter(string) *Metric { return &zeroMetric }
|
||||
func NewGauge(string) *Metric { return &zeroMetric }
|
||||
func NewAggregateCounter(string) *Metric { return &zeroMetric }
|
||||
Reference in New Issue
Block a user