diff --git a/plugins/metrics/tps.go b/plugins/metrics/tps.go deleted file mode 100644 index a7448fa000a23c5e72c2ff329be423c319fb2edc..0000000000000000000000000000000000000000 --- a/plugins/metrics/tps.go +++ /dev/null @@ -1,36 +0,0 @@ -package metrics - -import ( - "go.uber.org/atomic" -) - -// ReceivedMessagesPerSecond retrieves the current messages per second number. -func ReceivedMessagesPerSecond() uint64 { - return measuredReceivedMPS.Load() -} - -// counter for the received MPS -var mpsReceivedSinceLastMeasurement atomic.Uint64 - -// measured value of the received MPS -var measuredReceivedMPS atomic.Uint64 - -// increases the received MPS counter -func increaseReceivedMPSCounter() { - mpsReceivedSinceLastMeasurement.Add(1) -} - -// measures the received MPS value -func measureReceivedMPS() { - // sample the current counter value into a measured MPS value - sampledMPS := mpsReceivedSinceLastMeasurement.Load() - - // store the measured value - measuredReceivedMPS.Store(sampledMPS) - - // reset the counter - mpsReceivedSinceLastMeasurement.Store(0) - - // trigger events for outside listeners - Events.ReceivedMPSUpdated.Trigger(sampledMPS) -} diff --git a/plugins/prometheus/local_metrics.go b/plugins/prometheus/local_metrics.go index d2b4ee0e52e5f9bd412f058ad4f2e7603f2c5d4e..16840b962036a7ab89ad079cc47589cb34fcac16 100644 --- a/plugins/prometheus/local_metrics.go +++ b/plugins/prometheus/local_metrics.go @@ -21,5 +21,5 @@ func init() { } func collectLocalMetrics() { - messagesPerSecond.Set(float64(metrics.ReceivedMessagesPerSecond())) + messagesPerSecond.Set(float64(metrics.MPS())) } diff --git a/tools/integration-tests/tester/go.mod b/tools/integration-tests/tester/go.mod index 81fe8f1db5258747f5dd843238207468d7dc4c99..315bbabd481f7979c78b449f280b301d0f4e4fc0 100644 --- a/tools/integration-tests/tester/go.mod +++ b/tools/integration-tests/tester/go.mod @@ -10,7 +10,7 @@ require ( github.com/docker/go-units v0.4.0 // indirect github.com/drand/drand v0.8.1 github.com/iotaledger/goshimmer v0.1.3 - github.com/iotaledger/hive.go v0.0.0-20200610104211-d603429af242 + github.com/iotaledger/hive.go v0.0.0-20200615181744-3ab0cddc15cf github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/stretchr/testify v1.5.1 ) diff --git a/tools/integration-tests/tester/go.sum b/tools/integration-tests/tester/go.sum index 05f9ae442ec98cb2cfb133b7a6d07e900df72f3f..77eb420c4aa1131c3f6424b4eb4a75f9d95075e1 100644 --- a/tools/integration-tests/tester/go.sum +++ b/tools/integration-tests/tester/go.sum @@ -148,6 +148,7 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/iotaledger/hive.go v0.0.0-20200610104211-d603429af242 h1:uHMFmfrP6O6lp1lCHT6lpFwHFWYk77V0nUlGbhneQHI= github.com/iotaledger/hive.go v0.0.0-20200610104211-d603429af242/go.mod h1:zwZhaE4ZeglpTrbmbwdnVPMI5XdRu2RmByi3Qn0ztmU= +github.com/iotaledger/hive.go v0.0.0-20200615181744-3ab0cddc15cf/go.mod h1:zwZhaE4ZeglpTrbmbwdnVPMI5XdRu2RmByi3Qn0ztmU= github.com/iotaledger/iota.go v1.0.0-beta.9/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8= github.com/iotaledger/iota.go v1.0.0-beta.14/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=