update to yaml.v3

This commit is contained in:
sqshq 2019-06-21 00:45:32 -04:00
parent 3f6d5f5ef7
commit 8d88f85f05
6 changed files with 28 additions and 28 deletions

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"github.com/jessevdk/go-flags" "github.com/jessevdk/go-flags"
"github.com/sqshq/sampler/console" "github.com/sqshq/sampler/console"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v3"
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"

View File

@ -1,5 +1,5 @@
variables: variables:
mongoconnection: mongo --quiet --host=localhost blog mongoconnection: mongo --quiet --host=localhost blog
runcharts: runcharts:
- title: SEARCH ENGINE RESPONSE TIME (sec) - title: SEARCH ENGINE RESPONSE TIME (sec)
position: [[0, 0], [52, 16]] position: [[0, 0], [52, 16]]
@ -7,10 +7,10 @@ runcharts:
- title: Latency threshold exceeded - title: Latency threshold exceeded
condition: echo "$prev < 0.8 && $cur > 0.8" |bc -l condition: echo "$prev < 0.8 && $cur > 0.8" |bc -l
actions: actions:
terminal-bell: true terminal-bell: true
sound: true sound: true
visual: true visual: true
script: 'say alert: ${label} latency exceeded ${cur} second' script: 'say alert: ${label} latency exceeded ${cur} second'
scale: 3 scale: 3
items: items:
- label: GOOGLE - label: GOOGLE
@ -22,8 +22,8 @@ runcharts:
- title: MONGO COLLECTIONS COUNT - title: MONGO COLLECTIONS COUNT
position: [[53, 0], [27, 8]] position: [[53, 0], [27, 8]]
legend: legend:
enabled: true enabled: true
details: false details: false
scale: 0 scale: 0
items: items:
- label: ACTIVE - label: ACTIVE
@ -57,41 +57,41 @@ gauges:
- title: YEAR PROGRESS - title: YEAR PROGRESS
position: [[53, 8], [27, 2]] position: [[53, 8], [27, 2]]
cur: cur:
sample: date +%j sample: date +%j
max: max:
sample: echo 365 sample: echo 365
min: min:
sample: echo 0 sample: echo 0
- title: DAY PROGRESS - title: DAY PROGRESS
position: [[53, 10], [27, 2]] position: [[53, 10], [27, 2]]
cur: cur:
sample: date +%H sample: date +%H
max: max:
sample: echo 24 sample: echo 24
min: min:
sample: echo 0 sample: echo 0
- title: HOUR PROGRESS - title: HOUR PROGRESS
position: [[53, 12], [27, 2]] position: [[53, 12], [27, 2]]
cur: cur:
sample: date +%M sample: date +%M
max: max:
sample: echo 60 sample: echo 60
min: min:
sample: echo 0 sample: echo 0
- title: MINUTE PROGRESS - title: MINUTE PROGRESS
position: [[53, 14], [27, 2]] position: [[53, 14], [27, 2]]
triggers: triggers:
- title: CLOCK BELL EVERY MINUTE - title: CLOCK BELL EVERY MINUTE
condition: '[ $label == "cur" ] && [ $cur -eq 0 ] && echo 1 || echo 0' condition: '[ $label == "cur" ] && [ $cur -eq 0 ] && echo 1 || echo 0'
actions: actions:
sound: true sound: true
script: say -v samantha `date +%I:%M%p` script: say -v samantha `date +%I:%M%p`
cur: cur:
sample: date +%S sample: date +%S
max: max:
sample: echo 60 sample: echo 60
min: min:
sample: echo 0 sample: echo 0
sparklines: sparklines:
- title: CPU usage - title: CPU usage
position: [[28, 22], [24, 7]] position: [[28, 22], [24, 7]]
@ -111,8 +111,8 @@ textboxes:
position: [[8, 30], [13, 7]] position: [[8, 30], [13, 7]]
rate-ms: 10000 rate-ms: 10000
sample: curl wttr.in/newyork?0ATQF sample: curl wttr.in/newyork?0ATQF
border: false
transform: echo 1 transform: echo 1
border: false
- title: San Francisco weather - title: San Francisco weather
position: [[17, 30], [13, 7]] position: [[17, 30], [13, 7]]
rate-ms: 10000 rate-ms: 10000

2
go.mod
View File

@ -10,5 +10,5 @@ require (
github.com/mattn/go-runewidth v0.0.4 github.com/mattn/go-runewidth v0.0.4
github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea
github.com/mitchellh/go-wordwrap v1.0.0 // indirect 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
View File

@ -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= 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 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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.v3 v3.0.0-20190502103701-55513cacd4ae h1:ehhBuCxzgQEGk38YjhFv/97fMIc2JGHZAhAWMmEjmu0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -1,7 +1,7 @@
package metadata package metadata
import ( import (
"gopkg.in/yaml.v2" "gopkg.in/yaml.v3"
"log" "log"
) )

View File

@ -4,7 +4,7 @@ import (
ui "github.com/gizak/termui/v3" ui "github.com/gizak/termui/v3"
"github.com/sqshq/sampler/config" "github.com/sqshq/sampler/config"
"github.com/sqshq/sampler/console" "github.com/sqshq/sampler/console"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v3"
"log" "log"
"runtime" "runtime"
) )