Ejemplo n.º 1
0
        ///////////////////////////////////////////////////////////////////////
        /// Expand all wild-cards in a counter base name (for aggregate counters)
        bool expand_basecounter(
            counter_info const& info, counter_path_elements& p,
            discover_counter_func const& f, error_code& ec)
        {
            // discover all base names
            std::vector<counter_info> counter_infos;
            counter_status status = discover_counter_type(p.parentinstancename_,
                counter_infos, discover_counters_full, ec);
            if (!status_is_valid(status) || ec)
                return false;

            counter_info i = info;
            for (counter_info& basei : counter_infos)
            {
                p.parentinstancename_ = basei.fullname_;
                counter_status status = get_counter_name(p, i.fullname_, ec);
                if (!status_is_valid(status) || !f(i, ec) || ec)
                    return false;
            }
            return true;
        }
Ejemplo n.º 2
0
 counter_status discover_counter_type(
     counter_info const& info, discover_counter_func const& f,
     discover_counters_mode mode, error_code& ec = throws)
 {
     return discover_counter_type(info.fullname_, f, mode, ec);
 }