Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move KeyValueIterable and KeyValueIterableView from trace to common #363

Merged
merged 3 commits into from
Oct 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace trace
namespace common
{
/**
* Supports internal iteration over a collection of key-value pairs.
Expand All @@ -30,5 +30,5 @@ class KeyValueIterable
*/
virtual size_t size() const noexcept = 0;
};
} // namespace trace
} // namespace common
OPENTELEMETRY_END_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#include <type_traits>
#include <utility>

#include "opentelemetry/common/key_value_iterable.h"
#include "opentelemetry/nostd/utility.h"
#include "opentelemetry/trace/key_value_iterable.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace trace
namespace common
{
namespace detail
{
Expand Down Expand Up @@ -60,5 +60,5 @@ class KeyValueIterableView final : public KeyValueIterable
private:
const T *container_;
};
} // namespace trace
} // namespace common
OPENTELEMETRY_END_NAMESPACE
6 changes: 3 additions & 3 deletions api/include/opentelemetry/metrics/async_instruments.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ValueObserver : virtual public AsynchronousInstrument<T>
* @param value is the numerical representation of the metric being captured
* @param labels the set of labels, as key-value pairs
*/
virtual void observe(T value, const trace::KeyValueIterable &labels) override = 0;
virtual void observe(T value, const common::KeyValueIterable &labels) override = 0;

/**
* Captures data by activating the callback function associated with the
Expand All @@ -55,7 +55,7 @@ class SumObserver : virtual public AsynchronousInstrument<T>
void (*callback)(ObserverResult<T>))
{}

virtual void observe(T value, const trace::KeyValueIterable &labels) override = 0;
virtual void observe(T value, const common::KeyValueIterable &labels) override = 0;

virtual void run() override = 0;
};
Expand All @@ -74,7 +74,7 @@ class UpDownSumObserver : virtual public AsynchronousInstrument<T>
void (*callback)(ObserverResult<T>))
{}

virtual void observe(T value, const trace::KeyValueIterable &labels) override = 0;
virtual void observe(T value, const common::KeyValueIterable &labels) override = 0;

virtual void run() override = 0;
};
Expand Down
8 changes: 4 additions & 4 deletions api/include/opentelemetry/metrics/instrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <iostream>
#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/common/key_value_iterable_view.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/trace/key_value_iterable_view.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace metrics
Expand Down Expand Up @@ -135,7 +135,7 @@ class SynchronousInstrument : virtual public Instrument
* @return a Bound Instrument
*/
virtual nostd::shared_ptr<BoundSynchronousInstrument<T>> bind(
const trace::KeyValueIterable &labels)
const common::KeyValueIterable &labels)
{
return nostd::shared_ptr<BoundSynchronousInstrument<T>>();
}
Expand All @@ -152,7 +152,7 @@ class SynchronousInstrument : virtual public Instrument
* @param value is the numerical representation of the metric being captured
* @return void
*/
virtual void update(T value, const trace::KeyValueIterable &labels) = 0;
virtual void update(T value, const common::KeyValueIterable &labels) = 0;
};

template <class T>
Expand Down Expand Up @@ -181,7 +181,7 @@ class AsynchronousInstrument : virtual public Instrument
* @param labels is the numerical representation of the metric being captured
* @return none
*/
virtual void observe(T value, const trace::KeyValueIterable &labels) = 0;
virtual void observe(T value, const common::KeyValueIterable &labels) = 0;

/**
* Captures data by activating the callback function associated with the
Expand Down
8 changes: 4 additions & 4 deletions api/include/opentelemetry/metrics/meter.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,19 +263,19 @@ class Meter
* @param values a span of values to record to the instruments in the corresponding
* position in the instruments span.
*/
virtual void RecordShortBatch(const trace::KeyValueIterable &labels,
virtual void RecordShortBatch(const common::KeyValueIterable &labels,
nostd::span<SynchronousInstrument<short> *> instruments,
nostd::span<const short> values) noexcept = 0;

virtual void RecordIntBatch(const trace::KeyValueIterable &labels,
virtual void RecordIntBatch(const common::KeyValueIterable &labels,
nostd::span<SynchronousInstrument<int> *> instruments,
nostd::span<const int> values) noexcept = 0;

virtual void RecordFloatBatch(const trace::KeyValueIterable &labels,
virtual void RecordFloatBatch(const common::KeyValueIterable &labels,
nostd::span<SynchronousInstrument<float> *> instruments,
nostd::span<const float> values) noexcept = 0;

virtual void RecordDoubleBatch(const trace::KeyValueIterable &labels,
virtual void RecordDoubleBatch(const common::KeyValueIterable &labels,
nostd::span<SynchronousInstrument<double> *> instruments,
nostd::span<const double> values) noexcept = 0;
};
Expand Down
Loading