Git Product home page Git Product logo

Comments (1)

sv2 avatar sv2 commented on May 30, 2024 2

Thank you, @danihenrique !

On memory usage: swagger-stats only keeps limited amount of data in memory, and it should not grow over time, for the same set of API operations.
First, it stores set of statistics (counters) per API operation. These stats are incremented / updated, but no new objects allocated, so the same amount of data is maintained per operation.
Second, swagger-stats stores timeline statistics - that is, stats for each minute for the last hour. The size of timeline is limited ( default - 60 buckets 1 minutes each, so 1 hour ), and oldest buckets are removed when they expire. So total amount of data stored in timeline is also preserved the same.
Also, swagger-stats stores data on last errors and longest requests. These also capped - only last 100 errors are stored, and only top 100 longest requests are stored; i.e. data on previous errors will be evicted as new ones occur.

If your app receives new request for unknown API Operation, which does not match with any express routes, or any operation defined in swagger spec, then swagger-stats will detect new operation and allocate stats for it. This may happen when new request URI contains some parameter but does not match with any defined parameterized path like /api/{param} or /api/:param.

Typically this should not be the case, but I think it'll be good to introduce option that would cap total number of API Operation swagger-stats maintains in memory, and set default to something like 100. #15

Note that even thought swagger-stats keeps in memory only timeline for last 60 minutes, API monitoring for longer periods of time is still possible. For that, swagger-stats exposes Prometheus metrics - #9 . Prometheus can be used to collect metrics from swagger-stats and store them in it's time series database, which makes it possible to monitor trends over long periods of time.

On authentication: absolutely, great point! I've opened #14 to track this.

Thanks a lot for your feedback!

from swagger-stats.

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.