<commit_before>/*
 * Copyright(c) Sophist Solutions, Inc. 1990-2015.  All rights reserved
 */
#ifndef _Stroika_Framework_SystemPerformance_Instrument_h_
#define _Stroika_Framework_SystemPerformance_Instrument_h_ 1

#include    "../StroikaPreComp.h"

#include    "../../Foundation/Containers/Set.h"
#include    "../../Foundation/DataExchange/Atom.h"
#include    "../../Foundation/DataExchange/ObjectVariantMapper.h"
#include    "../../Foundation/Execution/Function.h"

#include    "Measurement.h"
#include    "MeasurementSet.h"


/*
 * TODO:
 *      @todo
 */


namespace   Stroika {
    namespace   Frameworks {
        namespace   SystemPerformance {


            using   namespace   Stroika::Foundation;
            using   Characters::String;
            using   Containers::Set;


            /**
             *  @todo - consider using independent atom registry
             */
            using   InstrumentNameType =  DataExchange::Atom<>;


            /**
             */
            using   CapturerCallback = Execution::Function<MeasurementSet()>;


            /**
             *          <<<not sure we need this registry>>>
             */
            struct  Instrument {
                InstrumentNameType                  fInstrumentName;<commit_msg>todo/docs notes on systemperformance instruments<commit_after>/*
 * Copyright(c) Sophist Solutions, Inc. 1990-2015.  All rights reserved
 */
#ifndef _Stroika_Framework_SystemPerformance_Instrument_h_
#define _Stroika_Framework_SystemPerformance_Instrument_h_ 1

#include    "../StroikaPreComp.h"

#include    "../../Foundation/Containers/Set.h"
#include    "../../Foundation/DataExchange/Atom.h"
#include    "../../Foundation/DataExchange/ObjectVariantMapper.h"
#include    "../../Foundation/Execution/Function.h"

#include    "Measurement.h"
#include    "MeasurementSet.h"


/*
 * TODO:
 *      @todo   Try to do specialization of CaptureOneMeasurement in each instrument that avoids the
 *              serialize/deserialize part - and jsut returns the raw value.
 */


namespace   Stroika {
    namespace   Frameworks {
        namespace   SystemPerformance {


            using   namespace   Stroika::Foundation;
            using   Characters::String;
            using   Containers::Set;


            /**
             *  @todo - consider using independent atom registry
             */
            using   InstrumentNameType =  DataExchange::Atom<>;


            /**
             */
            using   CapturerCallback = Execution::Function<MeasurementSet()>;


            /**
             *  \note   Design Note
             *          Each instrument instance MAY maintain 'state' - that affects subsequent calls. For example, for instruments
             *          that measure data over a period of time (like average CPU usage over a time interval) - they may maintain
             *          state, and return an average over the time since the last call to this instrument instance.
             */
            struct  Instrument {
                InstrumentNameType                  fInstrumentName;
{'fraction_non_alphanumeric': 0.0949449125081011, 'fraction_numerical': 0.005832793259883344, 'mean_word_length': 1.982608695652174, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3315404', 'n_tokens_mistral': 822, 'n_tokens_neox': 774, 'n_words': 199}