-
Notifications
You must be signed in to change notification settings - Fork 402
/
reputation.go
45 lines (39 loc) · 1.53 KB
/
reputation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2021 Storj Labs, Inc.
// See LICENSE for copying information.
package reputation
import (
"time"
"storj.io/common/storj"
)
// AuditWindow contains audit count for particular time frame.
type AuditWindow struct {
WindowStart time.Time `json:"windowStart"`
TotalCount int32 `json:"totalCount"`
OnlineCount int32 `json:"onlineCount"`
}
// Audit contains audit reputation metrics.
type Audit struct {
TotalCount int64 `json:"totalCount"`
SuccessCount int64 `json:"successCount"`
Alpha float64 `json:"alpha"`
Beta float64 `json:"beta"`
UnknownAlpha float64 `json:"unknownAlpha"`
UnknownBeta float64 `json:"unknownBeta"`
Score float64 `json:"score"`
SuspensionScore float64 `json:"suspensionScore"`
History []AuditWindow `json:"history"`
}
// Stats encapsulates node reputation data.
type Stats struct {
NodeID storj.NodeID `json:"nodeId"`
NodeName string `json:"nodeName"`
Audit Audit `json:"audit"`
OnlineScore float64 `json:"onlineScore"`
DisqualifiedAt *time.Time `json:"disqualifiedAt"`
SuspendedAt *time.Time `json:"suspendedAt"`
OfflineSuspendedAt *time.Time `json:"offlineSuspendedAt"`
OfflineUnderReviewAt *time.Time `json:"offlineUnderReviewAt"`
VettedAt *time.Time `json:"vettedAt"`
UpdatedAt time.Time `json:"updatedAt"`
JoinedAt time.Time `json:"joinedAt"`
}