This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Record a Start Time Per Time Series within a View#1220
Merged
james-bebbington merged 8 commits intocensus-instrumentation:masterfrom Jul 14, 2020
Merged
Record a Start Time Per Time Series within a View#1220james-bebbington merged 8 commits intocensus-instrumentation:masterfrom
james-bebbington merged 8 commits intocensus-instrumentation:masterfrom
Conversation
This allows exporters to set a more accurate initial interval when a metric row is added.
Contributor
Author
james-bebbington
approved these changes
Jul 13, 2020
Comment on lines
+324
to
+329
| case *view.CountData: | ||
| data.Start = time.Time{} | ||
| case *view.SumData: | ||
| data.Start = time.Time{} | ||
| case *view.DistributionData: | ||
| data.Start = time.Time{} |
Collaborator
There was a problem hiding this comment.
Nit:
Suggested change
| case *view.CountData: | |
| data.Start = time.Time{} | |
| case *view.SumData: | |
| data.Start = time.Time{} | |
| case *view.DistributionData: | |
| data.Start = time.Time{} | |
| case *view.CountData, *view.SumData, *view.DistributionData: | |
| data.Start = time.Time{} |
(similar for other tests)
Contributor
Author
There was a problem hiding this comment.
This won't work because go must resolve data to a concrete type in order to reference the Start field.
nilebox
reviewed
Jul 14, 2020
nilebox
left a comment
There was a problem hiding this comment.
Overall the idea looks good, just please cleanup the tests from duplicate code
nilebox
approved these changes
Jul 14, 2020
This was referenced Jul 14, 2020
This was referenced Sep 18, 2020
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently all time series within a view will use a single start time recorded when the view is registered. Consequently if a time series is first recorded long after the view is registered the first point will be misattributed to a potentially very long time interval. Instead record a separate start time per time series within AggregationData that is recorded when data for that time series is first recorded. This start time is used when converting rows to TimeSeries and may also be used directly by stats exporters.