mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
net/sockstats uses both on darwin, ios, and android, so those builds failed with ts_omit_clientmetrics. Updates #22283 Change-Id: Ib242334dbcba639603fbf57a3b016efdecaea3d5 Signed-off-by: Brad Fitzpatrick <[email protected]>
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// 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 (*Metric) DisableDeltas() {}
|
|
|
|
type MetricUpdate struct {
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Value int `json:"value"`
|
|
Op string `json:"op"`
|
|
}
|
|
|
|
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 }
|
|
func NewCounterFunc(string, func() int64) *Metric { return &zeroMetric }
|
|
func NewGaugeFunc(string, func() int64) *Metric { return &zeroMetric }
|
|
|
|
func ResetForTest(any) {}
|