Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaning up for PR
Browse files Browse the repository at this point in the history
ankit-bhargava committed Jul 20, 2020
1 parent 2645ace commit 07bde38
Showing 6 changed files with 196 additions and 132 deletions.
24 changes: 12 additions & 12 deletions api/include/opentelemetry/metrics/async_instruments.h
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@ class ValueObserver : public AsynchronousInstrument<T>
ValueObserver() = default;

ValueObserver(nostd::string_view name,
nostd::string_view description,
nostd::string_view unit,
bool enabled,
void (*callback)(ObserverResult<T>))
nostd::string_view description,
nostd::string_view unit,
bool enabled,
void (*callback)(ObserverResult<T>))
{}

/*
@@ -39,10 +39,10 @@ class SumObserver : public AsynchronousInstrument<T>
SumObserver() = default;

SumObserver(nostd::string_view name,
nostd::string_view description,
nostd::string_view unit,
bool enabled,
void (*callback)(ObserverResult<T>))
nostd::string_view description,
nostd::string_view unit,
bool enabled,
void (*callback)(ObserverResult<T>))
{}

/*
@@ -64,10 +64,10 @@ class UpDownSumObserver : public AsynchronousInstrument<T>
UpDownSumObserver() = default;

UpDownSumObserver(nostd::string_view name,
nostd::string_view description,
nostd::string_view unit,
bool enabled,
void (*callback)(ObserverResult<T>))
nostd::string_view description,
nostd::string_view unit,
bool enabled,
void (*callback)(ObserverResult<T>))
{}

virtual void observe(int value, const trace::KeyValueIterable &labels) {}
29 changes: 6 additions & 23 deletions api/include/opentelemetry/metrics/instrument.h
Original file line number Diff line number Diff line change
@@ -12,29 +12,12 @@ namespace metrics
// Enum classes to help determine instrument types in other parts of the API
enum class InstrumentKind
{
IntCounter,
IntUpDownCounter,
IntValueRecorder,
IntValueObserver,
IntSumObserver,
IntUpDownSumObserver,
DoubleCounter,
DoubleUpDownCounter,
DoubleValueRecorder,
DoubleValueObserver,
DoubleSumObserver,
DoubleUpDownSumObserver
};

// Fewer Bound types because Asynchronous instruments cannot bind
enum class BoundInstrumentKind
{
BoundIntCounter,
BoundIntUpDownCounter,
BoundIntValueRecorder,
BoundDoubleCounter,
BoundDoubleUpDownCounter,
BoundDoubleValueRecorder
Counter = 0,
UpDownCounter = 1,
ValueRecorder = 2,
ValueObserver = 3,
SumObserver = 4,
UpDownSumObserver = 5,
};

class Instrument
Loading

0 comments on commit 07bde38

Please sign in to comment.