Skip to content

Commit

Permalink
Merge commit '2e08eb334fb5001aa7db8f552f9566daad487c1d' into release/…
Browse files Browse the repository at this point in the history
…v22.06
  • Loading branch information
ateska committed Nov 16, 2022
2 parents 88db01a + 2e08eb3 commit 9da215a
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Microservices

Here is a growing list of Open Source microservices built using ASAB:

* `ASAB Iris <https://github.com/TeskaLabs/asab-iris>`_: document rendering, sends output using email, SMS and instant messaging
* `SeaCat Auth <https://github.com/TeskaLabs/seacat-auth>`_: authentication, authorization, identity management, session management and other access control features


Expand Down
1 change: 1 addition & 0 deletions asab/web/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class WebSocketFactory(object):


def __init__(self, app, *, timeout=10.0, protocols=(), compress=True, max_msg_size=4194304):
self.App = app
self.Counter = 0
self.WebSockets = {}

Expand Down
10 changes: 5 additions & 5 deletions doc/asab/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Asynchronous Server Application Boilerplate's documentation
===========================================================

Asynchronous Server App Boilerplate (or ASAB for short) is a microservice platform for Python 3.7+ and `asyncio`.
The aim of ASAB is to minimizes the amount of code that needs to be written when building a microservice or an aplication server.
ASAB aims to minimize the amount of code that needs to be written when building a microservice or an application server.
ASAB is fully asynchronous using async/await syntax from Python 3, making your code modern, non-blocking, speedy and hence scalable.
We make every effort to build ASAB container-friendly so that you can deploy ASAB-based microservice via Docker or Kubernetes in a breeze.

ASAB is the free and open-source software, available under BSD licence.
ASAB is free and open-source software, available under BSD licence.
It means that anyone is freely licenced to use, copy, study, and change the software in any way, and the source code is openly shared so that people could voluntarily improve the design of the software.
Anyone can (and is encouraged to) use ASAB in his or her projects, for free.
A current maintainer is a `TeskaLabs Ltd <https://teskalabs.com>`_ company.
Expand All @@ -18,7 +18,7 @@ Contributions are welcome!
ASAB is designed to be powerful yet simple
------------------------------------------

Here is a complete example of the fully working microservice:
Here is a complete example of a fully working microservice:

.. code:: python
Expand All @@ -34,8 +34,8 @@ Here is a complete example of the fully working microservice:
app.run()
ASAB is a right choice when
---------------------------
ASAB is the right choice when
-----------------------------

- using Python 3.7+.
- building the microservice or the application server.
Expand Down
27 changes: 18 additions & 9 deletions doc/asab/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See the full example here: https://github.com/TeskaLabs/asab/blob/master/example


Types of Metrics
---------------
----------------

- :class:`Gauge` stores single numerical values which can go up and down. Implements :func:`set` method to set the metric values.
- :class:`Counter` is a cumulative metric whose values can increase or decrease. Implements :func:`add` and :func:`sub` methods.
Expand Down Expand Up @@ -193,7 +193,7 @@ Configuration is required.
Web Requests Metrics
--------------------

There are default metrics in ASAB framework. :class:`WebService` class automatically provides metrics counting web requests.
ASAB :class:`WebService` class automatically provides metrics counting web requests.
There are 5 metrics quantifying requests to all ASAB endpoints.

- `web_requests` - Counts requests to asab endpoints as events per minute.
Expand All @@ -203,8 +203,20 @@ There are 5 metrics quantifying requests to all ASAB endpoints.
- `web_requests_duration_hist` - Cumulative histogram counting requests in buckets defined by the request duration.


Memory Metrics
Native Metrics
--------------

You can opt out of Native Metrics through configuration by setting `native_metrics` to `false`. Default is `true`.

*example configuration*

.. code::
[asab:metrics]
native_metrics=true
**Memory Metrics**

A gauge with the name ``os.stat`` gathers information about memory usage by your application.

You can find several metric values there:
Expand All @@ -220,14 +232,11 @@ You can find several metric values there:
- VmPMD - Size of second-level page tables
- VmSwap - Swapped-out virtual memory size by anonymous private pages; shmem swap usage is not included

You can opt out of Memory Metrics through configuration by setting `native_metrics` to `false`. Default is `true`.
**Logs Counter**

*example configuration*
There is a default Counter named ``logs`` with values ``warnings``, ``errors``, and ``critical``, counting logs with respective levels.
It is a humble tool for application health monitoring.

.. code::
[asab:metrics]
native_metrics=true


Reference
Expand Down
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,19 @@ def run(self):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
keywords='asyncio',
packages=find_packages(exclude=['module_sample']),
project_urls={
'Source': 'https://github.com/TeskaLabs/asab'
},
install_requires=[
'aiohttp==3.8.3',
'kazoo==2.8.0',
'pyyaml==6.0',
'fastjsonschema==2.16.2',
'aiohttp>=3.8.3,<4',
'fastjsonschema>=2.16.2,<3',
'kazoo>=2.9.0,<3',
'PyYAML>=6.0,<7'
],
extras_require={
'git': 'pygit2>=1.9.1',
Expand Down

0 comments on commit 9da215a

Please sign in to comment.