1.1rc2: instrumentation fix

This commit is contained in:
AF 2022-12-30 09:51:17 +00:00
parent 369882c85c
commit c520ef646a
4 changed files with 23 additions and 18 deletions

View File

@ -1,3 +1,17 @@
# Licensed under MIT License. Copyright: 2022-2023 PARRRATE TNV.
__all__ = (
'KVFactory',
'KVJson',
'DbConnection',
'DbFactory',
'Db',
'Transaction',
'TransactionView',
'FutureContext',
)
import abc import abc
import asyncio import asyncio
import concurrent.futures import concurrent.futures
@ -11,17 +25,6 @@ from functools import wraps
from io import StringIO, UnsupportedOperation from io import StringIO, UnsupportedOperation
from typing import IO, Any, Callable, TypeVar from typing import IO, Any, Callable, TypeVar
__all__ = (
'KVFactory',
'KVJson',
'DbConnection',
'DbFactory',
'Db',
'Transaction',
'TransactionView',
'FutureContext',
)
class Request: class Request:
__slots__ = ( __slots__ = (
@ -191,7 +194,7 @@ class NightlyWarning(Warning):
enabled = True enabled = True
TDecoratedNightly = TypeVar('TDecoratedNightly', bound=Callable | type | bool) TDecoratedNightly = TypeVar('TDecoratedNightly', bound=Callable | type | None)
def nightly(decorated: TDecoratedNightly = None, prefix: str = '', stacklevel=2) -> TDecoratedNightly: def nightly(decorated: TDecoratedNightly = None, prefix: str = '', stacklevel=2) -> TDecoratedNightly:

View File

@ -1,10 +1,12 @@
import ptvp35
from rainbowadn.instrument import Instrumentation from rainbowadn.instrument import Instrumentation
from .__init__ import *
__all__ = ('InstrumentDiskWrites', 'NightlyInstrumentation')
class InstrumentDiskWrites(Instrumentation): class InstrumentDiskWrites(Instrumentation):
def __init__(self, /): def __init__(self, /):
super().__init__(DbConnection, '_write_to_disk_sync') super().__init__(ptvp35.DbConnection, '_write_to_disk_sync')
def on_write(self, line: str, /) -> None: def on_write(self, line: str, /) -> None:
pass pass

View File

@ -2,11 +2,11 @@ from setuptools import setup
setup( setup(
name='ptvp35', name='ptvp35',
version='1.1rc1', version='1.1rc2',
packages=['ptvp35'], packages=['ptvp35'],
url='https://gitea.ongoteam.net/PTV/ptvp35', url='https://gitea.ongoteam.net/PTV/ptvp35',
license='MIT', license='MIT',
author='PARRRATE TNV', author='PARRRATE TNV',
author_email='', author_email='',
description='' description='',
) )

View File

@ -4,8 +4,8 @@ import sys
import threading import threading
from contextlib import ExitStack from contextlib import ExitStack
from ptvp35 import DbConnection, DbFactory, KVJson from ptvp35 import *
from ptvp35.instrumentation import InstrumentDiskWrites, NightlyInstrumentation from ptvp35.instrumentation import *
async def aprint(*args, **kwargs): async def aprint(*args, **kwargs):