-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update design docs * Prepare class and docs * Add inspect for db and some improve * Support query and inspect trackings * Convert timestamp to datetime * More accuracy of datettime * More on analyzer & Resolving circular dependencies * Intro autodoc-pydantic * Fix docs and more on base * Support detailed query * Support orderby in query * Add with_details on brief * Support tracers, collector_ids and distinct
- Loading branch information
Showing
47 changed files
with
1,076 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DBAnalyzer | ||
=============================== | ||
|
||
``DBAnalyzer`` | ||
|
||
.. automodule:: duetector.analyzer.db | ||
:members: | ||
:undoc-members: | ||
:private-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Analyzer | ||
========================================= | ||
|
||
|
||
.. autoclass:: duetector.analyzer.base.Analyzer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
Avaliable Analyzer | ||
----------------------------------------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
DB Analyzer <db> | ||
|
||
Data Models | ||
----------------------------------------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
Data Models <models> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Data Models | ||
=============================== | ||
|
||
.. automodule:: duetector.analyzer.models | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Models for collectors | ||
==================================== | ||
|
||
.. autoclass:: duetector.collectors.models.Tracking | ||
.. automodule:: duetector.collectors.models | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Utilities | ||
=============================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Utilities Documentation: | ||
|
||
Exceptions <exceptions> | ||
|
||
Database utilities <db> | ||
Config utilities <config> | ||
Tools utilities <tools/index> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from datetime import datetime | ||
from typing import List, Optional | ||
|
||
from duetector.analyzer.models import AnalyzerBrief, Tracking | ||
from duetector.config import Configuable | ||
|
||
|
||
class Analyzer(Configuable): | ||
""" | ||
A base class for all analyzers. | ||
""" | ||
|
||
default_config = {} | ||
""" | ||
Default config for ``Analyzer``. | ||
""" | ||
|
||
config_scope = "analyzer" | ||
""" | ||
Config scope for this analyzer. | ||
Subclasses cloud override this. | ||
""" | ||
|
||
def get_all_tracers(self) -> List[str]: | ||
""" | ||
Get all tracers from storage. | ||
Returns: | ||
List[str]: List of tracer's name. | ||
""" | ||
raise NotImplementedError | ||
|
||
def get_all_collector_ids(self) -> List[str]: | ||
""" | ||
Get all collector id from storage. | ||
Returns: | ||
List[str]: List of collector id. | ||
""" | ||
raise NotImplementedError | ||
|
||
def query( | ||
self, | ||
tracer: Optional[str] = None, | ||
collector_id: Optional[str] = None, | ||
start_datetime: Optional[datetime] = None, | ||
end_datetime: Optional[datetime] = None, | ||
start: int = 0, | ||
limit: int = 20, | ||
) -> List[Tracking]: | ||
""" | ||
Query tracking data from storage. | ||
""" | ||
raise NotImplementedError | ||
|
||
def brief( | ||
self, | ||
start_datetime: Optional[datetime] = None, | ||
end_datetime: Optional[datetime] = None, | ||
) -> AnalyzerBrief: | ||
""" | ||
Get brief of analyzer. | ||
""" | ||
raise NotImplementedError | ||
|
||
def analyze(self): | ||
# TODO: Not design yet. | ||
pass |
Oops, something went wrong.