Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BallotAddTime = metrics.NewSimpleCounter(
namespace,
"ballot_add_time",
"time spent in ballots.Add (under lock)",
)
View Source
var BatchWriteCount = metrics.NewSimpleCounter(
namespace,
"batch_write_count",
"number of errors when writing a batch",
)
View Source
var CleanupTime = metrics.NewSimpleCounter(
namespace,
"cleanup_time",
"time spent in final cleanup(under lock)",
)
View Source
var ErroredBatchCount = metrics.NewSimpleCounter(
namespace,
"errored_batch",
"number of batches that errored",
)
View Source
var FlushBatchSize = metrics.NewSimpleCounter(
namespace,
"flush_batch_size",
"size of flushed batch",
)
View Source
var LayerBallotTime = metrics.NewSimpleCounter(
namespace,
"layer_ballot_time",
"time spent getting layer-ballot by node id (under lock)",
)
View Source
var WriteBatchErrorsCount = metrics.NewSimpleCounter(
namespace,
"write_batch_errors",
"number of errors when writing a batch",
)
View Source
var WriteTime = metrics.NewSimpleCounter(
namespace,
"batch_write_time",
"time spent writing data to db (under lock)",
)
View Source
var WriteTimeHist = metrics.NewSimpleHistogram( "write_time_hist", namespace, "observed time (in seconds) for writing a ballot", prometheus.ExponentialBuckets(0.01, 10, 5), )
Functions ¶
This section is empty.
Types ¶
type BallotWriter ¶
type BallotWriter struct {
// contains filtered or unexported fields
}
func New ¶
func New(db sql.StateDatabase, logger *zap.Logger) *BallotWriter
func (*BallotWriter) Start ¶
func (w *BallotWriter) Start(ctx context.Context)
Start the forever-loop that flushes the ballots to the DB at-least every `writerDelay`. The caller is responsible to call Start in a different goroutine.
Click to show internal directories.
Click to hide internal directories.