Float: alternate approach to nil hosts/services
This commit is contained in:
parent
5bdeed02bb
commit
0f0c90d970
1 changed files with 4 additions and 17 deletions
|
@ -101,21 +101,8 @@
|
||||||
var servicePrefix = strings.commonPrefix(
|
var servicePrefix = strings.commonPrefix(
|
||||||
_.pluck(this.data, 'riemannService'));
|
_.pluck(this.data, 'riemannService'));
|
||||||
_.each(this.data, function(d) {
|
_.each(this.data, function(d) {
|
||||||
d.label = '';
|
d.label = d.riemannHost.substring(hostPrefix.length) + ' ' +
|
||||||
if (d.riemannHost) {
|
d.riemannService.substring(servicePrefix.length);
|
||||||
d.label += d.riemannHost.substring(hostPrefix.length);
|
|
||||||
} else {
|
|
||||||
d.label += 'nil';
|
|
||||||
}
|
|
||||||
|
|
||||||
d.label += ' ';
|
|
||||||
|
|
||||||
if (d.riemannService) {
|
|
||||||
d.label += d.riemannService.substring(servicePrefix.length);
|
|
||||||
} else {
|
|
||||||
d.label += 'nil';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Empty labels are expanded back to full ones.
|
// Empty labels are expanded back to full ones.
|
||||||
if (d.label === ' ') {
|
if (d.label === ' ') {
|
||||||
d.label = d.riemannHost + ' ' + d.riemannService;
|
d.label = d.riemannHost + ' ' + d.riemannService;
|
||||||
|
@ -149,8 +136,8 @@
|
||||||
if (this.series[key] === undefined) {
|
if (this.series[key] === undefined) {
|
||||||
this.data.push({
|
this.data.push({
|
||||||
riemannKey: key,
|
riemannKey: key,
|
||||||
riemannHost: event.host,
|
riemannHost: event.host || 'nil',
|
||||||
riemannService: event.service,
|
riemannService: event.service || 'nil',
|
||||||
lineWidth: this.lineWidth,
|
lineWidth: this.lineWidth,
|
||||||
shadowSize: 0,
|
shadowSize: 0,
|
||||||
data: []
|
data: []
|
||||||
|
|
Loading…
Reference in a new issue