Skip to content

Commit

Permalink
feat: add health check example
Browse files Browse the repository at this point in the history
  • Loading branch information
daviderli614 committed Sep 11, 2024
1 parent 2f68104 commit 0b8c054
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions examples/healthcheck/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Health check for GreptimeDB

## Run Health Check

```go
go run main.go
```

Output:

```log
2024/09/11 12:13:11 the greptimedb is health
```
6 changes: 3 additions & 3 deletions examples/healthcheck/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func init() {
}

func main() {
resp, err := client.HealthCheck(context.TODO())
_, err := client.HealthCheck(context.Background())
if err != nil {
log.Println(err)
log.Println("failed to health check:", err)
}
log.Println("health check response:", resp)
log.Println("the greptimedb is health")
}

0 comments on commit 0b8c054

Please sign in to comment.