whispervis/stats.go

15 lines
321 B
Go
Raw Normal View History

2018-10-19 16:01:49 +02:00
package main
2018-10-19 18:37:58 +02:00
import (
"github.com/status-im/simulation/propagation"
"github.com/status-im/simulation/stats"
)
2018-10-19 16:01:49 +02:00
2018-10-19 18:37:58 +02:00
func (p *Page) RecalculateStats(plog *propagation.Log) *stats.Stats {
2018-10-23 06:42:56 +02:00
net := p.network.Current()
2018-10-19 16:01:49 +02:00
nodes := len(net.Data.Nodes())
links := len(net.Data.Links())
2018-10-19 18:37:58 +02:00
return stats.Analyze(plog, nodes, links)
2018-10-19 16:01:49 +02:00
}