deploy: e2185caf279f81bcfe891ec494e86e44b4bac4df

This commit is contained in:
EbubeUd 2021-06-06 15:39:00 +00:00
parent 6c2842e50a
commit b945301a93
3 changed files with 107 additions and 1 deletions

View File

@ -878,6 +878,104 @@
"align": false,
"alignLevel": null
}
},
{
"id": 21,
"gridPos": {
"h": 9,
"w": 8,
"x": 16,
"y": 14
},
"type": "graph",
"title": "Waku Swap Accounts #0",
"thresholds": [],
"pluginVersion": "8.0.0-beta2",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fieldConfig": {
"defaults": {
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"hiddenSeries": false,
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"exemplar": true,
"expr": "waku_swap_account_state{node=\"0\"}",
"hide": false,
"instant": false,
"interval": "",
"legendFormat": "Peer: {{peer}}",
"refId": "A"
}
],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"tooltip": {
"shared": true,
"sort": 1,
"value_type": "individual"
},
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
},
"datasource": null
}
],
"refresh": "30s",

View File

@ -2,7 +2,7 @@
# libtool - Provide generalized library-building support services.
# Generated automatically by config.status (libbacktrace) version-unused
# Libtool was configured on host fv-az173-757:
# Libtool was configured on host fv-az272-138:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,

View File

@ -38,6 +38,7 @@ export waku_swap_types
declarePublicGauge waku_swap_peers, "number of swap peers"
declarePublicGauge waku_swap_errors, "number of swap protocol errors", ["type"]
declarePublicGauge waku_swap_account_state, "swap account state for each peer", ["peer"]
logScope:
topics = "wakuswap"
@ -191,6 +192,11 @@ proc handleCheque*(ws: WakuSwap, cheque: Cheque) =
info "New accounting state", accounting = ws.accounting[peerId]
# Log Account Metrics
proc logAccountMetrics*(ws: Wakuswap, peer: PeerId) {.async.}=
waku_swap_account_state.set(ws.accounting[peer].int64, labelValues = [$peer])
proc init*(wakuSwap: WakuSwap) =
info "wakuSwap init 1"
proc handle(conn: Connection, proto: string) {.async, gcsafe, closure.} =
@ -242,6 +248,8 @@ proc init*(wakuSwap: WakuSwap) =
else:
info "Payment threshhold not hit"
waitFor wakuSwap.logAccountMetrics(peerId)
wakuSwap.handler = handle
wakuSwap.codec = WakuSwapCodec
wakuSwap.credit = credit