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

reset stats after load finished #61

Merged
merged 2 commits into from
Dec 6, 2017
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
3 changes: 3 additions & 0 deletions partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ func (p *partition) load(catchup bool) error {
stallTicker := time.NewTicker(stallPeriod)
defer stallTicker.Stop()

// reset stats after load
defer p.stats.reset()

var lastMessage time.Time
for {
select {
Expand Down
5 changes: 5 additions & 0 deletions stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func (s *PartitionStats) copy(o *PartitionStats) {
}
}

func (s *PartitionStats) reset() {
s.Input = make(map[string]InputStats)
s.Output = make(map[string]OutputStats)
}

type ViewStats struct {
Partitions map[int32]*PartitionStats
}
Expand Down
4 changes: 2 additions & 2 deletions web/templates/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions web/templates/monitor/details.go.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,7 @@ <h3>Table statistics</h3>
var outputBytes = 0;
var inputDelay = -1;
// start with a chained operation on the Input of stats.
// if the table is recovered and we're displaying a processor
// let's omit the tableName's metrics from recovery, as they do not change
// anymore and just mess up our delay value in the frontend
var inputChain = _.chain(stats.Input);
if(stats.Table.Recovered && {{.renderType }} == "processor"){
inputChain = inputChain.omit({{.tableName}});
}
// if we do have values to get the avg from, let's take it.
// if we tried on an empty list, it would create a NaN
if(inputChain.size().value() > 0){
Expand Down