Skip to content

Commit

Permalink
add demo
Browse files Browse the repository at this point in the history
Signed-off-by: jyz0309 <[email protected]>
  • Loading branch information
jyz0309 committed Jan 6, 2025
1 parent 106f7ea commit 8080467
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# timelite
# timelite(WIP)

timelite 是一个基于 Prometheus TSDB 的嵌入式时序数据库以及查询引擎,支持存储 Prometheus 格式的数据以及 PromQL 查询,并在 terminal 中提供类 Grafana 的交互式查询。

## demo
<video src="demo/demo.mp4" controls></video>

## 特性

- 支持 PromQL 查询,并提供交互式查询
Expand All @@ -15,7 +18,21 @@ go install github.com/timelite/timelite
```

## 使用

Commands:
```bash
timelite run tsdb
help [<command>...]
Show help.

query [<flags>]
Query the data in the timeline.
example:
timelite query --config-file="config.json" --storage-path="./storage/tsdb"

tsdb mock
Mock the tsdb data.

tsdb run [<flags>]
Run the tsdb server.
example:
timelite tsdb run --config-path="./storage/conf" --storage-path="./storage/tsdb" --host="0.0.0.0:9090"
```
Binary file added demo/demo.mp4
Binary file not shown.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {
app.HelpFlag.Short('h')

queryCmd := app.Command("query", "Query the data in the timeline.")
queryConfigPath := queryCmd.Flag("config-path", "The path to the config file.").String()
queryConfigFile := queryCmd.Flag("config-file", "The path to the config file.").String()
queryCmd.Flag("storage-path", "The path to the tsdb data.").Default("./storage/tsdb").String()

tsdbCmd := app.Command("tsdb", "Manage the tsdb.")
Expand All @@ -38,10 +38,10 @@ func main() {

switch parseCmd {
case queryCmd.FullCommand():
if queryConfigPath == nil {
if queryConfigFile == nil {
panic("config path is required")
}
err := conf.GetConfig(*queryConfigPath)
err := conf.GetConfig(*queryConfigFile)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 8080467

Please sign in to comment.