[Metrics UI] Migrating Docker network fields (#65133)

This commit is contained in:
Chris Cowan 2020-05-05 11:34:19 -07:00 committed by GitHub
parent 283b61b1d8
commit 7d5aa80976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 12 deletions

View file

@ -7,6 +7,6 @@
import { networkTrafficWithInterfaces } from '../../../shared/metrics/snapshot/network_traffic_with_interfaces'; import { networkTrafficWithInterfaces } from '../../../shared/metrics/snapshot/network_traffic_with_interfaces';
export const rx = networkTrafficWithInterfaces( export const rx = networkTrafficWithInterfaces(
'rx', 'rx',
'docker.network.in.bytes', 'docker.network.inbound.bytes',
'docker.network.interface' 'docker.network.interface'
); );

View file

@ -7,6 +7,6 @@
import { networkTrafficWithInterfaces } from '../../../shared/metrics/snapshot/network_traffic_with_interfaces'; import { networkTrafficWithInterfaces } from '../../../shared/metrics/snapshot/network_traffic_with_interfaces';
export const tx = networkTrafficWithInterfaces( export const tx = networkTrafficWithInterfaces(
'tx', 'tx',
'docker.network.out.bytes', 'docker.network.outbound.bytes',
'docker.network.interface' 'docker.network.interface'
); );

View file

@ -20,37 +20,73 @@ export const containerNetworkTraffic: TSVBMetricModelCreator = (
series: [ series: [
{ {
id: 'tx', id: 'tx',
split_mode: 'everything',
metrics: [ metrics: [
{ {
field: 'docker.network.out.bytes', field: 'docker.network.outbound.bytes',
id: 'avg-network-out', id: 'max-net-out',
type: 'avg', type: 'max',
},
{
field: 'max-net-out',
id: 'deriv-max-net-out',
type: 'derivative',
unit: '1s',
},
{
id: 'posonly-deriv-max-net-out',
type: 'calculation',
variables: [{ id: 'var-rate', name: 'rate', field: 'deriv-max-net-out' }],
script: 'params.rate > 0.0 ? params.rate : 0.0',
},
{
function: 'sum',
id: 'seriesagg-sum',
type: 'series_agg',
}, },
], ],
split_mode: 'terms',
terms_field: 'docker.network.interface',
}, },
{ {
id: 'rx', id: 'rx',
split_mode: 'everything',
metrics: [ metrics: [
{ {
field: 'docker.network.in.bytes', field: 'docker.network.inbound.bytes',
id: 'avg-network-in', id: 'max-net-in',
type: 'avg', type: 'max',
}, },
{ {
id: 'invert-posonly-deriv-max-network-in', field: 'max-net-in',
id: 'deriv-max-net-in',
type: 'derivative',
unit: '1s',
},
{
id: 'posonly-deriv-max-net-in',
type: 'calculation',
variables: [{ id: 'var-rate', name: 'rate', field: 'deriv-max-net-in' }],
script: 'params.rate > 0.0 ? params.rate : 0.0',
},
{
id: 'calc-invert-rate',
script: 'params.rate * -1', script: 'params.rate * -1',
type: 'calculation', type: 'calculation',
variables: [ variables: [
{ {
field: 'avg-network-in', field: 'posonly-deriv-max-net-in',
id: 'var-rate', id: 'var-rate',
name: 'rate', name: 'rate',
}, },
], ],
}, },
{
function: 'sum',
id: 'seriesagg-sum',
type: 'series_agg',
},
], ],
split_mode: 'terms',
terms_field: 'docker.network.interface',
}, },
], ],
}); });