Skip to content

Commit e9c41a1

Browse files
hipibodengbo
and
dengbo
authored
fix: port fix (#13)
Co-authored-by: dengbo <[email protected]>
1 parent 752c6ca commit e9c41a1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@ Visualize the data stored in DataLayers using Grafana.
5050
6. Write data using schemaless:
5151
Use the following script to write data,
5252
```
53-
curl -XPOST "http://127.0.0.1:18361/write?precision=ns&p=public&u=admin&db=demo" --data-binary "sensor,location=bj speed=103i,temperature=19i 1705639508013794243" -vvv
53+
while true
54+
do
55+
speed=$((RANDOM % 21 + 100))
56+
temperature=$((RANDOM % 11 + 10))
57+
timestamp=$(date +%s%9N) # ns
58+
line="sensor,location=cd speed=${speed}i,temperature=${temperature}i ${timestamp}"
59+
echo $line
60+
sleep 1
61+
curl -XPOST "http://127.0.0.1:18361/write?precision=ns&p=public&u=admin&db=demo" --data-binary "$line"
62+
done
5463
```
5564

5665
7. Query data through the command line:
@@ -75,7 +84,7 @@ curl -XPOST "http://127.0.0.1:18361/write?precision=ns&p=public&u=admin&db=demo"
7584
For example:
7685

7786
``` sql
78-
SELECT time_split('13s', _default_time_index_) as ts, avg(speed) FROM demo.sensor where $__timeFilter(ts) and location='cd' group by ts;
87+
SELECT time_split('5s', _default_time_index_) as ts, avg(speed) FROM demo.sensor where $__timeFilter(ts) and location='cd' group by ts;
7988
```
8089
or use the others [Grafana Variables](https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#global-variables), like this:
8190

grafana/datasource.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ datasources:
44
- name: Datalayers
55
type: datalayers
66
orgId: 1
7-
url: http://datalayers:3308
7+
url: http://datalayers:8360
88
jsonData:
9-
host: "datalayers:3308"
9+
host: "datalayers:8360"
1010
selectedAuthType: "username/password"
1111
username: "admin"
1212
secureJsonData:

0 commit comments

Comments
 (0)