src/performance_counters/counter_creators.cpp
bool locality0_counter_discoverer(counter_info const& info,
        discover_counter_func const& f,
        discover_counters_mode mode, error_code& ec)
    {
        performance_counters::counter_info i = info;

        // compose the counter name templates
        performance_counters::counter_path_elements p;
        performance_counters::counter_status status =
            get_counter_path_elements(info.fullname_, p, ec);
        if (!status_is_valid(status)) return false;

        // restrict to locality zero
        if (p.parentinstancename_ == "locality#*")
        {
            p.parentinstancename_ = "locality";
            p.parentinstanceindex_ = 0;
        }

        if (mode == discover_counters_minimal ||
            p.parentinstancename_.empty() || p.instancename_.empty())
        {
            if (p.parentinstancename_.empty())
            {
                p.parentinstancename_ = "locality";
                p.parentinstanceindex_ = 0;
            }

            if (p.instancename_.empty())
            {
                p.instancename_ = "total";
                p.instanceindex_ = -1;
            }
        }

        status = get_counter_name(p, i.fullname_, ec);
        if (!status_is_valid(status) || !f(i, ec) || ec)
            return false;

        if (&ec != &throws)
            ec = make_success_code();

        return true;
    }
/// Default discoverer function for AGAS performance counters; to be
/// registered with the counter types. It is suitable to be used for all
/// counters following the naming scheme:
///
///   /<objectname>{locality#0/total}/<instancename>
///
Default discoverer function for AGAS performance counters; to be
registered with the counter types. It is suitable to be used for all
counters following the naming scheme.

{locality#0/total}/
Default discoverer function for AGAS performance counters ; to be registered with the counter types . It is suitable to be used for all counters following the naming scheme . { locality#0 / total } /
bool locality0_counter_discoverer(counter_info const& info,
        discover_counter_func const& f,
        discover_counters_mode mode, error_code& ec)
    {
        performance_counters::counter_info i = info;
        performance_counters::counter_path_elements p;
        performance_counters::counter_status status =
            get_counter_path_elements(info.fullname_, p, ec);
        if (!status_is_valid(status)) return false;
        if (p.parentinstancename_ == "locality#*")
        {
            p.parentinstancename_ = "locality";
            p.parentinstanceindex_ = 0;
        }
        if (mode == discover_counters_minimal ||
            p.parentinstancename_.empty() || p.instancename_.empty())
        {
            if (p.parentinstancename_.empty())
            {
                p.parentinstancename_ = "locality";
                p.parentinstanceindex_ = 0;
            }
            if (p.instancename_.empty())
            {
                p.instancename_ = "total";
                p.instanceindex_ = -1;
            }
        }
        status = get_counter_name(p, i.fullname_, ec);
        if (!status_is_valid(status) || !f(i, ec) || ec)
            return false;
        if (&ec != &throws)
            ec = make_success_code();
        return true;
    }
bool locality0_counter_discoverer ( counter_info const & info , discover_counter_func const & f , discover_counters_mode mode , error_code & ec ) { performance_counters :: counter_info i = info ; performance_counters :: counter_path_elements p ; performance_counters :: counter_status status = get_counter_path_elements ( info . fullname_ , p , ec ) ; if ( ! status_is_valid ( status ) ) return false ; if ( p . parentinstancename_ == " " ) { p . parentinstancename_ = " " ; p . parentinstanceindex_ = 0 ; } if ( mode == discover_counters_minimal || p . parentinstancename_ . empty ( ) || p . instancename_ . empty ( ) ) { if ( p . parentinstancename_ . empty ( ) ) { p . parentinstancename_ = " " ; p . parentinstanceindex_ = 0 ; } if ( p . instancename_ . empty ( ) ) { p . instancename_ = " " ; p . instanceindex_ = -1 ; } } status = get_counter_name ( p , i . fullname_ , ec ) ; if ( ! status_is_valid ( status ) || ! f ( i , ec ) || ec ) return false ; if ( & ec != & throws ) ec = make_success_code ( ) ; return true ; }
Default discoverer function for AGAS performance counters; to be
registered with the counter types.
Default discoverer function for AGAS performance counters ; to be registered with the counter types .
// compose the counter name templates // restrict to locality zero