[Usage Counters] enhancements#187664
Merged
gsoldevila merged 6 commits intoelastic:mainfrom Jul 5, 2024
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-core (Team:Core) |
afharo
approved these changes
Jul 5, 2024
| await createTestCounters(internalRepository); | ||
| }); | ||
|
|
||
| it('deletes documents older that the retention period, from all namespaces', async () => { |
Member
There was a problem hiding this comment.
FMI: how are we testing the from all namespaces here?
EDIT: Oh! gotcha! createTestCounters creates some counters in other spaces.
| } | ||
|
|
||
| // domainId, counterName, counterType, source, count, namespace? | ||
| type CounterAttributes = [string, string, string, 'ui' | 'server', number, string?]; |
Member
There was a problem hiding this comment.
nit... how about we define this as an object? When I was reading the usage, I was only guessing what each value meant.
Contributor
Author
There was a problem hiding this comment.
I kinda like the compact form of the array, it's much easier to read when defining multiple counters. Example from another test I'm working on:
const FIRST_DAY_COUNTERS: CounterAttributes[] = [
// domainId, counterName, counterType, source, count, namespace?
['dashboards', 'aDashboardId', 'viewed', 'server', 10, 'first'],
['dashboards', 'aDashboardId', 'edited', 'server', 5, 'first'],
['dashboards', 'aDashboardId', 'viewed', 'server', 100, 'second'],
['dashboards', 'aDashboardId', 'edited', 'server', 50, 'second'],
['dashboards', 'aDashboardId', 'consoleErrors', 'ui', 3, 'first'],
['dashboards', 'aDashboardId', 'consoleErrors', 'ui', 9, 'second'],
['dashboards', 'list', 'viewed', 'ui', 256, 'default'],
['someDomain', 'someCounterName', 'someCounter', 'server', 13, 'first'],
];I can add a comment on top of the definition call, as a quick visual reference.
| id, | ||
| ...(namespace && { namespaces: [namespace] }), | ||
| updated_at: date.format(), // illustrative purpose only, overriden by SOR | ||
| // updated_at: date // illustrative purpose only, overriden by SOR |
Member
There was a problem hiding this comment.
if not needed, should we remove it?
| counterName: { type: 'keyword' }, | ||
| counterType: { type: 'keyword' }, | ||
| source: { type: 'keyword' }, | ||
| count: { type: 'integer' }, |
… src/core/server/integration_tests/ci_checks'
Contributor
💚 Build Succeeded
Metrics [docs]
History
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Follow up to #187064
rollups.test.tsintegration test.countfield to the mappings, so that it can be aggregated.