diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e8386d64..3c785f660 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 }} diff --git a/README.rst b/README.rst index b6173b275..4032cdba8 100644 --- a/README.rst +++ b/README.rst @@ -78,6 +78,7 @@ Microservices Here is a growing list of Open Source microservices built using ASAB: +* `ASAB Iris `_: document rendering, sends output using email, SMS and instant messaging * `SeaCat Auth `_: authentication, authorization, identity management, session management and other access control features diff --git a/asab/web/websocket.py b/asab/web/websocket.py index 1265c9a40..f75c7fe03 100644 --- a/asab/web/websocket.py +++ b/asab/web/websocket.py @@ -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 = {} diff --git a/doc/asab/index.rst b/doc/asab/index.rst index a336472e7..17ee066a0 100644 --- a/doc/asab/index.rst +++ b/doc/asab/index.rst @@ -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 `_ company. @@ -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 @@ -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. diff --git a/doc/asab/metrics.rst b/doc/asab/metrics.rst index ccf9a5a98..71e1d49aa 100644 --- a/doc/asab/metrics.rst +++ b/doc/asab/metrics.rst @@ -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. @@ -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. @@ -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: @@ -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 diff --git a/setup.py b/setup.py index a33945cb3..4aabc2e8c 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,8 @@ 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']), @@ -63,10 +65,10 @@ def run(self): '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',