Giter Site home page Giter Site logo

Comments (6)

neilcook avatar neilcook commented on July 19, 2024

@sshipway wrote (copied from #190):
It would be very useful for the existing stats call to also provide counters for the return codes, not just for the function calls.

IE, as well as counts on number of allow() and report() calls made, also counts on the number of allow() calls split by return code 0, -1, or >0.

Even better would be to have a generic count, so in the Lua code you could use something like
addstat(key) followed by increment(key) in an allow or report function, and then the normal stats() call would also return "counter.key: 1" or similar. I know we could implement this in lua using a database, but it would be slow.

Counters like this could then be fed into your favourite monitoring package (MRTG, Zabbix, Nagio, Cacti...) to obtain graphs of weakforced performance and behaviour.

from weakforced.

neilcook avatar neilcook commented on July 19, 2024

Addressed in #191

from weakforced.

sshipway avatar sshipway commented on July 19, 2024

The new custom stats feature is awesome; great to see this. However, can we have separate stats counters gathered based on the return value from the allow function (denies, tarpits, permits)? Currently, there is no stat for the number of requests denied due to blacklisting, for example, which is a useful indicator of how well we're doing. A custom stat in the lua couldn't do this as blacklist is checked before it gets there.

from weakforced.

neilcook avatar neilcook commented on July 19, 2024

from weakforced.

neilcook avatar neilcook commented on July 19, 2024

This should give you what you want:

showCommandStats()
addBLEntry=6
allow=6
allow_allowed=21
allow_blacklisted=6
allow_denied=5
allow_tarpitted=0
countLogins=0
custom=1
delBLEntry=0
getBL=1
getDBStats=2
incLogins=0
ping=1
report=134
reset=0
resetLogins=0
stats=1

Is now part of PR #189

from weakforced.

neilcook avatar neilcook commented on July 19, 2024

Fixed in PRs #189 and #191

from weakforced.

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.