biaks / prometheus-cpp-lite Goto Github PK
View Code? Open in Web Editor NEWC++ header-only prometheus client library for quickly and easily adding metric (and profiling) functionality to C++ projects.
License: MIT License
C++ header-only prometheus client library for quickly and easily adding metric (and profiling) functionality to C++ projects.
License: MIT License
platform : Windows10
tools : GCC 8.1.0 x86_64-w64-migw32,
CMake 3.27
I added wsock32 lib to CMakelist and built examples successfully.But when I run push_to_server_example.exe,it crashed after a few seconds and threw a message like this:
terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_ "M_replace_aux"
Describe the bug
I would like to create a Histogram metric, but I'm not able to.
To Reproduce
Steps to reproduce the behavior:
using namespace prometheus;
Registry MetricsRegistry;
using AudioFreqHistogram = Histogram<double>;
using AudioFreqHistogramFamily = CustomFamily<AudioFreqHistogram>;
AudioFreqHistogramFamily &audioFreqHistogram{
AudioFreqHistogram::Family::Build(MetricsRegistry, "frequencies", "audio frequencies, Hz", {})
};
std::vector<double> frequencyBoundaries;
for (int i = 0; i < 8000; i += 100) {
frequencyBoundaries.push_back(i);
}
// ERROR In template: no matching member function for call to 'insert'
auto &freqHist1 = audioFreqHistogram.Add({}, frequencyBoundaries);
// ERROR Call to implicitly-deleted copy constructor of 'prometheus::Histogram<double>'
Histogram<double> freqHist2 = Histogram<double>{frequencyBoundaries};
// ERROR In template: call to implicitly-deleted copy constructor of 'value_type' (aka 'prometheus::Counter<double>')
prometheus::Histogram<double> freqHist3 = Histogram<double>(frequencyBoundaries);
Additional context
I'm using PlatformIO and have made a few alterations to the code, like replacing dynamic_cast
// return dynamic_cast<CustomMetric&>(*metrics_iter->second);
return (CustomMetric&)(*metrics_iter->second);
Describe the bug
I think there's a there's a typo in Histogram
bucket_counts_[i]
returns a Counter
, which does not have a Value()
function. I think this is correct:
// cumulative_count += static_cast<std::size_t>(bucket_counts_[i].Value());
cumulative_count += static_cast<std::size_t>(bucket_counts_[i].Get());
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.