@@ -4278,6 +4278,9 @@ switch (c) {
4278
4278
case "memory/usage":
4279
4279
return _.round(b.bytesToMiB(a.value), 2);
4280
4280
4281
+ case "cpu/usage_rate":
4282
+ return b.millicoresToCores(a.value);
4283
+
4281
4284
case "network/rx_rate":
4282
4285
case "network/tx_rate":
4283
4286
return _.round(b.bytesToKiB(a.value), 2);
@@ -4340,11 +4343,6 @@ padding:{
4340
4343
left:0,
4341
4344
top:20,
4342
4345
bottom:0
4343
- },
4344
- tick:{
4345
- format:function(a) {
4346
- return d3.round(a, 3);
4347
- }
4348
4346
}
4349
4347
}
4350
4348
},
@@ -4357,7 +4355,8 @@ height:c ? 35 :175
4357
4355
tooltip:{
4358
4356
format:{
4359
4357
value:function(a) {
4360
- return d3.round(a, 2) + " " + b;
4358
+ var c = "cores" === b ? 3 :2;
4359
+ return d3.round(a, c) + " " + b;
4361
4360
}
4362
4361
}
4363
4362
}
@@ -4377,7 +4376,7 @@ b.push(a.start), f[d].push(e);
4377
4376
}), e.columns = [ b ].concat(_.values(f)), e;
4378
4377
},
4379
4378
formatUsage:function(a) {
4380
- return a < .01 ? "0" :a < 1 ? d3.format(".1r")(a) :d3.format(".2r")(a);
4379
+ return a < .001 ? "0" :a < 1 ? d3.format(".1r")(a) :d3.format(".2r")(a);
4381
4380
},
4382
4381
redraw:function(b) {
4383
4382
a(function() {
@@ -5004,10 +5003,13 @@ var a = function(a) {
5004
5003
return a ? a / 1048576 :a;
5005
5004
}, b = function(a) {
5006
5005
return a ? a / 1024 :a;
5006
+ }, c = function(a) {
5007
+ return a ? a / 1e3 :a;
5007
5008
};
5008
5009
return {
5009
5010
bytesToMiB:a,
5010
- bytesToKiB:b
5011
+ bytesToKiB:b,
5012
+ millicoresToCores:c
5011
5013
};
5012
5014
}), angular.module("openshiftConsole").service("BreadcrumbsService", [ "$filter", "APIService", "Navigate", function(a, b, c) {
5013
5015
var d = a("annotation"), e = a("displayName"), f = function(a) {
@@ -12329,7 +12331,7 @@ break;
12329
12331
12330
12332
case "cpu/usage_rate":
12331
12333
var d = D(b);
12332
- if (d) return _.round(1e3 * k(d) );
12334
+ if (d) return k(d);
12333
12335
}
12334
12336
return null;
12335
12337
}
@@ -12419,7 +12421,7 @@ return !(l.metricsError || J > 1) && (l.pod && _.get(l, "options.selectedContain
12419
12421
function w(a, b, c) {
12420
12422
b.total = m(b.id), b.total && (l.hasLimits = !0);
12421
12423
var d = _.get(c, "usage.value");
12422
- isNaN(d) && (d = 0), a.convert && (d = a.convert(d)), b.used = _ .round(d), b.total && (b.available = _ .round(b.total - d)), a.totalUsed += b.used;
12424
+ isNaN(d) && (d = 0), a.convert && (d = a.convert(d)), b.used = d3 .round(d, a.usagePrecision ), b.total && (b.available = d3 .round(b.total - d, a.usagePrecision )), a.totalUsed += b.used;
12423
12425
}
12424
12426
function x(a, b) {
12425
12427
l.noData = !1;
@@ -12471,9 +12473,10 @@ data:[]
12471
12473
} ]
12472
12474
}), _.includes(l.includedMetrics, "cpu") && l.metrics.push({
12473
12475
label:"CPU",
12474
- units:"millicores ",
12476
+ units:"cores ",
12475
12477
chartPrefix:"cpu-",
12476
- convert:_.round,
12478
+ convert:h.millicoresToCores,
12479
+ usagePrecision:3,
12477
12480
containerMetric:!0,
12478
12481
datasets:[ {
12479
12482
id:"cpu/usage_rate",
@@ -12522,8 +12525,8 @@ widht:175
12522
12525
}
12523
12526
};
12524
12527
}, I = function(a) {
12525
- var b = a.chartPrefix + l.uniqueID + "-sparkline";
12526
- return i.getDefaultSparklineConfig(b, a.units) ;
12528
+ var b = a.chartPrefix + l.uniqueID + "-sparkline", c = i.getDefaultSparklineConfig(b, a.units) ;
12529
+ return 1 === a.datasets.length && _.set(c, "legend.show", !1), c ;
12527
12530
}, J = 0;
12528
12531
l.$watch("options", function() {
12529
12532
_.each(l.metrics, function(a) {
@@ -12680,7 +12683,8 @@ type:"pod_container",
12680
12683
chartID:"memory-" + b.uniqueID
12681
12684
}, {
12682
12685
label:"CPU",
12683
- units:"millicores",
12686
+ units:"cores",
12687
+ convert:g.millicoresToCores,
12684
12688
descriptor:"cpu/usage_rate",
12685
12689
type:"pod_container",
12686
12690
chartID:"cpu-" + b.uniqueID
0 commit comments