Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial time in stats #76

Merged
merged 1 commit into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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