Code Monkey home page Code Monkey logo

Comments (3)

uwiger avatar uwiger commented on August 20, 2024

The way you create the metric is odd.

1> exometer:start().
08:42:43.365 [info] Application lager started on node nonode@nohost
08:42:43.390 [info] Starting reporters with []
ok
08:42:43.390 [info] Application exometer_core started on node nonode@nohost
2> exometer:new([fc], fast_counter, [{function,{c,pwd}}]).
ok
3> exometer:get_value([fc]).
{ok,[{value,0},{ms_since_reset,9983}]}
4> pwd().
/Users/uwiger/FL/git/exometer_core
ok
5> exometer:get_value([fc]).
{ok,[{value,1},{ms_since_reset,14679}]}
6> pwd().
/Users/uwiger/FL/git/exometer_core
ok
7> exometer:get_value([fc]).
{ok,[{value,2},{ms_since_reset,21111}]}

I think a clarification in the documentation might be in order. Also, the exometer_function module should probably do more validation. What you're doing is effectively creating a function metric with an invalid specification.

Note that fast counters rely on the built-in tracing functionality, so if you try to trace on functions that are being used as fast counters, results are likely to be confusing. In this case, exometer would change the trace pattern for the function, so you will not get the call trace printout you expect:

1> exometer:start().
09:01:12.476 [info] Application lager started on node nonode@nohost
09:01:12.510 [info] Starting reporters with []
ok
09:01:12.510 [info] Application exometer_core started on node nonode@nohost
2> dbg:tracer(), dbg:tp(c,pwd,x), dbg:p(all,[c]).
{ok,[{matched,nonode@nohost,55}]}
3> pwd().
(<0.32.0>) call c:pwd()
/Users/uwiger/FL/git/exometer_core
(<0.32.0>) returned from c:pwd/0 -> ok
ok
4> exometer:new([fc],fast_counter,[{function,{c,pwd}}]).
ok
5> pwd().                                               
/Users/uwiger/FL/git/exometer_core
ok

If you create the fast counter first, then set a call trace, you will disable the counter instead.

from exometer.

tolbrino avatar tolbrino commented on August 20, 2024

@jpuigm Is this still an open issue for you?

from exometer.

tolbrino avatar tolbrino commented on August 20, 2024

Closing this. Feel free to report this again if it is still an issue.

from exometer.

Related Issues (20)

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.