Skip to content
Snippets Groups Projects

Saving counters result as monitoring histogram

Merged Valerii Kholoimov requested to merge dev_kholoimov_monitoring_counters_histogram into master
2 files
+ 18
24
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -35,8 +35,7 @@ namespace Allen::Monitoring {
struct CountersHistogram {
CountersHistogram() : m_bins(2, 0), m_title("CountersHistogram")
{}
CountersHistogram() : m_title("CountersHistogram"), m_bins(2, 0) {}
friend void reset(CountersHistogram& c)
{
@@ -51,26 +50,25 @@ namespace Allen::Monitoring {
{"dimension", 1},
{"empty", h.m_totNEntries == 0},
{"nEntries", h.m_totNEntries},
{"axis",
{{
{"nBins", h.m_bins.size() - 2},
{"minValue", h.m_minValue},
{"maxValue", h.m_maxValue},
{"title", ""},
{"labels", h.m_labels}
}}},
{"axis",
{{{"nBins", h.m_bins.size() - 2},
{"minValue", h.m_minValue},
{"maxValue", h.m_maxValue},
{"title", ""},
{"labels", h.m_labels}}}},
{"bins", h.m_bins}};
}
void registerHistogram()
{
// Register CountersHistogram for Gaudi
#ifndef ALLEN_STANDALONE
Gaudi::svcLocator()->monitoringHub().registerEntity("CountersHistogram", "CountersValues", "histogram:Histogram:d", *this);
#endif
// Register CountersHistogram for Gaudi
#ifndef ALLEN_STANDALONE
Gaudi::svcLocator()->monitoringHub().registerEntity(
"CountersHistogram", "CountersValues", "histogram:Histogram:d", *this);
#endif
}
void addCounter(std::string label)
void addCounter(std::string label)
{
m_labels.push_back(label);
m_maxValue++;
@@ -99,7 +97,7 @@ namespace Allen::Monitoring {
}
void registerAccumulator(AccumulatorBase* acc);
void registerCounter(Counter<unsigned>* c) {m_counters.push_back(c);}
void registerCounter(Counter<unsigned>* c) { m_counters.push_back(c); }
void initAccumulators(unsigned number_of_streams);
void mergeAndReset(bool singlethreaded = false);
char* bufferForStream(unsigned stream_id) const { return m_dev_buffer_ptr[m_stream_current_buffer[stream_id]]; }
@@ -187,10 +185,9 @@ namespace Allen::Monitoring {
using type = T;
using DeviceType = DeviceCounter<T>;
Counter(const Allen::Algorithm* owner, std::string name) : AccumulatorBase(owner, name)
Counter(const Allen::Algorithm* owner, std::string name) : AccumulatorBase(owner, name)
{
if constexpr (std::is_same<T, unsigned>::value)
AccumulatorManager::get()->registerCounter(this);
if constexpr (std::is_same<T, unsigned>::value) AccumulatorManager::get()->registerCounter(this);
}
std::size_t size() const override { return 1; }
std::size_t elementSize() const override { return sizeof(T); }
@@ -534,7 +531,6 @@ namespace Allen::Monitoring {
{"nEntries", h.m_totNEntries},
{"axis", h.axisArray()},
{"bins", h.m_bins}};
}
void registerAccumulator() override
Loading