Open mkjiau opened 4 years ago
https://docs.influxdata.com/influxdb/v1.8/concepts/key_concepts/ https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/
Databases > Collections > Documents (JSON Docs)
Databases > Tables > Rows
Databases > Measurements > Points
Points consists of:
measurement name
: which measurement the point belong totime
: the timestamptags
: key-value pairs in order to store index values, usually metadata.fields
: key-value pairs, containing the value itself, non indexed.
name: census
-----------------
time butterflies honeybees location scientist
2015-08-18T00:00:00Z 1 30 1 perpetua
The point is defined by
https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/
+-----------+--------+-+---------+-+---------+
|measurement|,tag_set| |field_set| |timestamp|
+-----------+--------+-+---------+-+---------+
measurement_name,tag_key1=tag_val1,tag_key2=tag_val2 field_key1=field_val1,field_key1=field_val1 timestamp
For example:
weather,location=us-midwest temperature=82 1465839830100400200
SELECT "water_level" FROM "NOAA_water_database"."autogen"."h2o_feet"
SELECT mean("water_level") AS "mean_water_level" FROM "NOAA_water_database"."autogen"."h2o_feet" WHERE "location"='coyote_creek'
SELECT mean("water_level") AS "mean_water_level" FROM "NOAA_water_database"."autogen"."h2o_feet" WHERE "location"='coyote_creek' GROUP BY time(30m) FILL(null)
SHOW TAG KEYS ON "NOAA_water_database" FROM "h2o_feet"
SHOW TAG VALUES ON "NOAA_water_database" FROM "h2o_feet" WITH KEY = "location"
Cardinality (The number of elements in a set/measurement)
SHOW FIELD KEY CARDINALITY ON "NOAA_water_database"
measurement count
average_temperature 1
h2o_feet 2
h2o_pH 1
h2o_quality 1
h2o_temperature 1
SHOW MEASUREMENT CARDINALITY ON "NOAA_water_database"
cardinality estimation
5
h2o_feet,location=santa_monica water_level=5.614,level\ description="between 3 and 6 feet" 1440902880
h2o_quality,location=santa_monica,randtag=1 index=42 1441828440
INSERT temperature,machineId=1,type=boiler actualTemperature=30,targetTemperature=32
curl -i -XPOST 'http://localhost:9001/telegraf' --data-binary 'price,type=BTC close=13333.0,high=1111.0,low=1111.0,open=1111.5,volume=400111 1529290060000000000'
SELECT "high", "low", "open", "volume", "close" FROM "mytail2"."autogen"."price" WHERE time > :dashboardTime:
sandbox enter telegraf
cd /etc/telegraf/
telegraf --config http_service.conf
use taifex_db
SELECT COUNT(*) FROM "taifex_db"."autogen"."dlFutDataDown" WHERE "契約"='TE'
DELETE FROM "dlPcRatioDown" WHERE time > 0
DROP MEASUREMENT dlFutDataDown # ./sandbox influxdb