update to yaml.v3
This commit is contained in:
parent
3f6d5f5ef7
commit
8d88f85f05
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"github.com/jessevdk/go-flags"
|
||||
"github.com/sqshq/sampler/console"
|
||||
"gopkg.in/yaml.v2"
|
||||
"gopkg.in/yaml.v3"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
|
44
example.yml
44
example.yml
|
@ -1,5 +1,5 @@
|
|||
variables:
|
||||
mongoconnection: mongo --quiet --host=localhost blog
|
||||
mongoconnection: mongo --quiet --host=localhost blog
|
||||
runcharts:
|
||||
- title: SEARCH ENGINE RESPONSE TIME (sec)
|
||||
position: [[0, 0], [52, 16]]
|
||||
|
@ -7,10 +7,10 @@ runcharts:
|
|||
- title: Latency threshold exceeded
|
||||
condition: echo "$prev < 0.8 && $cur > 0.8" |bc -l
|
||||
actions:
|
||||
terminal-bell: true
|
||||
sound: true
|
||||
visual: true
|
||||
script: 'say alert: ${label} latency exceeded ${cur} second'
|
||||
terminal-bell: true
|
||||
sound: true
|
||||
visual: true
|
||||
script: 'say alert: ${label} latency exceeded ${cur} second'
|
||||
scale: 3
|
||||
items:
|
||||
- label: GOOGLE
|
||||
|
@ -22,8 +22,8 @@ runcharts:
|
|||
- title: MONGO COLLECTIONS COUNT
|
||||
position: [[53, 0], [27, 8]]
|
||||
legend:
|
||||
enabled: true
|
||||
details: false
|
||||
enabled: true
|
||||
details: false
|
||||
scale: 0
|
||||
items:
|
||||
- label: ACTIVE
|
||||
|
@ -57,41 +57,41 @@ gauges:
|
|||
- title: YEAR PROGRESS
|
||||
position: [[53, 8], [27, 2]]
|
||||
cur:
|
||||
sample: date +%j
|
||||
sample: date +%j
|
||||
max:
|
||||
sample: echo 365
|
||||
sample: echo 365
|
||||
min:
|
||||
sample: echo 0
|
||||
sample: echo 0
|
||||
- title: DAY PROGRESS
|
||||
position: [[53, 10], [27, 2]]
|
||||
cur:
|
||||
sample: date +%H
|
||||
sample: date +%H
|
||||
max:
|
||||
sample: echo 24
|
||||
sample: echo 24
|
||||
min:
|
||||
sample: echo 0
|
||||
sample: echo 0
|
||||
- title: HOUR PROGRESS
|
||||
position: [[53, 12], [27, 2]]
|
||||
cur:
|
||||
sample: date +%M
|
||||
sample: date +%M
|
||||
max:
|
||||
sample: echo 60
|
||||
sample: echo 60
|
||||
min:
|
||||
sample: echo 0
|
||||
sample: echo 0
|
||||
- title: MINUTE PROGRESS
|
||||
position: [[53, 14], [27, 2]]
|
||||
triggers:
|
||||
- title: CLOCK BELL EVERY MINUTE
|
||||
condition: '[ $label == "cur" ] && [ $cur -eq 0 ] && echo 1 || echo 0'
|
||||
actions:
|
||||
sound: true
|
||||
script: say -v samantha `date +%I:%M%p`
|
||||
sound: true
|
||||
script: say -v samantha `date +%I:%M%p`
|
||||
cur:
|
||||
sample: date +%S
|
||||
sample: date +%S
|
||||
max:
|
||||
sample: echo 60
|
||||
sample: echo 60
|
||||
min:
|
||||
sample: echo 0
|
||||
sample: echo 0
|
||||
sparklines:
|
||||
- title: CPU usage
|
||||
position: [[28, 22], [24, 7]]
|
||||
|
@ -111,8 +111,8 @@ textboxes:
|
|||
position: [[8, 30], [13, 7]]
|
||||
rate-ms: 10000
|
||||
sample: curl wttr.in/newyork?0ATQF
|
||||
border: false
|
||||
transform: echo 1
|
||||
border: false
|
||||
- title: San Francisco weather
|
||||
position: [[17, 30], [13, 7]]
|
||||
rate-ms: 10000
|
||||
|
|
2
go.mod
2
go.mod
|
@ -10,5 +10,5 @@ require (
|
|||
github.com/mattn/go-runewidth v0.0.4
|
||||
github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea
|
||||
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.2.2
|
||||
gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae
|
||||
)
|
||||
|
|
4
go.sum
4
go.sum
|
@ -29,5 +29,5 @@ github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE
|
|||
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae h1:ehhBuCxzgQEGk38YjhFv/97fMIc2JGHZAhAWMmEjmu0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package metadata
|
||||
|
||||
import (
|
||||
"gopkg.in/yaml.v2"
|
||||
"gopkg.in/yaml.v3"
|
||||
"log"
|
||||
)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
ui "github.com/gizak/termui/v3"
|
||||
"github.com/sqshq/sampler/config"
|
||||
"github.com/sqshq/sampler/console"
|
||||
"gopkg.in/yaml.v2"
|
||||
"gopkg.in/yaml.v3"
|
||||
"log"
|
||||
"runtime"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue