better metrics

This commit is contained in:
Anton Evangelatov 2020-06-26 18:56:09 +02:00
parent 018406b50c
commit 0487d60d0e
4 changed files with 29 additions and 115 deletions

View File

@ -16,7 +16,7 @@
"gnetId": null, "gnetId": null,
"graphTooltip": 0, "graphTooltip": 0,
"id": 16, "id": 16,
"iteration": 1593188697650, "iteration": 1593188264284,
"links": [], "links": [],
"panels": [ "panels": [
{ {
@ -145,7 +145,7 @@
"alignAsTable": true, "alignAsTable": true,
"avg": false, "avg": false,
"current": false, "current": false,
"max": true, "max": false,
"min": false, "min": false,
"show": true, "show": true,
"total": true, "total": true,
@ -421,7 +421,7 @@
"alignAsTable": true, "alignAsTable": true,
"avg": false, "avg": false,
"current": false, "current": false,
"max": true, "max": false,
"min": false, "min": false,
"rightSide": true, "rightSide": true,
"show": true, "show": true,
@ -444,6 +444,7 @@
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
"alias": "send-data-to - $tag_miner ($tag_run)",
"groupBy": [ "groupBy": [
{ {
"params": [ "params": [
@ -451,6 +452,18 @@
], ],
"type": "time" "type": "time"
}, },
{
"params": [
"miner"
],
"type": "tag"
},
{
"params": [
"run"
],
"type": "tag"
},
{ {
"params": [ "params": [
"0" "0"
@ -458,7 +471,7 @@
"type": "fill" "type": "fill"
} }
], ],
"measurement": "diagnostics.find-data.offer.t0101.counter", "measurement": "diagnostics.send-data-to.counter",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"refId": "A", "refId": "A",
@ -480,6 +493,7 @@
"tags": [] "tags": []
}, },
{ {
"alias": "find-data.offer - $tag_miner ($tag_run)",
"groupBy": [ "groupBy": [
{ {
"params": [ "params": [
@ -489,111 +503,9 @@
}, },
{ {
"params": [ "params": [
"0" "miner"
], ],
"type": "fill" "type": "tag"
}
],
"measurement": "diagnostics.find-data.offer.t0102.counter",
"orderByTime": "ASC",
"policy": "default",
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"count"
],
"type": "field"
},
{
"params": [],
"type": "sum"
}
]
],
"tags": []
},
{
"groupBy": [
{
"params": [
"$myinterval"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "diagnostics.find-data.offer.t0103.counter",
"orderByTime": "ASC",
"policy": "default",
"refId": "C",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"count"
],
"type": "field"
},
{
"params": [],
"type": "sum"
}
]
],
"tags": []
},
{
"groupBy": [
{
"params": [
"$myinterval"
],
"type": "time"
},
{
"params": [
"0"
],
"type": "fill"
}
],
"measurement": "diagnostics.find-data.offer.t0104.counter",
"orderByTime": "ASC",
"policy": "default",
"refId": "D",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"count"
],
"type": "field"
},
{
"params": [],
"type": "sum"
}
]
],
"tags": []
},
{
"groupBy": [
{
"params": [
"$myinterval"
],
"type": "time"
}, },
{ {
"params": [ "params": [
@ -611,7 +523,7 @@
"measurement": "diagnostics.find-data.offer.counter", "measurement": "diagnostics.find-data.offer.counter",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"refId": "E", "refId": "D",
"resultFormat": "time_series", "resultFormat": "time_series",
"select": [ "select": [
[ [
@ -634,7 +546,7 @@
"timeFrom": null, "timeFrom": null,
"timeRegions": [], "timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "data offers", "title": "send data to ; got retrieve offers from",
"tooltip": { "tooltip": {
"shared": true, "shared": true,
"sort": 0, "sort": 0,
@ -987,7 +899,7 @@
] ]
}, },
"time": { "time": {
"from": "now-10m", "from": "now-15m",
"to": "now" "to": "now"
}, },
"timepicker": { "timepicker": {
@ -1006,5 +918,5 @@
"timezone": "", "timezone": "",
"title": "Project Oni - Baseline test", "title": "Project Oni - Baseline test",
"uid": "8em8RXWMz", "uid": "8em8RXWMz",
"version": 3 "version": 4
} }

View File

@ -71,6 +71,7 @@ func runBaselineClient(t *TestEnvironment) error {
if err := client.NetConnect(ctx, minerAddr.PeerAddr); err != nil { if err := client.NetConnect(ctx, minerAddr.PeerAddr); err != nil {
return err return err
} }
t.D().Counter(fmt.Sprintf("send-data-to,miner=%s", minerAddr.ActorAddr)).Inc(1)
t.RecordMessage("selected %s as the miner", minerAddr.ActorAddr) t.RecordMessage("selected %s as the miner", minerAddr.ActorAddr)
@ -175,8 +176,7 @@ func retrieveData(t *TestEnvironment, ctx context.Context, err error, client api
panic(err) panic(err)
} }
for _, o := range offers { for _, o := range offers {
t.D().Counter(fmt.Sprintf("find-data.offer.%s", o.Miner)).Inc(1) t.D().Counter(fmt.Sprintf("find-data.offer,miner=%s", o.Miner)).Inc(1)
t.D().Counter("find-data.offer").Inc(1)
} }
t.D().ResettingHistogram("find-data").Update(int64(time.Since(t1))) t.D().ResettingHistogram("find-data").Update(int64(time.Since(t1)))

View File

@ -21,7 +21,7 @@ require (
github.com/libp2p/go-libp2p-core v0.6.0 github.com/libp2p/go-libp2p-core v0.6.0
github.com/libp2p/go-libp2p-pubsub-tracer v0.0.0-20200626141350-e730b32bf1e6 github.com/libp2p/go-libp2p-pubsub-tracer v0.0.0-20200626141350-e730b32bf1e6
github.com/multiformats/go-multiaddr v0.2.2 github.com/multiformats/go-multiaddr v0.2.2
github.com/testground/sdk-go v0.2.3-0.20200617132925-2e4d69f9ba38 github.com/testground/sdk-go v0.2.3-0.20200626163933-5221c19734d9
) )
// This will work in all build modes: docker:go, exec:go, and local go build. // This will work in all build modes: docker:go, exec:go, and local go build.

View File

@ -1343,6 +1343,8 @@ github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpP
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/testground/sdk-go v0.2.3-0.20200617132925-2e4d69f9ba38 h1:6s2/aFZVGJKX5V/eID4Zlt0F1AVEgllZOtPjzJVR6yQ= github.com/testground/sdk-go v0.2.3-0.20200617132925-2e4d69f9ba38 h1:6s2/aFZVGJKX5V/eID4Zlt0F1AVEgllZOtPjzJVR6yQ=
github.com/testground/sdk-go v0.2.3-0.20200617132925-2e4d69f9ba38/go.mod h1:3auzMDXaoK7NQ+CLQS3pqp4hmREECWO9V+TJi/IWmms= github.com/testground/sdk-go v0.2.3-0.20200617132925-2e4d69f9ba38/go.mod h1:3auzMDXaoK7NQ+CLQS3pqp4hmREECWO9V+TJi/IWmms=
github.com/testground/sdk-go v0.2.3-0.20200626163933-5221c19734d9 h1:DxXPiWxnLo3TJftdfylbuJaYRrSUJUOd/b5TfFqCxJg=
github.com/testground/sdk-go v0.2.3-0.20200626163933-5221c19734d9/go.mod h1:3auzMDXaoK7NQ+CLQS3pqp4hmREECWO9V+TJi/IWmms=
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g= github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=