A few samples of Prometheus queries in Grafana dashboards.
{
"datasource": {
"type": "prometheus",
# About | |
# ===== | |
# Select most recent `pax` measurement values from ESP32-Paxcounter | |
# devices recording data using the Kotori data historian. | |
# | |
# Synopsis | |
# ======== | |
# | |
# pip install jmespath requests | |
# python3 example_jmespath_paxcounter_kotori.py "https://swarm.hiveeyes.org/api/hiveeyes/zku/paxcounter/bauschilderung/data.json?from=now-5m" |
""" | |
About | |
===== | |
Example program to demonstrate efficient batched inserts using CrateDB and | |
pandas, based on SQLAlchemy's "insertmanyvalues" and CrateDB's bulk import | |
HTTP endpoint. | |
- https://docs.sqlalchemy.org/core/connections.html#controlling-the-batch-size | |
- https://crate.io/docs/crate/reference/en/5.2/interfaces/http.html#bulk-operations |
""" | |
Evaluate `.rowcount` attribute on DELETE queries with SQLAlchemy ORM 1.3, 1.4 and 2.0. | |
docker run --rm -it --publish=4200:4200 crate | |
pip install 'sqlalchemy<1.4' --upgrade | |
pip install 'sqlalchemy<1.5' --upgrade | |
pip install 'sqlalchemy<2.1' --upgrade | |
python example_sa_orm_rowcount.py |
""" | |
Evaluate `.rowcount` attribute on DELETE queries with SQLAlchemy 1.3, 1.4 and 2.0. | |
docker run --rm -it --publish=4200:4200 crate | |
python example_sa_rowcount.py | |
""" | |
import sqlalchemy as sa | |
try: | |
from sqlalchemy.orm import declarative_base, sessionmaker |
""" | |
About | |
===== | |
Example program to demonstrate multi-row inserts and batched inserts | |
using SQLAlchemy's "insertmanyvalues_page_size" option. | |
https://docs.sqlalchemy.org/core/connections.html#controlling-the-batch-size | |
Synopsis |
""" | |
About | |
===== | |
Evaluate saving Dask DataFrames into CrateDB. | |
Usage | |
===== | |
:: |
--- tests/client_tests/python/asyncpg/test_asyncpg.py 2023-03-07 21:33:30.000000000 +0100 | |
+++ tests/client_tests/python/psycopg3/test_psycopg3.py 2023-03-07 21:33:30.000000000 +0100 | |
@@ -1,14 +1,15 @@ | |
""" | |
About | |
===== | |
-Test cases for CrateDB using `asyncpg`. | |
+ | |
+Test cases for CrateDB using `psycopg3` [1,2]. | |
""" | |
Download all versions from PyPI and spool them into Git repository. | |
pip install click GitPython requests | |
""" | |
import shutil | |
import tempfile | |
from distutils.version import LooseVersion | |
from pathlib import Path |
""" | |
About | |
===== | |
Evaluate CrateDB server-side cursors with `psycopg3`. | |
- https://crate.io/docs/crate/reference/en/5.2/sql/statements/declare.html | |
- https://crate.io/blog/feature-focus-working-with-cursors-with-sql-commands | |
Introduction | |
============ |