mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* [Metrics UI] Ensure inventory view buckets never drop below 60 seconds (#58503) * [Metrics UI] Ensure inventory view buckets never drop below 60 seconds * Fixing tests * Fixing tests... again * Fixing tests... rounding issue? * Trying to fix the tests... again * updating test for custom metric Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * Fixing tests due to rounding issue * Removing test that shouldn't have been backported. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
bf89b9dc2e
commit
c7f840b1c8
2 changed files with 13 additions and 11 deletions
|
@ -21,7 +21,7 @@ export const createTimeRangeWithInterval = async (
|
|||
): Promise<InfraTimerangeInput> => {
|
||||
const aggregations = getMetricsAggregations(options);
|
||||
const modules = await aggregationsToModules(framework, requestContext, aggregations, options);
|
||||
const interval =
|
||||
const interval = Math.max(
|
||||
(await calculateMetricInterval(
|
||||
framework,
|
||||
requestContext,
|
||||
|
@ -32,7 +32,9 @@ export const createTimeRangeWithInterval = async (
|
|||
},
|
||||
modules,
|
||||
options.nodeType
|
||||
)) || 60000;
|
||||
)) || 60,
|
||||
60
|
||||
);
|
||||
return {
|
||||
interval: `${interval}s`,
|
||||
from: options.timerange.to - interval * 5000, // We need at least 5 buckets worth of data
|
||||
|
|
|
@ -189,9 +189,9 @@ export default function({ getService }: FtrProviderContext) {
|
|||
expect(firstNode).to.have.property('metric');
|
||||
expect(firstNode.metric).to.eql({
|
||||
name: 'cpu',
|
||||
value: 0.009285714285714286,
|
||||
max: 0.009285714285714286,
|
||||
avg: 0.0015476190476190477,
|
||||
value: 0.0032,
|
||||
max: 0.0038333333333333336,
|
||||
avg: 0.002794444444444445,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -279,9 +279,9 @@ export default function({ getService }: FtrProviderContext) {
|
|||
expect(firstNode).to.have.property('metric');
|
||||
expect(firstNode.metric).to.eql({
|
||||
name: 'cpu',
|
||||
value: 0.009285714285714286,
|
||||
max: 0.009285714285714286,
|
||||
avg: 0.0015476190476190477,
|
||||
value: 0.0032,
|
||||
max: 0.0038333333333333336,
|
||||
avg: 0.002794444444444445,
|
||||
});
|
||||
const secondNode = nodes[1];
|
||||
expect(secondNode).to.have.property('path');
|
||||
|
@ -291,9 +291,9 @@ export default function({ getService }: FtrProviderContext) {
|
|||
expect(secondNode).to.have.property('metric');
|
||||
expect(secondNode.metric).to.eql({
|
||||
name: 'cpu',
|
||||
value: 0.009285714285714286,
|
||||
max: 0.009285714285714286,
|
||||
avg: 0.0015476190476190477,
|
||||
value: 0.0032,
|
||||
max: 0.0038333333333333336,
|
||||
avg: 0.002794444444444445,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue