-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joshua MacDonald
committed
Jul 13, 2021
1 parent
7dec134
commit 21c2edd
Showing
12 changed files
with
282 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package asyncfloat64 | ||
|
||
import ( | ||
"context" | ||
|
||
"go.opentelemetry.io/otel/attribute" | ||
"go.opentelemetry.io/otel/metric2/sdkapi" | ||
) | ||
|
||
type Counter struct { | ||
} | ||
|
||
type UpDownCounter struct { | ||
} | ||
|
||
type Gauge struct { | ||
} | ||
|
||
func (c Counter) Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue) { | ||
} | ||
|
||
func (u UpDownCounter) Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue) { | ||
} | ||
|
||
func (g Gauge) Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue) { | ||
} | ||
|
||
func (c Counter) Measure(x float64) sdkapi.Measurement { | ||
return sdkapi.Measurement{} | ||
} | ||
|
||
func (u UpDownCounter) Measure(x float64) sdkapi.Measurement { | ||
return sdkapi.Measurement{} | ||
} | ||
|
||
func (g Gauge) Measure(x float64) sdkapi.Measurement { | ||
return sdkapi.Measurement{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package asyncint64 | ||
|
||
import ( | ||
"context" | ||
|
||
"go.opentelemetry.io/otel/attribute" | ||
"go.opentelemetry.io/otel/metric2/sdkapi" | ||
) | ||
|
||
type Counter struct { | ||
} | ||
|
||
type UpDownCounter struct { | ||
} | ||
|
||
type Gauge struct { | ||
} | ||
|
||
func (c Counter) Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue) { | ||
} | ||
|
||
func (u UpDownCounter) Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue) { | ||
} | ||
|
||
func (g Gauge) Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue) { | ||
} | ||
|
||
func (c Counter) Measure(x int64) sdkapi.Measurement { | ||
return sdkapi.Measurement{} | ||
} | ||
|
||
func (u UpDownCounter) Measure(x int64) sdkapi.Measurement { | ||
return sdkapi.Measurement{} | ||
} | ||
|
||
func (g Gauge) Measure(x int64) sdkapi.Measurement { | ||
return sdkapi.Measurement{} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
package meter | ||
|
||
import ( | ||
"context" | ||
|
||
"go.opentelemetry.io/otel/attribute" | ||
"go.opentelemetry.io/otel/metric" | ||
"go.opentelemetry.io/otel/metric2/asyncfloat64" | ||
"go.opentelemetry.io/otel/metric2/asyncint64" | ||
"go.opentelemetry.io/otel/metric2/sdkapi" | ||
"go.opentelemetry.io/otel/metric2/syncfloat64" | ||
"go.opentelemetry.io/otel/metric2/syncint64" | ||
) | ||
|
||
type MeterOption = metric.MeterOption | ||
type InstrumentOption = metric.InstrumentOption | ||
|
||
// Provider supports creating named Meter instances, for instrumenting | ||
// an application containing multiple libraries of code. | ||
type Provider interface { | ||
Meter(instrumentationName string, opts ...MeterOption) Meter | ||
} | ||
|
||
// Meter is an instance of an OpenTelemetry metrics interface for an | ||
// individual named library of code. This is the top-level entry | ||
// point for creating instruments. | ||
type Meter struct { | ||
} | ||
|
||
type AsyncFloat64Instruments struct{} | ||
type AsyncInt64Instruments struct{} | ||
type SyncFloat64Instruments struct{} | ||
type SyncInt64Instruments struct{} | ||
|
||
func (m Meter) AsyncInt64() AsyncInt64Instruments { | ||
return AsyncInt64Instruments{} | ||
} | ||
|
||
func (m Meter) AsyncFloat64() AsyncFloat64Instruments { | ||
return AsyncFloat64Instruments{} | ||
} | ||
|
||
func (m Meter) SyncInt64() SyncInt64Instruments { | ||
return SyncInt64Instruments{} | ||
} | ||
|
||
func (m Meter) SyncFloat64() SyncFloat64Instruments { | ||
return SyncFloat64Instruments{} | ||
} | ||
|
||
// ProcessBatch processes a batch of measurements as a single logical | ||
// event. | ||
func (m Meter) ProcessBatch( | ||
ctx context.Context, | ||
attrs []attribute.KeyValue, | ||
batch ...sdkapi.Measurement) { | ||
} | ||
|
||
// Process processes a single measurement. This offers the | ||
// convenience of passing a variable length list of attributes for a | ||
// processing a single measurement. | ||
func (m Meter) Process( | ||
ctx context.Context, | ||
ms sdkapi.Measurement, | ||
attrs ...attribute.KeyValue) { | ||
// Process a singleton batch | ||
m.ProcessBatch(ctx, attrs, ms) | ||
} | ||
|
||
func (m AsyncFloat64Instruments) Counter(name string, opts ...InstrumentOption) (asyncfloat64.Counter, error) { | ||
return asyncfloat64.Counter{}, nil | ||
} | ||
|
||
func (m AsyncFloat64Instruments) UpDownCounter(name string, opts ...InstrumentOption) (asyncfloat64.UpDownCounter, error) { | ||
return asyncfloat64.UpDownCounter{}, nil | ||
} | ||
|
||
func (m AsyncFloat64Instruments) Gauge(name string, opts ...InstrumentOption) (asyncfloat64.Gauge, error) { | ||
return asyncfloat64.Gauge{}, nil | ||
} | ||
|
||
func (m AsyncInt64Instruments) Counter(name string, opts ...InstrumentOption) (asyncint64.Counter, error) { | ||
return asyncint64.Counter{}, nil | ||
} | ||
|
||
func (m AsyncInt64Instruments) UpDownCounter(name string, opts ...InstrumentOption) (asyncint64.UpDownCounter, error) { | ||
return asyncint64.UpDownCounter{}, nil | ||
} | ||
|
||
func (m AsyncInt64Instruments) Gauge(name string, opts ...InstrumentOption) (asyncint64.Gauge, error) { | ||
return asyncint64.Gauge{}, nil | ||
} | ||
|
||
func (m SyncFloat64Instruments) Counter(name string, opts ...InstrumentOption) (syncfloat64.Counter, error) { | ||
return syncfloat64.Counter{}, nil | ||
} | ||
|
||
func (m SyncFloat64Instruments) UpDownCounter(name string, opts ...InstrumentOption) (syncfloat64.UpDownCounter, error) { | ||
return syncfloat64.UpDownCounter{}, nil | ||
} | ||
|
||
func (m SyncFloat64Instruments) Histogram(name string, opts ...InstrumentOption) (syncfloat64.Histogram, error) { | ||
return syncfloat64.Histogram{}, nil | ||
} | ||
|
||
func (m SyncInt64Instruments) Counter(name string, opts ...InstrumentOption) (syncint64.Counter, error) { | ||
return syncint64.Counter{}, nil | ||
} | ||
|
||
func (m SyncInt64Instruments) UpDownCounter(name string, opts ...InstrumentOption) (syncint64.UpDownCounter, error) { | ||
return syncint64.UpDownCounter{}, nil | ||
} | ||
|
||
func (m SyncInt64Instruments) Histogram(name string, opts ...InstrumentOption) (syncint64.Histogram, error) { | ||
return syncint64.Histogram{}, nil | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.