draft of removing stats from inspector (#2226)

This commit is contained in:
Bill Thorp 2019-06-17 16:48:04 -04:00 committed by GitHub
parent e58a06bd0c
commit f378125c8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 298 additions and 1118 deletions

View File

@ -4,13 +4,11 @@
package main
import (
"bufio"
"context"
"encoding/csv"
"encoding/json"
"flag"
"fmt"
"io"
"os"
"strconv"
"strings"
@ -109,32 +107,6 @@ var (
Short: "Dumps a graph of the routing table in the dot format",
RunE: DrawTableAsGraph,
}
getStatsCmd = &cobra.Command{
Use: "getstats <node_id>",
Short: "Get node stats",
Args: cobra.MinimumNArgs(1),
RunE: GetStats,
}
getCSVStatsCmd = &cobra.Command{
Use: "getcsvstats <path to node ID csv file>",
Short: "Get node stats from csv",
Args: cobra.MinimumNArgs(1),
RunE: GetCSVStats,
}
createStatsCmd = &cobra.Command{
// TODO: add args to usage
Use: "createstats",
Short: "Create node with stats",
Args: cobra.MinimumNArgs(5), // id, auditct, auditsuccessct, uptimect, uptimesuccessct
RunE: CreateStats,
}
createCSVStatsCmd = &cobra.Command{
// TODO: add args to usage
Use: "createcsvstats",
Short: "Create node stats from csv",
Args: cobra.MinimumNArgs(1),
RunE: CreateCSVStats,
}
objectHealthCmd = &cobra.Command{
Use: "object <project-id> <bucket> <encrypted-path>",
Short: "Get stats about an object's health",
@ -332,167 +304,6 @@ func PingNode(cmd *cobra.Command, args []string) (err error) {
return nil
}
// GetStats gets a node's stats from overlay
func GetStats(cmd *cobra.Command, args []string) (err error) {
i, err := NewInspector(*Addr, *IdentityPath)
if err != nil {
return ErrInspectorDial.Wrap(err)
}
nodeID, err := storj.NodeIDFromString(args[0])
if err != nil {
return err
}
res, err := i.overlayclient.GetStats(context.Background(), &pb.GetStatsRequest{
NodeId: nodeID,
})
if err != nil {
return ErrRequest.Wrap(err)
}
fmt.Printf("Stats for ID %s:\n", nodeID)
fmt.Printf("AuditSuccessRatio: %f, AuditCount: %d, UptimeRatio: %f, UptimeCount: %d,\n",
res.AuditRatio, res.AuditCount, res.UptimeRatio, res.UptimeCount)
return nil
}
// GetCSVStats gets node stats from overlay based on a csv
func GetCSVStats(cmd *cobra.Command, args []string) (err error) {
i, err := NewInspector(*Addr, *IdentityPath)
if err != nil {
return ErrInspectorDial.Wrap(err)
}
// get csv
csvPath := args[0]
csvFile, _ := os.Open(csvPath)
reader := csv.NewReader(bufio.NewReader(csvFile))
for {
line, err := reader.Read()
if err == io.EOF {
break
} else if err != nil {
return ErrArgs.Wrap(err)
}
nodeID, err := storj.NodeIDFromString(line[0])
if err != nil {
return err
}
res, err := i.overlayclient.GetStats(context.Background(), &pb.GetStatsRequest{
NodeId: nodeID,
})
if err != nil {
return ErrRequest.Wrap(err)
}
fmt.Printf("Stats for ID %s:\n", nodeID)
fmt.Printf("AuditSuccessRatio: %f, AuditCount: %d, UptimeRatio: %f, UptimeCount: %d,\n",
res.AuditRatio, res.AuditCount, res.UptimeRatio, res.UptimeCount)
}
return nil
}
// CreateStats creates a node with stats in overlay
func CreateStats(cmd *cobra.Command, args []string) (err error) {
i, err := NewInspector(*Addr, *IdentityPath)
if err != nil {
return ErrInspectorDial.Wrap(err)
}
nodeID, err := storj.NodeIDFromString(args[0])
if err != nil {
return err
}
auditCount, err := strconv.ParseInt(args[1], 10, 64)
if err != nil {
return ErrArgs.New("audit count must be an int")
}
auditSuccessCount, err := strconv.ParseInt(args[2], 10, 64)
if err != nil {
return ErrArgs.New("audit success count must be an int")
}
uptimeCount, err := strconv.ParseInt(args[3], 10, 64)
if err != nil {
return ErrArgs.New("uptime count must be an int")
}
uptimeSuccessCount, err := strconv.ParseInt(args[4], 10, 64)
if err != nil {
return ErrArgs.New("uptime success count must be an int")
}
_, err = i.overlayclient.CreateStats(context.Background(), &pb.CreateStatsRequest{
NodeId: nodeID,
AuditCount: auditCount,
AuditSuccessCount: auditSuccessCount,
UptimeCount: uptimeCount,
UptimeSuccessCount: uptimeSuccessCount,
})
if err != nil {
return ErrRequest.Wrap(err)
}
fmt.Printf("Created stats entry for ID %s\n", nodeID)
return nil
}
// CreateCSVStats creates node with stats in overlay based on a CSV
func CreateCSVStats(cmd *cobra.Command, args []string) (err error) {
i, err := NewInspector(*Addr, *IdentityPath)
if err != nil {
return ErrInspectorDial.Wrap(err)
}
// get csv
csvPath := args[0]
csvFile, _ := os.Open(csvPath)
reader := csv.NewReader(bufio.NewReader(csvFile))
for {
line, err := reader.Read()
if err == io.EOF {
break
} else if err != nil {
return ErrArgs.Wrap(err)
}
nodeID, err := storj.NodeIDFromString(line[0])
if err != nil {
return err
}
auditCount, err := strconv.ParseInt(line[1], 10, 64)
if err != nil {
return ErrArgs.New("audit count must be an int")
}
auditSuccessCount, err := strconv.ParseInt(line[2], 10, 64)
if err != nil {
return ErrArgs.New("audit success count must be an int")
}
uptimeCount, err := strconv.ParseInt(line[3], 10, 64)
if err != nil {
return ErrArgs.New("uptime count must be an int")
}
uptimeSuccessCount, err := strconv.ParseInt(line[4], 10, 64)
if err != nil {
return ErrArgs.New("uptime success count must be an int")
}
_, err = i.overlayclient.CreateStats(context.Background(), &pb.CreateStatsRequest{
NodeId: nodeID,
AuditCount: auditCount,
AuditSuccessCount: auditSuccessCount,
UptimeCount: uptimeCount,
UptimeSuccessCount: uptimeSuccessCount,
})
if err != nil {
return ErrRequest.Wrap(err)
}
fmt.Printf("Created stats entry for ID %s\n", nodeID)
}
return nil
}
// ObjectHealth gets information about the health of an object on the network
func ObjectHealth(cmd *cobra.Command, args []string) (err error) {
ctx := context.Background()
@ -760,11 +571,6 @@ func init() {
kadCmd.AddCommand(dumpNodesCmd)
kadCmd.AddCommand(drawTableCmd)
statsCmd.AddCommand(getStatsCmd)
statsCmd.AddCommand(getCSVStatsCmd)
statsCmd.AddCommand(createStatsCmd)
statsCmd.AddCommand(createCSVStatsCmd)
healthCmd.AddCommand(objectHealthCmd)
healthCmd.AddCommand(segmentHealthCmd)

View File

@ -108,15 +108,19 @@ type NodeDossier struct {
// NodeStats contains statistics about a node.
type NodeStats struct {
Latency90 int64
AuditSuccessRatio float64
AuditSuccessCount int64
AuditCount int64
UptimeRatio float64
UptimeSuccessCount int64
UptimeCount int64
LastContactSuccess time.Time
LastContactFailure time.Time
Latency90 int64
AuditSuccessRatio float64
AuditSuccessCount int64
AuditCount int64
UptimeRatio float64
UptimeSuccessCount int64
UptimeCount int64
LastContactSuccess time.Time
LastContactFailure time.Time
AuditReputationAlpha float64
UptimeReputationAlpha float64
AuditReputationBeta float64
UptimeReputationBeta float64
}
// Cache is used to store and handle node information

View File

@ -39,37 +39,3 @@ func (srv *Inspector) DumpNodes(ctx context.Context, req *pb.DumpNodesRequest) (
defer mon.Task()(&ctx)(&err)
return &pb.DumpNodesResponse{}, errs.New("Not Implemented")
}
// GetStats returns the stats for a particular node ID
func (srv *Inspector) GetStats(ctx context.Context, req *pb.GetStatsRequest) (_ *pb.GetStatsResponse, err error) {
defer mon.Task()(&ctx)(&err)
node, err := srv.cache.Get(ctx, req.NodeId)
if err != nil {
return nil, err
}
return &pb.GetStatsResponse{
AuditCount: node.Reputation.AuditCount,
AuditRatio: node.Reputation.AuditSuccessRatio,
UptimeCount: node.Reputation.UptimeCount,
UptimeRatio: node.Reputation.UptimeRatio,
}, nil
}
// CreateStats creates a node with specified stats
func (srv *Inspector) CreateStats(ctx context.Context, req *pb.CreateStatsRequest) (_ *pb.CreateStatsResponse, err error) {
defer mon.Task()(&ctx)(&err)
stats := &NodeStats{
AuditCount: req.AuditCount,
AuditSuccessCount: req.AuditSuccessCount,
UptimeCount: req.UptimeCount,
UptimeSuccessCount: req.UptimeSuccessCount,
}
_, err = srv.cache.Create(ctx, req.NodeId, stats)
if err != nil {
return nil, err
}
return &pb.CreateStatsResponse{}, nil
}

File diff suppressed because it is too large Load Diff

View File

@ -34,10 +34,6 @@ service OverlayInspector {
rpc CountNodes(CountNodesRequest) returns (CountNodesResponse);
// DumpNodes returns all the nodes in the cache
rpc DumpNodes(DumpNodesRequest) returns (DumpNodesResponse);
// GetStats returns the stats for a particular node ID
rpc GetStats(GetStatsRequest) returns (GetStatsResponse);
// CreateStats creates a node with specified stats
rpc CreateStats(CreateStatsRequest) returns (CreateStatsResponse);
}
service PieceStoreInspector {
@ -78,30 +74,6 @@ message ListIrreparableSegmentsResponse {
repeated IrreparableSegment segments = 1;
}
// GetStats
message GetStatsRequest {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
}
message GetStatsResponse {
int64 audit_count = 1;
double audit_ratio = 2;
int64 uptime_count = 3;
double uptime_ratio = 4;
}
// CreateStats
message CreateStatsRequest {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
int64 audit_count = 2;
int64 audit_success_count = 3;
int64 uptime_count = 4;
int64 uptime_success_count = 5;
}
message CreateStatsResponse {
}
// CountNodes
message CountNodesResponse {
int64 count = 1;

View File

@ -3,13 +3,11 @@
package pb
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
math "math"
)
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@ -40,7 +38,6 @@ var NodeType_name = map[int32]string{
3: "UPLINK",
4: "BOOTSTRAP",
}
var NodeType_value = map[string]int32{
"INVALID": 0,
"SATELLITE": 1,
@ -52,9 +49,8 @@ var NodeType_value = map[string]int32{
func (x NodeType) String() string {
return proto.EnumName(NodeType_name, int32(x))
}
func (NodeType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{0}
return fileDescriptor_node_a9c4d6a5457645c6, []int{0}
}
// NodeTransport is an enum of possible transports for the overlay network
@ -67,7 +63,6 @@ const (
var NodeTransport_name = map[int32]string{
0: "TCP_TLS_GRPC",
}
var NodeTransport_value = map[string]int32{
"TCP_TLS_GRPC": 0,
}
@ -75,9 +70,8 @@ var NodeTransport_value = map[string]int32{
func (x NodeTransport) String() string {
return proto.EnumName(NodeTransport_name, int32(x))
}
func (NodeTransport) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{1}
return fileDescriptor_node_a9c4d6a5457645c6, []int{1}
}
// TODO move statdb.Update() stuff out of here
@ -96,7 +90,7 @@ func (m *Node) Reset() { *m = Node{} }
func (m *Node) String() string { return proto.CompactTextString(m) }
func (*Node) ProtoMessage() {}
func (*Node) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{0}
return fileDescriptor_node_a9c4d6a5457645c6, []int{0}
}
func (m *Node) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Node.Unmarshal(m, b)
@ -104,8 +98,8 @@ func (m *Node) XXX_Unmarshal(b []byte) error {
func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Node.Marshal(b, m, deterministic)
}
func (m *Node) XXX_Merge(src proto.Message) {
xxx_messageInfo_Node.Merge(m, src)
func (dst *Node) XXX_Merge(src proto.Message) {
xxx_messageInfo_Node.Merge(dst, src)
}
func (m *Node) XXX_Size() int {
return xxx_messageInfo_Node.Size(m)
@ -143,7 +137,7 @@ func (m *NodeAddress) Reset() { *m = NodeAddress{} }
func (m *NodeAddress) String() string { return proto.CompactTextString(m) }
func (*NodeAddress) ProtoMessage() {}
func (*NodeAddress) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{1}
return fileDescriptor_node_a9c4d6a5457645c6, []int{1}
}
func (m *NodeAddress) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeAddress.Unmarshal(m, b)
@ -151,8 +145,8 @@ func (m *NodeAddress) XXX_Unmarshal(b []byte) error {
func (m *NodeAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeAddress.Marshal(b, m, deterministic)
}
func (m *NodeAddress) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeAddress.Merge(m, src)
func (dst *NodeAddress) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeAddress.Merge(dst, src)
}
func (m *NodeAddress) XXX_Size() int {
return xxx_messageInfo_NodeAddress.Size(m)
@ -177,110 +171,6 @@ func (m *NodeAddress) GetAddress() string {
return ""
}
// NodeStats is the reputation characteristics of a node
type NodeStats struct {
NodeId NodeID `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3,customtype=NodeID" json:"node_id"`
Latency_90 int64 `protobuf:"varint,2,opt,name=latency_90,json=latency90,proto3" json:"latency_90,omitempty"`
AuditSuccessRatio float64 `protobuf:"fixed64,3,opt,name=audit_success_ratio,json=auditSuccessRatio,proto3" json:"audit_success_ratio,omitempty"`
UptimeRatio float64 `protobuf:"fixed64,4,opt,name=uptime_ratio,json=uptimeRatio,proto3" json:"uptime_ratio,omitempty"`
AuditCount int64 `protobuf:"varint,5,opt,name=audit_count,json=auditCount,proto3" json:"audit_count,omitempty"`
AuditSuccessCount int64 `protobuf:"varint,6,opt,name=audit_success_count,json=auditSuccessCount,proto3" json:"audit_success_count,omitempty"`
UptimeCount int64 `protobuf:"varint,7,opt,name=uptime_count,json=uptimeCount,proto3" json:"uptime_count,omitempty"`
UptimeSuccessCount int64 `protobuf:"varint,8,opt,name=uptime_success_count,json=uptimeSuccessCount,proto3" json:"uptime_success_count,omitempty"`
LastContactSuccess *timestamp.Timestamp `protobuf:"bytes,9,opt,name=last_contact_success,json=lastContactSuccess,proto3" json:"last_contact_success,omitempty"`
LastContactFailure *timestamp.Timestamp `protobuf:"bytes,10,opt,name=last_contact_failure,json=lastContactFailure,proto3" json:"last_contact_failure,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NodeStats) Reset() { *m = NodeStats{} }
func (m *NodeStats) String() string { return proto.CompactTextString(m) }
func (*NodeStats) ProtoMessage() {}
func (*NodeStats) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{2}
}
func (m *NodeStats) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeStats.Unmarshal(m, b)
}
func (m *NodeStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeStats.Marshal(b, m, deterministic)
}
func (m *NodeStats) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeStats.Merge(m, src)
}
func (m *NodeStats) XXX_Size() int {
return xxx_messageInfo_NodeStats.Size(m)
}
func (m *NodeStats) XXX_DiscardUnknown() {
xxx_messageInfo_NodeStats.DiscardUnknown(m)
}
var xxx_messageInfo_NodeStats proto.InternalMessageInfo
func (m *NodeStats) GetLatency_90() int64 {
if m != nil {
return m.Latency_90
}
return 0
}
func (m *NodeStats) GetAuditSuccessRatio() float64 {
if m != nil {
return m.AuditSuccessRatio
}
return 0
}
func (m *NodeStats) GetUptimeRatio() float64 {
if m != nil {
return m.UptimeRatio
}
return 0
}
func (m *NodeStats) GetAuditCount() int64 {
if m != nil {
return m.AuditCount
}
return 0
}
func (m *NodeStats) GetAuditSuccessCount() int64 {
if m != nil {
return m.AuditSuccessCount
}
return 0
}
func (m *NodeStats) GetUptimeCount() int64 {
if m != nil {
return m.UptimeCount
}
return 0
}
func (m *NodeStats) GetUptimeSuccessCount() int64 {
if m != nil {
return m.UptimeSuccessCount
}
return 0
}
func (m *NodeStats) GetLastContactSuccess() *timestamp.Timestamp {
if m != nil {
return m.LastContactSuccess
}
return nil
}
func (m *NodeStats) GetLastContactFailure() *timestamp.Timestamp {
if m != nil {
return m.LastContactFailure
}
return nil
}
// NodeOperator contains info about the storage node operator
type NodeOperator struct {
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
@ -294,7 +184,7 @@ func (m *NodeOperator) Reset() { *m = NodeOperator{} }
func (m *NodeOperator) String() string { return proto.CompactTextString(m) }
func (*NodeOperator) ProtoMessage() {}
func (*NodeOperator) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{3}
return fileDescriptor_node_a9c4d6a5457645c6, []int{2}
}
func (m *NodeOperator) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeOperator.Unmarshal(m, b)
@ -302,8 +192,8 @@ func (m *NodeOperator) XXX_Unmarshal(b []byte) error {
func (m *NodeOperator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeOperator.Marshal(b, m, deterministic)
}
func (m *NodeOperator) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeOperator.Merge(m, src)
func (dst *NodeOperator) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeOperator.Merge(dst, src)
}
func (m *NodeOperator) XXX_Size() int {
return xxx_messageInfo_NodeOperator.Size(m)
@ -341,7 +231,7 @@ func (m *NodeCapacity) Reset() { *m = NodeCapacity{} }
func (m *NodeCapacity) String() string { return proto.CompactTextString(m) }
func (*NodeCapacity) ProtoMessage() {}
func (*NodeCapacity) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{4}
return fileDescriptor_node_a9c4d6a5457645c6, []int{3}
}
func (m *NodeCapacity) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeCapacity.Unmarshal(m, b)
@ -349,8 +239,8 @@ func (m *NodeCapacity) XXX_Unmarshal(b []byte) error {
func (m *NodeCapacity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeCapacity.Marshal(b, m, deterministic)
}
func (m *NodeCapacity) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeCapacity.Merge(m, src)
func (dst *NodeCapacity) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeCapacity.Merge(dst, src)
}
func (m *NodeCapacity) XXX_Size() int {
return xxx_messageInfo_NodeCapacity.Size(m)
@ -388,7 +278,7 @@ func (m *NodeMetadata) Reset() { *m = NodeMetadata{} }
func (m *NodeMetadata) String() string { return proto.CompactTextString(m) }
func (*NodeMetadata) ProtoMessage() {}
func (*NodeMetadata) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{5}
return fileDescriptor_node_a9c4d6a5457645c6, []int{4}
}
func (m *NodeMetadata) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeMetadata.Unmarshal(m, b)
@ -396,8 +286,8 @@ func (m *NodeMetadata) XXX_Unmarshal(b []byte) error {
func (m *NodeMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeMetadata.Marshal(b, m, deterministic)
}
func (m *NodeMetadata) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeMetadata.Merge(m, src)
func (dst *NodeMetadata) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeMetadata.Merge(dst, src)
}
func (m *NodeMetadata) XXX_Size() int {
return xxx_messageInfo_NodeMetadata.Size(m)
@ -435,7 +325,7 @@ func (m *NodeRestrictions) Reset() { *m = NodeRestrictions{} }
func (m *NodeRestrictions) String() string { return proto.CompactTextString(m) }
func (*NodeRestrictions) ProtoMessage() {}
func (*NodeRestrictions) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{6}
return fileDescriptor_node_a9c4d6a5457645c6, []int{5}
}
func (m *NodeRestrictions) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeRestrictions.Unmarshal(m, b)
@ -443,8 +333,8 @@ func (m *NodeRestrictions) XXX_Unmarshal(b []byte) error {
func (m *NodeRestrictions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeRestrictions.Marshal(b, m, deterministic)
}
func (m *NodeRestrictions) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeRestrictions.Merge(m, src)
func (dst *NodeRestrictions) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeRestrictions.Merge(dst, src)
}
func (m *NodeRestrictions) XXX_Size() int {
return xxx_messageInfo_NodeRestrictions.Size(m)
@ -484,7 +374,7 @@ func (m *NodeVersion) Reset() { *m = NodeVersion{} }
func (m *NodeVersion) String() string { return proto.CompactTextString(m) }
func (*NodeVersion) ProtoMessage() {}
func (*NodeVersion) Descriptor() ([]byte, []int) {
return fileDescriptor_0c843d59d2d938e7, []int{7}
return fileDescriptor_node_a9c4d6a5457645c6, []int{6}
}
func (m *NodeVersion) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeVersion.Unmarshal(m, b)
@ -492,8 +382,8 @@ func (m *NodeVersion) XXX_Unmarshal(b []byte) error {
func (m *NodeVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeVersion.Marshal(b, m, deterministic)
}
func (m *NodeVersion) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeVersion.Merge(m, src)
func (dst *NodeVersion) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeVersion.Merge(dst, src)
}
func (m *NodeVersion) XXX_Size() int {
return xxx_messageInfo_NodeVersion.Size(m)
@ -533,67 +423,56 @@ func (m *NodeVersion) GetRelease() bool {
}
func init() {
proto.RegisterEnum("node.NodeType", NodeType_name, NodeType_value)
proto.RegisterEnum("node.NodeTransport", NodeTransport_name, NodeTransport_value)
proto.RegisterType((*Node)(nil), "node.Node")
proto.RegisterType((*NodeAddress)(nil), "node.NodeAddress")
proto.RegisterType((*NodeStats)(nil), "node.NodeStats")
proto.RegisterType((*NodeOperator)(nil), "node.NodeOperator")
proto.RegisterType((*NodeCapacity)(nil), "node.NodeCapacity")
proto.RegisterType((*NodeMetadata)(nil), "node.NodeMetadata")
proto.RegisterType((*NodeRestrictions)(nil), "node.NodeRestrictions")
proto.RegisterType((*NodeVersion)(nil), "node.NodeVersion")
proto.RegisterEnum("node.NodeType", NodeType_name, NodeType_value)
proto.RegisterEnum("node.NodeTransport", NodeTransport_name, NodeTransport_value)
}
func init() { proto.RegisterFile("node.proto", fileDescriptor_0c843d59d2d938e7) }
func init() { proto.RegisterFile("node.proto", fileDescriptor_node_a9c4d6a5457645c6) }
var fileDescriptor_0c843d59d2d938e7 = []byte{
// 739 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcd, 0x6e, 0xea, 0x46,
0x14, 0x80, 0x63, 0x20, 0x80, 0x0f, 0x3f, 0xf2, 0x9d, 0x8b, 0x5a, 0x2b, 0x55, 0x0b, 0x17, 0xa9,
0x2a, 0xba, 0x95, 0xb8, 0xe9, 0xed, 0xa6, 0x91, 0xba, 0x01, 0x92, 0xa6, 0xb4, 0x14, 0xd0, 0xe0,
0x66, 0x91, 0x8d, 0x35, 0xd8, 0x13, 0x18, 0xc5, 0xd8, 0x96, 0x67, 0xdc, 0x88, 0x77, 0xe9, 0x03,
0xf5, 0x19, 0xba, 0xc8, 0xba, 0x4f, 0x51, 0x55, 0xf3, 0xe3, 0x10, 0x14, 0xb5, 0x52, 0xa4, 0xee,
0x7c, 0xce, 0xf9, 0xce, 0xef, 0x9c, 0x63, 0x80, 0x38, 0x09, 0xe9, 0x30, 0xcd, 0x12, 0x91, 0xa0,
0x8a, 0xfc, 0x3e, 0x83, 0x4d, 0xb2, 0x49, 0xb4, 0xe6, 0xac, 0xbb, 0x49, 0x92, 0x4d, 0x44, 0x3f,
0x28, 0x69, 0x9d, 0xdf, 0x7d, 0x10, 0x6c, 0x47, 0xb9, 0x20, 0xbb, 0x54, 0x03, 0xfd, 0xbf, 0x2d,
0xa8, 0xcc, 0x93, 0x90, 0xa2, 0x2f, 0xa0, 0xc4, 0x42, 0xd7, 0xea, 0x59, 0x83, 0xe6, 0xb8, 0xfd,
0xc7, 0x63, 0xf7, 0xe4, 0xcf, 0xc7, 0x6e, 0x55, 0x5a, 0xa6, 0x97, 0xb8, 0xc4, 0x42, 0xf4, 0x35,
0xd4, 0x48, 0x18, 0x66, 0x94, 0x73, 0xb7, 0xd4, 0xb3, 0x06, 0x8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, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x3d, 0x28, 0xd5, 0xcf,
0x05, 0x00, 0x00,
var fileDescriptor_node_a9c4d6a5457645c6 = []byte{
// 577 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcb, 0x6e, 0x13, 0x31,
0x14, 0xed, 0x24, 0xd3, 0x24, 0x73, 0xf3, 0xd0, 0x60, 0x2a, 0x88, 0x8a, 0x44, 0x42, 0x24, 0xa4,
0xa8, 0x48, 0xa9, 0x28, 0x1b, 0x16, 0x6c, 0x92, 0xb6, 0x2a, 0x81, 0x90, 0x44, 0xce, 0xd0, 0x45,
0x37, 0x23, 0x27, 0x76, 0x13, 0xab, 0x93, 0xb1, 0x65, 0x7b, 0xa8, 0xf2, 0x2f, 0x7c, 0x10, 0xdf,
0xc0, 0xa2, 0x9f, 0x82, 0x90, 0xe7, 0xd1, 0xc7, 0x12, 0x89, 0xdd, 0x9c, 0x73, 0xcf, 0xb5, 0xcf,
0x9c, 0x7b, 0x0d, 0x10, 0x0b, 0xca, 0x06, 0x52, 0x09, 0x23, 0x90, 0x6b, 0xbf, 0x0f, 0x61, 0x2d,
0xd6, 0x22, 0x63, 0x0e, 0x3b, 0x6b, 0x21, 0xd6, 0x11, 0x3b, 0x4e, 0xd1, 0x32, 0xb9, 0x3e, 0x36,
0x7c, 0xcb, 0xb4, 0x21, 0x5b, 0x99, 0x09, 0x7a, 0x7f, 0x1c, 0x70, 0xa7, 0x82, 0x32, 0xf4, 0x1a,
0x4a, 0x9c, 0xb6, 0x9d, 0xae, 0xd3, 0x6f, 0x8c, 0x5a, 0xbf, 0xee, 0x3a, 0x7b, 0xbf, 0xef, 0x3a,
0x15, 0x5b, 0x19, 0x9f, 0xe1, 0x12, 0xa7, 0xe8, 0x1d, 0x54, 0x09, 0xa5, 0x8a, 0x69, 0xdd, 0x2e,
0x75, 0x9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 0x9c, 0xfb, 0xee, 0xd1, 0x1b, 0x68, 0x3e, 0x59, 0x26, 0xe4, 0x43, 0x23, 0x38, 0x9d,
0x87, 0xc1, 0x64, 0x11, 0x5e, 0xe0, 0xf9, 0xa9, 0xbf, 0x37, 0x72, 0xaf, 0x4a, 0x72, 0xb9, 0xac,
0xa4, 0x8e, 0x3f, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xa6, 0x6e, 0x66, 0xe4, 0x03, 0x00,
0x00,
}

View File

@ -39,19 +39,6 @@ message NodeAddress {
enum NodeTransport {
TCP_TLS_GRPC = 0;
}
// NodeStats is the reputation characteristics of a node
message NodeStats {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false]; // TODO: remove
int64 latency_90 = 2; // 90th percentile measure of storagenode latency
double audit_success_ratio = 3; // (auditSuccessCount / totalAuditCount)
double uptime_ratio = 4; // (uptimeCount / totalUptimeCheckCount)
int64 audit_count = 5;
int64 audit_success_count = 6;
int64 uptime_count = 7;
int64 uptime_success_count = 8;
google.protobuf.Timestamp last_contact_success = 9;
google.protobuf.Timestamp last_contact_failure = 10;
}
// NodeOperator contains info about the storage node operator
message NodeOperator {

View File

@ -678,94 +678,6 @@
}
]
},
{
"name": "GetStatsRequest",
"fields": [
{
"id": 1,
"name": "node_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
}
]
},
{
"name": "GetStatsResponse",
"fields": [
{
"id": 1,
"name": "audit_count",
"type": "int64"
},
{
"id": 2,
"name": "audit_ratio",
"type": "double"
},
{
"id": 3,
"name": "uptime_count",
"type": "int64"
},
{
"id": 4,
"name": "uptime_ratio",
"type": "double"
}
]
},
{
"name": "CreateStatsRequest",
"fields": [
{
"id": 1,
"name": "node_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
},
{
"id": 2,
"name": "audit_count",
"type": "int64"
},
{
"id": 3,
"name": "audit_success_count",
"type": "int64"
},
{
"id": 4,
"name": "uptime_count",
"type": "int64"
},
{
"id": 5,
"name": "uptime_success_count",
"type": "int64"
}
]
},
{
"name": "CreateStatsResponse"
},
{
"name": "CountNodesResponse",
"fields": [
@ -1361,16 +1273,6 @@
"name": "DumpNodes",
"in_type": "DumpNodesRequest",
"out_type": "DumpNodesResponse"
},
{
"name": "GetStats",
"in_type": "GetStatsRequest",
"out_type": "GetStatsResponse"
},
{
"name": "CreateStats",
"in_type": "CreateStatsRequest",
"out_type": "CreateStatsResponse"
}
]
},
@ -1973,71 +1875,6 @@
}
]
},
{
"name": "NodeStats",
"fields": [
{
"id": 1,
"name": "node_id",
"type": "bytes",
"options": [
{
"name": "(gogoproto.customtype)",
"value": "NodeID"
},
{
"name": "(gogoproto.nullable)",
"value": "false"
}
]
},
{
"id": 2,
"name": "latency_90",
"type": "int64"
},
{
"id": 3,
"name": "audit_success_ratio",
"type": "double"
},
{
"id": 4,
"name": "uptime_ratio",
"type": "double"
},
{
"id": 5,
"name": "audit_count",
"type": "int64"
},
{
"id": 6,
"name": "audit_success_count",
"type": "int64"
},
{
"id": 7,
"name": "uptime_count",
"type": "int64"
},
{
"id": 8,
"name": "uptime_success_count",
"type": "int64"
},
{
"id": 9,
"name": "last_contact_success",
"type": "google.protobuf.Timestamp"
},
{
"id": 10,
"name": "last_contact_failure",
"type": "google.protobuf.Timestamp"
}
]
},
{
"name": "NodeOperator",
"fields": [