Giter VIP home page Giter VIP logo

prometheus-cpp-lite's People

Contributors

asemy avatar biaks avatar grigoryan-sergey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prometheus-cpp-lite's Issues

push_to_server_example crashed

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"

Unable to create Histogram metric

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);

Histogram `Collect()` tries to use function `Counter.Value()` (should be `.Get()`?)

Describe the bug

I think there's a there's a typo in Histogram

cumulative_count += static_cast<std::size_t>(bucket_counts_[i].Value());

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());

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.