fabric: github.com/hyperledger/fabric/orderer/consensus/kafka Index | Files | Directories

package kafka

import "github.com/hyperledger/fabric/orderer/consensus/kafka"


Package Files

chain.go channel.go config.go consenter.go logger.go metrics.go partitioner.go retry.go


const (
    IncomingByteRateName  = "incoming-byte-rate-for-broker-"
    OutgoingByteRateName  = "outgoing-byte-rate-for-broker-"
    RequestRateName       = "request-rate-for-broker-"
    RequestSizeName       = "request-size-for-broker-"
    RequestLatencyName    = "request-latency-in-ms-for-broker-"
    ResponseRateName      = "response-rate-for-broker-"
    ResponseSizeName      = "response-size-for-broker-"
    BatchSizeName         = "batch-size-for-topic-"
    RecordSendRateName    = "record-send-rate-for-topic-"
    RecordsPerRequestName = "records-per-request-for-topic-"
    CompressionRatioName  = "compression-ratio-for-topic-"

type InactiveChainRegistry Uses

type InactiveChainRegistry interface {
    // TrackChain tracks a chain with the given name, and calls the given callback
    // when this chain should be created.
    TrackChain(chainName string, genesisBlock *cb.Block, createChain func())

InactiveChainRegistry registers chains that are inactive

type Metrics Uses

type Metrics struct {
    // The first set of metrics are all reported by Sarama
    IncomingByteRate  metrics.Gauge
    OutgoingByteRate  metrics.Gauge
    RequestRate       metrics.Gauge
    RequestSize       metrics.Gauge
    RequestLatency    metrics.Gauge
    ResponseRate      metrics.Gauge
    ResponseSize      metrics.Gauge
    BatchSize         metrics.Gauge
    RecordSendRate    metrics.Gauge
    RecordsPerRequest metrics.Gauge
    CompressionRatio  metrics.Gauge

    GoMetricsRegistry gometrics.Registry

    // LastPersistedOffset is reported by the Fabric/Kafka integration
    LastOffsetPersisted metrics.Gauge

func New Uses

func New(config localconfig.Kafka, mp metrics.Provider, healthChecker healthChecker, icr InactiveChainRegistry, mkChain func(string)) (consensus.Consenter, *Metrics)

New creates a Kafka-based consenter. Called by orderer's main.go.

func NewMetrics Uses

func NewMetrics(p metrics.Provider, registry gometrics.Registry) *Metrics

func (*Metrics) PollGoMetrics Uses

func (m *Metrics) PollGoMetrics()

PollGoMetrics takes the current metric values from go-metrics and publishes them to the gauges exposed through go-kit's metrics.

func (*Metrics) PollGoMetricsUntilStop Uses

func (m *Metrics) PollGoMetricsUntilStop(frequency time.Duration, stopChannel <-chan struct{})

PollGoMetricsUntilStop should generally be invoked on a dedicated go routine. This go routine will then invoke PollGoMetrics at the specified frequency until the stopChannel closes.


mockCode generated by counterfeiter.

Package kafka imports 23 packages (graph) and is imported by 1 packages. Updated 2020-02-17. Refresh now. Tools for package owners.