-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRIFT-478: Access to metrics from InfluxDB (#10)
* rename get_topic_data -> get_package_names * refactoring * refactor and test InfluxDB.query_data * implement metrics * add test for Client.get_metrics * fix pylint errors * update CHANGELOG * add example to docstring * fix pylint errors * update wavelet buffer * fix typo
- Loading branch information
Showing
12 changed files
with
266 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ repos: | |
name: black | ||
entry: black | ||
language: python | ||
language_version: python3.8 | ||
args: | ||
- . | ||
- --check |
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 |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
max-line-length = 88 | ||
load-plugins=pylint_protobuf | ||
extension-pkg-whitelist=pydantic | ||
|
||
[FORMAT] | ||
good-names=dt |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
|
||
from drift_client import DriftClient | ||
|
||
import logging | ||
import sys | ||
import datetime | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
|
||
def main(): | ||
# Init | ||
drift_client = DriftClient("drift-test-rig.local", os.getenv("DRIFT_PASSWORD")) | ||
metrics = drift_client.get_metrics( | ||
"energy-distr-1", | ||
start=datetime.datetime.utcnow() - datetime.timedelta(minutes=15), | ||
stop=datetime.datetime.utcnow(), | ||
names=["d1", "d2"], | ||
) | ||
|
||
print("Loaded %d points", len(metrics)) | ||
for point in metrics: | ||
print(point) | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
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
Oops, something went wrong.