12
Cargo.lock
generated
12
Cargo.lock
generated
@@ -216,9 +216,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.32"
|
version = "0.4.33"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a"
|
checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android-tzdata",
|
"android-tzdata",
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
@@ -1215,18 +1215,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project"
|
name = "pin-project"
|
||||||
version = "1.1.3"
|
version = "1.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422"
|
checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pin-project-internal",
|
"pin-project-internal",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-internal"
|
name = "pin-project-internal"
|
||||||
version = "1.1.3"
|
version = "1.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
|
checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@@ -4,6 +4,11 @@ services:
|
|||||||
file: support/clickhouse/docker-compose.yml
|
file: support/clickhouse/docker-compose.yml
|
||||||
service: clickhouse
|
service: clickhouse
|
||||||
|
|
||||||
|
grafana:
|
||||||
|
extends:
|
||||||
|
file: support/grafana/docker-compose.yml
|
||||||
|
service: grafana
|
||||||
|
|
||||||
qrust:
|
qrust:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@@ -20,3 +25,4 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
clickhouse-lib:
|
clickhouse-lib:
|
||||||
clickhouse-log:
|
clickhouse-log:
|
||||||
|
grafana-lib:
|
||||||
|
12
support/grafana/datasources/clickhouse.yaml
Normal file
12
support/grafana/datasources/clickhouse.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
datasources:
|
||||||
|
- name: ClickHouse
|
||||||
|
type: grafana-clickhouse-datasource
|
||||||
|
jsonData:
|
||||||
|
server: localhost
|
||||||
|
port: 9000
|
||||||
|
username: ${CLICKHOUSE_USER}
|
||||||
|
defaultDatabase: ${CLICKHOUSE_DB}
|
||||||
|
secureJsonData:
|
||||||
|
password: ${CLICKHOUSE_PASSWORD}
|
19
support/grafana/docker-compose.yml
Normal file
19
support/grafana/docker-compose.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
services:
|
||||||
|
grafana:
|
||||||
|
image: grafana/grafana
|
||||||
|
hostname: grafana
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- grafana-lib:/var/lib/grafana
|
||||||
|
- ./datasources:/etc/grafana/provisioning/datasources
|
||||||
|
environment:
|
||||||
|
- GF_INSTALL_PLUGINS=grafana-clickhouse-datasource
|
||||||
|
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER}
|
||||||
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
|
||||||
|
- CLICKHOUSE_USER=${CLICKHOUSE_USER}
|
||||||
|
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD}
|
||||||
|
- CLICKHOUSE_DB=${CLICKHOUSE_DB}
|
||||||
|
network_mode: host
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
grafana-lib:
|
17
support/grafana/queries.sql
Normal file
17
support/grafana/queries.sql
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
SELECT $__timeInterval(time),
|
||||||
|
any(open) as open,
|
||||||
|
max(high) as high,
|
||||||
|
min(low) as low,
|
||||||
|
anyLast(close) as close,
|
||||||
|
sum(volume) as volume
|
||||||
|
FROM bars FINAL
|
||||||
|
WHERE $__timeFilter(time)
|
||||||
|
AND symbol = '${bars}'
|
||||||
|
GROUP BY time;
|
||||||
|
|
||||||
|
SELECT time_created AS time,
|
||||||
|
headline
|
||||||
|
FROM news FINAL
|
||||||
|
WHERE $__timeFilter(time)
|
||||||
|
AND hasAny(symbols, [${news}])
|
||||||
|
ORDER BY time ASC;
|
Reference in New Issue
Block a user