Skip to content
Open
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
8 changes: 7 additions & 1 deletion src/bvar/recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,13 @@ class IntRecorder : public Variable {
typedef detail::MinusStat InvOp;
typedef detail::ReducerSampler<IntRecorder, value_type, Op, InvOp> sampler_type;

COMMON_VARIABLE_CONSTRUCTOR(IntRecorder);
IntRecorder() = default;
IntRecorder(const butil::StringPiece& name) {
this->expose(name);
}
IntRecorder(const butil::StringPiece& prefix, const butil::StringPiece& name) {
this->expose_as(prefix, name);
}

DISALLOW_COPY_AND_MOVE(IntRecorder);

Expand Down
24 changes: 21 additions & 3 deletions src/bvar/reducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,13 @@ class Adder<T, std::enable_if<std::is_constructible<babylon::GenericsConcurrentA
typedef detail::MinusFrom<value_type> InvOp;
typedef typename Base::sampler_type sampler_type;

COMMON_VARIABLE_CONSTRUCTOR(Adder);
Adder() = default;
Adder(const butil::StringPiece& name) {
this->expose(name);
}
Adder(const butil::StringPiece& prefix, const butil::StringPiece& name) {
this->expose_as(prefix, name);
}
};
#endif // WITH_BABYLON_COUNTER

Expand Down Expand Up @@ -457,7 +463,13 @@ class Maxer<T, std::enable_if<std::is_constructible<detail::ConcurrentMaxer<T>>:
typedef detail::VoidOp InvOp;
typedef typename Base::sampler_type sampler_type;

COMMON_VARIABLE_CONSTRUCTOR(Maxer);
Maxer() = default;
Maxer(const butil::StringPiece& name) {
this->expose(name);
}
Maxer(const butil::StringPiece& prefix, const butil::StringPiece& name) {
this->expose_as(prefix, name);
}

private:
friend class detail::LatencyRecorderBase;
Expand Down Expand Up @@ -524,7 +536,13 @@ class Miner<T, std::enable_if<std::is_constructible<babylon::GenericsConcurrentM
typedef detail::VoidOp InvOp;
typedef typename Base::sampler_type sampler_type;

COMMON_VARIABLE_CONSTRUCTOR(Miner);
Miner() = default;
Miner(const butil::StringPiece& name) {
this->expose(name);
}
Miner(const butil::StringPiece& prefix, const butil::StringPiece& name) {
this->expose_as(prefix, name);
}
};
#endif // WITH_BABYLON_COUNTER

Expand Down
10 changes: 0 additions & 10 deletions src/bvar/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ namespace bvar {

DECLARE_bool(save_series);

#define COMMON_VARIABLE_CONSTRUCTOR(TypeName) \
TypeName() = default; \
TypeName(const butil::StringPiece& name) { \
this->expose(name); \
} \
TypeName(const butil::StringPiece& prefix, const butil::StringPiece& name) { \
this->expose_as(prefix, name); \
} \


// Bitwise masks of displayable targets
Comment on lines 40 to 42
enum DisplayFilter {
DISPLAY_ON_HTML = 1,
Expand Down
Loading