friend class config_file;
};
- struct property_stream;
+ class property_stream
+ {
+ public:
+ static std::string const& stat_prefix();
+ static void set_stat_prefix( char const* prefix );
+ };
+
+ struct stat_prefix
+ {
+ char const* prefix_;
+
+ stat_prefix()
+ : prefix_( nullptr )
+ {}
+
+ stat_prefix( char const* prefix )
+ : prefix_( prefix )
+ {}
+ };
+
+ static inline property_stream& operator<<( property_stream& s, stat_prefix&& prefix )
+ {
+ s.set_stat_prefix( prefix.prefix_ );
+ return s;
+ }
template <typename T>
- static inline property_stream& operator <<( property_stream& s, std::pair<char const *, T > prop )
+ static inline property_stream& operator <<( property_stream& s, std::pair<char const*, T > prop )
{
std::stringstream ss;
ss << prop.second;
return s;
}
- static inline property_stream& operator <<( property_stream& s, std::pair<char const *, std::chrono::milliseconds > prop )
+ static inline property_stream& operator <<( property_stream& s, std::pair<char const*, std::chrono::milliseconds > prop )
{
std::stringstream ss;
ss << prop.second.count();
}
#define CDSSTRESS_STAT_OUT_( name, val ) std::make_pair( name, val )
-#define CDSSTRESS_STAT_OUT( s, field ) CDSSTRESS_STAT_OUT_( "stat." #field, s.field.get())
+#define CDSSTRESS_STAT_OUT( s, field ) CDSSTRESS_STAT_OUT_( property_stream::stat_prefix() + "." #field, s.field.get())
class stress_fixture : public fixture
{
struct traits_SplitList_Michael_dyn_cmp_stat : public traits_SplitList_Michael_dyn_cmp
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::michael_list::make_traits<
+ co::compare< compare >
+ ,co::stat< cc::michael_list::stat<> >
+ >::type ordered_list_traits;
};
typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_HP_dyn_cmp_stat;
typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_DHP_dyn_cmp_stat;
struct traits_SplitList_Michael_st_less_stat : traits_SplitList_Michael_st_less
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::michael_list::make_traits<
+ co::less< less >
+ , co::stat< cc::michael_list::stat<> >
+ >::type ordered_list_traits;
+
};
typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_HP_st_less_stat;
typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Michael_st_less_stat > SplitList_Michael_DHP_st_less_stat;
struct SplitList_Lazy_dyn_cmp_stat : public SplitList_Lazy_dyn_cmp
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::lazy_list::make_traits<
+ co::compare< compare >
+ , co::stat< cc::lazy_list::stat<>>
+ >::type ordered_list_traits;
};
typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_HP_dyn_cmp_stat;
typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_DHP_dyn_cmp_stat;
struct SplitList_Lazy_st_less_stat : public SplitList_Lazy_st_less
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::lazy_list::make_traits<
+ co::less< less >
+ , co::stat< cc::lazy_list::stat<>>
+ >::type ordered_list_traits;
};
typedef SplitListMap< cds::gc::HP, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_HP_st_less_stat;
typedef SplitListMap< cds::gc::DHP, Key, Value, SplitList_Lazy_st_less_stat > SplitList_Lazy_DHP_st_less_stat;
struct traits_SplitList_Iterable_dyn_cmp_stat : public traits_SplitList_Iterable_dyn_cmp
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::iterable_list::make_traits<
+ co::compare< compare >
+ , co::stat< cc::iterable_list::stat<>>
+ >::type ordered_list_traits;
};
typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Iterable_dyn_cmp_stat > SplitList_Iterable_HP_dyn_cmp_stat;
typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Iterable_dyn_cmp_stat > SplitList_Iterable_DHP_dyn_cmp_stat;
struct traits_SplitList_Iterable_st_less_stat : traits_SplitList_Iterable_st_less
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::iterable_list::make_traits<
+ co::less< less >
+ , co::stat< cc::iterable_list::stat<>>
+ >::type ordered_list_traits;
};
typedef SplitListMap< cds::gc::HP, Key, Value, traits_SplitList_Iterable_st_less_stat > SplitList_Iterable_HP_st_less_stat;
typedef SplitListMap< cds::gc::DHP, Key, Value, traits_SplitList_Iterable_st_less_stat > SplitList_Iterable_DHP_st_less_stat;
static inline void print_stat( cds_test::property_stream& o, SplitListMap< GC, K, T, Traits > const& m )
{
o << m.statistics()
- << m.list_statistics();
+ << cds_test::stat_prefix( "list_stat" )
+ << m.list_statistics()
+ << cds_test::stat_prefix( "" );
}
} // namespace map
struct traits_SplitList_Lazy_dyn_cmp_stat : public traits_SplitList_Lazy_dyn_cmp
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::lazy_list::make_traits<
+ co::compare< compare >
+ , co::stat< cc::lazy_list::stat<>>
+ >::type ordered_list_traits;
};
typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_HP_dyn_cmp_stat;
typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_DHP_dyn_cmp_stat;
struct traits_SplitList_Lazy_st_less_stat : public traits_SplitList_Lazy_st_less
{
typedef cc::split_list::stat<> stat;
+ typedef typename cc::lazy_list::make_traits<
+ co::less< less >
+ , co::stat< cc::lazy_list::stat<>>
+ >::type ordered_list_traits;
};
typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_HP_st_less_stat;
typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_DHP_st_less_stat;
static inline void print_stat( cds_test::property_stream& o, SplitListSet<GC, T, Traits> const& s )
{
o << s.statistics()
- << s.list_statistics();
+ << cds_test::stat_prefix( "list_stat" )
+ << s.list_statistics()
+ << cds_test::stat_prefix( "" );
}
} // namespace set