micro / services

Real World Micro Services
Apache License 2.0
1.25k stars 136 forks source link

Usage caps #412

Closed domwong closed 2 years ago

domwong commented 2 years ago

Adds Admin.Usage endpoint for services to implement. Which should return a map of endpoints and what their usage is e.g.

{
    "usage": {
        "Db.Create": {
            "usage": "10",
            "units": "rows"
        }
    }
}

Any endpints that aren't returned are assumed to have no usage caps. So the above response indicates that the user has created 10 rows.

This is currently calculated in realtime, future optimisations may include caching to ease load.