mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add functions/vendor files
This commit is contained in:
73
vendor/github.com/amir/raidman/README.md
generated
vendored
Normal file
73
vendor/github.com/amir/raidman/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
Raidman
|
||||
=======
|
||||
|
||||
Go Riemann client
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/amir/raidman"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c, err := raidman.Dial("tcp", "localhost:5555")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
var event = &raidman.Event{
|
||||
State: "success",
|
||||
Host: "raidman",
|
||||
Service: "raidman-sample",
|
||||
Metric: 100,
|
||||
Ttl: 10,
|
||||
}
|
||||
|
||||
// send one event
|
||||
err = c.Send(event)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// send multiple events at once
|
||||
err = c.SendMulti([]*raidman.Event{
|
||||
&raidman.Event{
|
||||
State: "success",
|
||||
Host: "raidman",
|
||||
Service: "raidman-sample",
|
||||
Metric: 100,
|
||||
Ttl: 10,
|
||||
},
|
||||
&raidman.Event{
|
||||
State: "failure",
|
||||
Host: "raidman",
|
||||
Service: "raidman-sample",
|
||||
Metric: 100,
|
||||
Ttl: 10,
|
||||
},
|
||||
&raidman.Event{
|
||||
State: "success",
|
||||
Host: "raidman",
|
||||
Service: "raidman-sample",
|
||||
Metric: 100,
|
||||
Ttl: 10,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
events, err := c.Query("host = \"raidman\"")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if len(events) < 1 {
|
||||
panic("Submitted event not found")
|
||||
}
|
||||
|
||||
c.Close()
|
||||
}
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user