2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-12-12 21:24:08 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package accounting
|
|
|
|
|
2019-01-17 18:34:13 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"storj.io/storj/pkg/pb"
|
|
|
|
"storj.io/storj/pkg/storj"
|
|
|
|
)
|
2019-01-10 11:41:57 +00:00
|
|
|
|
2018-12-18 17:18:42 +00:00
|
|
|
// Constants for accounting_raw, accounting_rollup, and accounting_timestamps
|
2018-12-12 21:24:08 +00:00
|
|
|
const (
|
2019-04-25 09:46:32 +01:00
|
|
|
// AtRest is the data_type representing at-rest data calculated from metainfo
|
2019-01-28 19:45:25 +00:00
|
|
|
BandwidthPut = int(pb.BandwidthAction_PUT)
|
|
|
|
BandwidthGet = int(pb.BandwidthAction_GET)
|
|
|
|
BandwidthGetAudit = int(pb.BandwidthAction_GET_AUDIT)
|
|
|
|
BandwidthGetRepair = int(pb.BandwidthAction_GET_REPAIR)
|
|
|
|
BandwidthPutRepair = int(pb.BandwidthAction_PUT_REPAIR)
|
|
|
|
AtRest = int(pb.BandwidthAction_PUT_REPAIR + 1)
|
2018-12-18 17:18:42 +00:00
|
|
|
// LastAtRestTally represents the accounting timestamp for the at-rest data calculation
|
|
|
|
LastAtRestTally = "LastAtRestTally"
|
|
|
|
// LastBandwidthTally represents the accounting timestamp for the bandwidth allocation query
|
|
|
|
LastBandwidthTally = "LastBandwidthTally"
|
2019-01-16 19:30:33 +00:00
|
|
|
// LastRollup represents the accounting timestamp for rollup calculations
|
|
|
|
LastRollup = "LastRollup"
|
2018-12-12 21:24:08 +00:00
|
|
|
)
|
2019-01-17 18:34:13 +00:00
|
|
|
|
|
|
|
// CSVRow represents data from QueryPaymentInfo without exposing dbx
|
|
|
|
type CSVRow struct {
|
|
|
|
NodeID storj.NodeID
|
|
|
|
NodeCreationDate time.Time
|
|
|
|
AuditSuccessRatio float64
|
|
|
|
AtRestTotal float64
|
|
|
|
GetRepairTotal int64
|
|
|
|
PutRepairTotal int64
|
|
|
|
GetAuditTotal int64
|
|
|
|
PutTotal int64
|
|
|
|
GetTotal int64
|
|
|
|
Wallet string
|
|
|
|
}
|