Skip to content

Commit

Permalink
Fix docs and more on base
Browse files Browse the repository at this point in the history
  • Loading branch information
Wh1isper committed Sep 11, 2023
1 parent 8c8a2a9 commit 6e85830
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/analyzer/db.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DBAnalyzer

``DBAnalyzer``

.. autoclass:: duetector.analyzer.db.DBAnalyzer
.. automodule:: duetector.analyzer.db
:members:
:undoc-members:
:private-members:
Expand Down
32 changes: 31 additions & 1 deletion duetector/analyzer/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import List
from datetime import datetime
from typing import List, Optional

from duetector.analyzer.models import AnalyzerBrief, Tracking
from duetector.config import Configuable


Expand Down Expand Up @@ -37,3 +39,31 @@ def get_all_collector_ids(self) -> List[str]:
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
4 changes: 2 additions & 2 deletions duetector/analyzer/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ def query(
collector_id (Optional[str], optional): Collector id. Defaults to None, all collector id will be queried.
start_datetime (Optional[datetime], optional): Start time. Defaults to None.
end_datetime (Optional[datetime], optional): End time. Defaults to None.
start (Optional[int], optional): Start index. Defaults to 0.
start (int, optional): Start index. Defaults to 0.
limit (int, optional): Limit of records. Defaults to 20. ``0`` means no limit.
Returns:
List[Tracking]: List of tracking records.
List[duetector.analyzer.models.Tracking]: List of tracking records.
"""

Expand Down

0 comments on commit 6e85830

Please sign in to comment.