Skip to content

Commit

Permalink
initial time in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Behrens authored and db7 committed Jan 10, 2018
1 parent 3d8426d commit ace3bf5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kafka/confluent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This a wrapper around the confluent-kafka-go library.
To use library
- Create processor or view with confluent consumer, eg, `goka.WithConsumerBuilder(confluent.NewConsumerBuilder(1000))`
- Install `librdkafka` in the compilation environment
- Compile the go binary with `-tags confluent -tags static`
- Compile the go binary with `-tags "confluent static"`
- Install `libssl1.0.0` `libsasl2-2` (or equivalent) in the execution environment

Note that this is experimental, not well tested and features are missing (in particular `auto.commit` is set to true).
Expand Down
4 changes: 2 additions & 2 deletions partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func (p *partition) fetchStats() *PartitionStats {
case p.requestStats <- true:
case <-p.dying:
// if closing, return empty stats
return newPartitionStats()
return newPartitionStats().init(p.lastStats, p.offset, p.hwm)
case <-timer.C:
return p.lastStats
}
Expand All @@ -389,6 +389,6 @@ func (p *partition) fetchStats() *PartitionStats {
return s
case <-p.dying:
// if closing, return empty stats
return newPartitionStats()
return newPartitionStats().init(p.lastStats, p.offset, p.hwm)
}
}
1 change: 1 addition & 0 deletions stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type PartitionStats struct {

func newPartitionStats() *PartitionStats {
return &PartitionStats{
Now: time.Now(),
Input: make(map[string]InputStats),
Output: make(map[string]OutputStats),
}
Expand Down

0 comments on commit ace3bf5

Please sign in to comment.