From f8e3dea19012ccf05965d10255789eec33c2ebcf Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Thu, 23 Aug 2018 22:51:21 +0100 Subject: Update deps --- vendor/go.opencensus.io/stats/view/worker_commands.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vendor/go.opencensus.io/stats/view/worker_commands.go') diff --git a/vendor/go.opencensus.io/stats/view/worker_commands.go b/vendor/go.opencensus.io/stats/view/worker_commands.go index ef79ec3..06c3c54 100644 --- a/vendor/go.opencensus.io/stats/view/worker_commands.go +++ b/vendor/go.opencensus.io/stats/view/worker_commands.go @@ -73,7 +73,7 @@ func (cmd *registerViewReq) handleCommand(w *worker) { } } -// unregisterFromViewReq is the command to unsubscribe to a view. Has no +// unregisterFromViewReq is the command to unregister to a view. Has no // impact on the data collection for client that are pulling data from the // library. type unregisterFromViewReq struct { @@ -88,6 +88,9 @@ func (cmd *unregisterFromViewReq) handleCommand(w *worker) { continue } + // Report pending data for this view before removing it. + w.reportView(vi, time.Now()) + vi.unsubscribe() if !vi.isSubscribed() { // this was the last subscription and view is not collecting anymore. @@ -143,7 +146,7 @@ type recordReq struct { func (cmd *recordReq) handleCommand(w *worker) { for _, m := range cmd.ms { - if (m == stats.Measurement{}) { // not subscribed + if (m == stats.Measurement{}) { // not registered continue } ref := w.getMeasureRef(m.Measure().Name()) @@ -154,7 +157,7 @@ func (cmd *recordReq) handleCommand(w *worker) { } // setReportingPeriodReq is the command to modify the duration between -// reporting the collected data to the subscribed clients. +// reporting the collected data to the registered clients. type setReportingPeriodReq struct { d time.Duration c chan bool -- cgit v1.2.3