Skip to content

Commit

Permalink
Merge pull request #6081 from mysteriumnetwork/add-packet-loss
Browse files Browse the repository at this point in the history
add packet loss field Quality
  • Loading branch information
yeszhanov95 authored Oct 24, 2024
2 parents d18a229 + 793981e commit eeb315a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 5 additions & 4 deletions market/quality.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package market

// Quality represents service quality.
type Quality struct {
Quality float64 `json:"quality"`
Latency float64 `json:"latency"`
Bandwidth float64 `json:"bandwidth"`
Uptime float64 `json:"uptime"`
Quality float64 `json:"quality"`
Latency float64 `json:"latency"`
Bandwidth float64 `json:"bandwidth"`
Uptime float64 `json:"uptime"`
PacketLoss float64 `json:"packetLoss"`
}
12 changes: 7 additions & 5 deletions market/service_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ func Test_ServiceProposal_Serialize(t *testing.T) {
config.Current.SetDefault(config.FlagDefaultCurrency.Name, "MYSTT")
sp := NewProposal("node", "mock_service", NewProposalOpts{
Quality: &Quality{
Quality: 2.0,
Latency: 5,
Bandwidth: 100,
Uptime: 20,
Quality: 2.0,
Latency: 5,
Bandwidth: 100,
Uptime: 20,
PacketLoss: 0.5,
},
Contacts: ContactList{},
})
Expand All @@ -61,7 +62,8 @@ func Test_ServiceProposal_Serialize(t *testing.T) {
"quality": 2.0,
"latency": 5,
"bandwidth": 100,
"uptime": 20
"uptime": 20,
"packetLoss": 0.5
},
"contacts": []
}`
Expand Down

0 comments on commit eeb315a

Please sign in to comment.